Describe the Features
Type aliases are not supported. For example, with:
type Alias = int
class State(rx.State):
count: Alias = 0
I get TypeError: Unsupported type Alias for guess_type. (the error message could also be better - wtf is "guess_type"?)
The algorithm that determines guess_type could try to resolve type aliases before giving up.
- Show an example / use cases for the new feature.
class State(rx.State):
a: Literal["amber", "blue", ... many other colors, "yellow"]
b: Literal["amber", "blue", ... many other colors, "yellow"]
would become
type ColorSchema = Literal["amber", "blue", ... many other colors, "yellow"]
class State(rx.State):
a: ColorSchema
b: ColorSchema
Describe the Features
Type aliases are not supported. For example, with:
I get
TypeError: Unsupported type Alias for guess_type.(the error message could also be better - wtf is "guess_type"?)The algorithm that determines
guess_typecould try to resolve type aliases before giving up.would become