summaryrefslogtreecommitdiff
path: root/test/ext/mypy/plain_files/sql_operations.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/ext/mypy/plain_files/sql_operations.py')
-rw-r--r--test/ext/mypy/plain_files/sql_operations.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ext/mypy/plain_files/sql_operations.py b/test/ext/mypy/plain_files/sql_operations.py
new file mode 100644
index 000000000..2cee1ddca
--- /dev/null
+++ b/test/ext/mypy/plain_files/sql_operations.py
@@ -0,0 +1,20 @@
+import typing
+
+from sqlalchemy import column
+from sqlalchemy import Integer
+
+# builtin.pyi stubs define object.__eq__() as returning bool, which
+# can't be overridden (it's final). So for us to type `__eq__()` and
+# `__ne__()`, we have to use type: ignore[override]. Test if does this mean
+# the typing tools don't know the type, or if they just ignore the error.
+# (it's fortunately the former)
+expr1 = column("x", Integer) == 10
+
+
+if typing.TYPE_CHECKING:
+
+ # as far as if this is ColumnElement, BinaryElement, SQLCoreOperations,
+ # that might change. main thing is it's SomeSQLColThing[bool] and
+ # not 'bool' or 'Any'.
+ # EXPECTED_TYPE: sqlalchemy..*ColumnElement\[builtins.bool\]
+ reveal_type(expr1)