Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 34e8f54

Browse files
committed
strings over enums
1 parent 6b6dfe9 commit 34e8f54

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

governance/api-reviews.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ thread-local. The TF API is supposed to be thread-safe. Avoid stateful operation
123123
(mutability) if you can. Both features make it hard to reason about code, and
124124
make composability harder to achieve.
125125

126+
We prefer strings ("auto", "never", etc) over enums (tf.namespace.AUTO,
127+
etc). Strings are easier to type, and forces us to document all possible values
128+
and their semantics in the docstrings of all places which accept the string, as
129+
opposed to only in the enum definition, which is a little friendlier.
130+
126131
### Orthogonality and integration with the existing APIs
127132

128133
Is the new API implementable in terms of existing APIs? If so, we might want to

0 commit comments

Comments
 (0)