I think it is better to move this discussion to https://github.com/python/typing/discussions :) чт, 23 мар. 2023 г. в 14:55, Chihiro Sakai <sakaic2003@gmail.com>:
No, this is not a solution I actually want.
```python class Entity(Base): __tablename__ = 'entity' column_1: 'IWantCorrectTypeHere' = Column('column_1', BIGINT(unsigned=True), ...) ```
I want a proper type for `IWantCorrectTypeHere`, while `Field` isn't. The requirement of the type is:
1. No errors shouldn't be reported while initializing the class variable with the `Column` instance. 2. Incorrect type error should be reported while initializing/assigning the class variable with an `int` or any other value, not a `Column` instance. 3. No errors shouldn't be reported while assigning/reading the instance variable with an `int` value. 4. Incorrect type error should be reported while assigning/reading the class variable with a `Column` instance or any other value, not an `int` value.
Obviously, descriptors like properties never handle assigning class variables' values themselves, so I believe those descriptors aren't proper for these cases. _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: n.a.sobolev@gmail.com