diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2022-02-13 20:37:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-02-13 20:37:12 +0000 |
commit | d6b3c82b0c329730bcaff42b4bb39dba83acb536 (patch) | |
tree | d6b7f744a35c8d89615eeb0504ee7a4193f95642 /test/ext/mypy/plugin_files/boolean_col.py | |
parent | 260ade78a70d51378de9e7b9456bfe6218859b6c (diff) | |
parent | e545298e35ea9f126054b337e4b5ba01988b29f7 (diff) | |
download | sqlalchemy-d6b3c82b0c329730bcaff42b4bb39dba83acb536.tar.gz |
Merge "establish mypy / typing approach for v2.0" into main
Diffstat (limited to 'test/ext/mypy/plugin_files/boolean_col.py')
-rw-r--r-- | test/ext/mypy/plugin_files/boolean_col.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ext/mypy/plugin_files/boolean_col.py b/test/ext/mypy/plugin_files/boolean_col.py new file mode 100644 index 000000000..3e361ad10 --- /dev/null +++ b/test/ext/mypy/plugin_files/boolean_col.py @@ -0,0 +1,24 @@ +from typing import Optional + +from sqlalchemy import Boolean +from sqlalchemy import Column +from sqlalchemy.orm import declarative_base + +Base = declarative_base() + + +class TestBoolean(Base): + __tablename__ = "test_boolean" + + flag = Column(Boolean) + + bflag: bool = Column(Boolean(create_constraint=True)) + + +expr = TestBoolean.flag.is_(True) + +t1 = TestBoolean(flag=True) + +x: Optional[bool] = t1.flag + +y: bool = t1.bflag |