From c1545b78f2570a65be72b4eee0d2df363679cd32 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Jan 2023 21:47:08 -0500 Subject: [PATCH 01/25] Fix most stubtest_allowlist entries in SQLAlchemy --- .../SQLAlchemy/@tests/stubtest_allowlist.txt | 1174 +---------------- .../sqlalchemy/dialects/mssql/base.pyi | 1 - .../sqlalchemy/dialects/postgresql/base.pyi | 1 + .../sqlalchemy/engine/interfaces.pyi | 1 - stubs/SQLAlchemy/sqlalchemy/event/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/collections.pyi | 49 +- .../sqlalchemy/orm/strategy_options.pyi | 145 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi | 4 +- .../sqlalchemy/testing/provision.pyi | 134 +- stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi | 4 + .../sqlalchemy/util/_collections.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 40 +- 16 files changed, 322 insertions(+), 1245 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 21c09df701a7..7760c23792d6 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -1,25 +1,7 @@ -# wrong argument name in implementation ("self" instead of "cls") -sqlalchemy.engine.URL.__new__ -sqlalchemy.engine.url.URL.__new__ -sqlalchemy.util.langhelpers._symbol.__new__ - -# unnecessary re-exports -sqlalchemy.util._collections.* -sqlalchemy.util.compat.* - -# forwards arguments to another function +# Expanding keyword arguments in stubs sqlalchemy.ext.declarative.as_declarative - -# stdlib re-exports with stubtest issues -sqlalchemy.orm.collections.InstrumentedList.* -sqlalchemy.orm.collections.InstrumentedSet.* -sqlalchemy.orm.collections.MappedCollection.* -sqlalchemy.util.StringIO.* - -# method arguments starting with double underscores in the implementation -sqlalchemy.testing.resolve_lambda -sqlalchemy.testing.util.resolve_lambda -sqlalchemy.util.WeakSequence.__init__ +sqlalchemy.orm.strategy_options.loader_option.__call__ +sqlalchemy.testing.provision.register.__call__ # not always present sqlalchemy.engine.Engine.logging_name # initialized if not None @@ -27,78 +9,10 @@ sqlalchemy.engine.base.Engine.logging_name # initialized if not None sqlalchemy.sql.lambdas.PyWrapper.__clause_element__ sqlalchemy.testing.util.non_refcount_gc_collect -# replaced at runtime -sqlalchemy.orm.strategy_options.contains_eager -sqlalchemy.orm.strategy_options.load_only -sqlalchemy.orm.strategy_options.joinedload -sqlalchemy.orm.strategy_options.subqueryload -sqlalchemy.orm.strategy_options.selectinload -sqlalchemy.orm.strategy_options.lazyload -sqlalchemy.orm.strategy_options.immediateload -sqlalchemy.orm.strategy_options.noload -sqlalchemy.orm.strategy_options.raiseload -sqlalchemy.orm.strategy_options.defaultload -sqlalchemy.orm.strategy_options.defer -sqlalchemy.orm.strategy_options.undefer -sqlalchemy.orm.strategy_options.undefer_group -sqlalchemy.orm.strategy_options.with_expression -sqlalchemy.orm.strategy_options.selectin_polymorphic -sqlalchemy.testing.provision.configure_follower -sqlalchemy.testing.provision.create_db -sqlalchemy.testing.provision.drop_all_schema_objects_post_tables -sqlalchemy.testing.provision.drop_all_schema_objects_pre_tables -sqlalchemy.testing.provision.drop_db -sqlalchemy.testing.provision.follower_url_from_main -sqlalchemy.testing.provision.generate_driver_url -sqlalchemy.testing.provision.get_temp_table_name -sqlalchemy.testing.provision.post_configure_engine -sqlalchemy.testing.provision.prepare_for_drop_tables -sqlalchemy.testing.provision.run_reap_dbs -sqlalchemy.testing.provision.set_default_schema_on_connection -sqlalchemy.testing.provision.stop_test_class_outside_fixtures -sqlalchemy.testing.provision.temp_table_keyword_args -sqlalchemy.testing.provision.update_db_opts - -# KeyError/AttributeError on import due to dynamic initialization from a different module -sqlalchemy.testing.fixtures -sqlalchemy.testing.pickleable -sqlalchemy.testing.plugin.bootstrap - -# Initialized to bool during __init__() -sqlalchemy.orm.Mapper.single -sqlalchemy.orm.mapper.Mapper.single - -# Dynamically added methods where the first argument is not named "self" -sqlalchemy.orm.Load.contains_eager -sqlalchemy.orm.Load.defaultload -sqlalchemy.orm.Load.defer -sqlalchemy.orm.Load.immediateload -sqlalchemy.orm.Load.joinedload -sqlalchemy.orm.Load.lazyload -sqlalchemy.orm.Load.load_only -sqlalchemy.orm.Load.noload -sqlalchemy.orm.Load.raiseload -sqlalchemy.orm.Load.selectin_polymorphic -sqlalchemy.orm.Load.selectinload -sqlalchemy.orm.Load.subqueryload -sqlalchemy.orm.Load.undefer -sqlalchemy.orm.Load.undefer_group -sqlalchemy.orm.Load.with_expression -sqlalchemy.orm.strategy_options.Load.contains_eager -sqlalchemy.orm.strategy_options.Load.defaultload -sqlalchemy.orm.strategy_options.Load.defer -sqlalchemy.orm.strategy_options.Load.immediateload -sqlalchemy.orm.strategy_options.Load.joinedload -sqlalchemy.orm.strategy_options.Load.lazyload -sqlalchemy.orm.strategy_options.Load.load_only -sqlalchemy.orm.strategy_options.Load.noload -sqlalchemy.orm.strategy_options.Load.raiseload -sqlalchemy.orm.strategy_options.Load.selectin_polymorphic -sqlalchemy.orm.strategy_options.Load.selectinload -sqlalchemy.orm.strategy_options.Load.subqueryload -sqlalchemy.orm.strategy_options.Load.undefer -sqlalchemy.orm.strategy_options.Load.undefer_group -sqlalchemy.orm.strategy_options.Load.with_expression +# wrong argument name in implementation ("self" instead of "cls") +sqlalchemy.engine.URL.__new__ +sqlalchemy.engine.url.URL.__new__ +sqlalchemy.util.langhelpers._symbol.__new__ # abstract fields not present at runtime sqlalchemy.engine.Transaction.connection @@ -106,9 +20,11 @@ sqlalchemy.engine.Transaction.is_active sqlalchemy.engine.base.Transaction.connection sqlalchemy.engine.base.Transaction.is_active -# initialized to None during class construction, but overridden during __init__() -sqlalchemy.engine.Connection.engine +# initialized to None during class construction, but overridden during __init__() or __new__() sqlalchemy.engine.base.Connection.engine +sqlalchemy.engine.Connection.engine +sqlalchemy.orm.Mapper.single +sqlalchemy.orm.mapper.Mapper.single # uses @memoized_property at runtime, but we use @property for compatibility sqlalchemy.engine.URL.normalized_query @@ -126,1067 +42,23 @@ sqlalchemy.sql.annotation.Annotated.__new__ # as having conflicting __new__/__init__ methods sqlalchemy.orm.unitofwork.PostSortRec.__new__ -# unclear problems +# KeyError/AttributeError on import due to dynamic initialization from a different module +sqlalchemy.testing.fixtures +sqlalchemy.testing.pickleable +sqlalchemy.testing.plugin.bootstrap + +# method arguments starting with double underscores in the implementation trips up stubtest +sqlalchemy.testing.resolve_lambda +sqlalchemy.testing.util.resolve_lambda +sqlalchemy.orm.collections.MappedCollection.update + +# stubtest thinks __slots__ are always members +# https://github.com/python/mypy/issues/13906 sqlalchemy.sql.elements.quoted_name.lower sqlalchemy.sql.elements.quoted_name.upper sqlalchemy.sql.expression.quoted_name.lower sqlalchemy.sql.expression.quoted_name.upper sqlalchemy.sql.quoted_name.lower sqlalchemy.sql.quoted_name.upper -sqlalchemy.util.callable - -sqlalchemy.dialects.mssql.base.MSExecutionContext.get_result_cursor_strategy -sqlalchemy.dialects.postgresql.base.PGDDLCompiler.visit_foreign_key_constraint -sqlalchemy.engine.ExecutionContext.get_result_cursor_strategy -sqlalchemy.engine.interfaces.ExecutionContext.get_result_cursor_strategy sqlalchemy.orm.ColumnProperty.Comparator.__clause_element__ sqlalchemy.orm.properties.ColumnProperty.Comparator.__clause_element__ - -# Metaclass differs: -sqlalchemy.ARRAY -sqlalchemy.BIGINT -sqlalchemy.BINARY -sqlalchemy.BLOB -sqlalchemy.BOOLEAN -sqlalchemy.BigInteger -sqlalchemy.Boolean -sqlalchemy.CHAR -sqlalchemy.CLOB -sqlalchemy.CheckConstraint -sqlalchemy.Column -sqlalchemy.ColumnDefault -sqlalchemy.Computed -sqlalchemy.Constraint -sqlalchemy.DATE -sqlalchemy.DATETIME -sqlalchemy.DDL -sqlalchemy.DECIMAL -sqlalchemy.Date -sqlalchemy.DateTime -sqlalchemy.Enum -sqlalchemy.FLOAT -sqlalchemy.Float -sqlalchemy.ForeignKey -sqlalchemy.ForeignKeyConstraint -sqlalchemy.INTEGER -sqlalchemy.Identity -sqlalchemy.Index -sqlalchemy.Integer -sqlalchemy.Interval -sqlalchemy.JSON -sqlalchemy.JSON.JSONElementType -sqlalchemy.JSON.JSONIndexType -sqlalchemy.JSON.JSONIntIndexType -sqlalchemy.JSON.JSONPathType -sqlalchemy.JSON.JSONStrIndexType -sqlalchemy.LargeBinary -sqlalchemy.MetaData -sqlalchemy.NCHAR -sqlalchemy.NUMERIC -sqlalchemy.NVARCHAR -sqlalchemy.Numeric -sqlalchemy.PickleType -sqlalchemy.PrimaryKeyConstraint -sqlalchemy.REAL -sqlalchemy.SMALLINT -sqlalchemy.Sequence -sqlalchemy.SmallInteger -sqlalchemy.String -sqlalchemy.TEXT -sqlalchemy.TIME -sqlalchemy.TIMESTAMP -sqlalchemy.Table -sqlalchemy.Text -sqlalchemy.ThreadLocalMetaData -sqlalchemy.Time -sqlalchemy.TupleType -sqlalchemy.TypeDecorator -sqlalchemy.Unicode -sqlalchemy.UnicodeText -sqlalchemy.UniqueConstraint -sqlalchemy.VARBINARY -sqlalchemy.VARCHAR -sqlalchemy.dialects.firebird.BIGINT -sqlalchemy.dialects.firebird.BLOB -sqlalchemy.dialects.firebird.CHAR -sqlalchemy.dialects.firebird.DATE -sqlalchemy.dialects.firebird.FLOAT -sqlalchemy.dialects.firebird.NUMERIC -sqlalchemy.dialects.firebird.SMALLINT -sqlalchemy.dialects.firebird.TEXT -sqlalchemy.dialects.firebird.TIME -sqlalchemy.dialects.firebird.TIMESTAMP -sqlalchemy.dialects.firebird.VARCHAR -sqlalchemy.dialects.firebird.base.BIGINT -sqlalchemy.dialects.firebird.base.BLOB -sqlalchemy.dialects.firebird.base.CHAR -sqlalchemy.dialects.firebird.base.DATE -sqlalchemy.dialects.firebird.base.FBTypeCompiler -sqlalchemy.dialects.firebird.base.FLOAT -sqlalchemy.dialects.firebird.base.INTEGER -sqlalchemy.dialects.firebird.base.Integer -sqlalchemy.dialects.firebird.base.NUMERIC -sqlalchemy.dialects.firebird.base.SMALLINT -sqlalchemy.dialects.firebird.base.TEXT -sqlalchemy.dialects.firebird.base.TIME -sqlalchemy.dialects.firebird.base.TIMESTAMP -sqlalchemy.dialects.firebird.base.VARCHAR -sqlalchemy.dialects.firebird.base._FBDateTime -sqlalchemy.dialects.firebird.base._StringType -sqlalchemy.dialects.firebird.kinterbasdb._FBFloat_kinterbasdb -sqlalchemy.dialects.firebird.kinterbasdb._FBNumeric_kinterbasdb -sqlalchemy.dialects.mssql.BIGINT -sqlalchemy.dialects.mssql.BINARY -sqlalchemy.dialects.mssql.BIT -sqlalchemy.dialects.mssql.CHAR -sqlalchemy.dialects.mssql.DATE -sqlalchemy.dialects.mssql.DATETIME -sqlalchemy.dialects.mssql.DATETIME2 -sqlalchemy.dialects.mssql.DATETIMEOFFSET -sqlalchemy.dialects.mssql.DECIMAL -sqlalchemy.dialects.mssql.FLOAT -sqlalchemy.dialects.mssql.IMAGE -sqlalchemy.dialects.mssql.INTEGER -sqlalchemy.dialects.mssql.JSON -sqlalchemy.dialects.mssql.MONEY -sqlalchemy.dialects.mssql.NCHAR -sqlalchemy.dialects.mssql.NTEXT -sqlalchemy.dialects.mssql.NUMERIC -sqlalchemy.dialects.mssql.NVARCHAR -sqlalchemy.dialects.mssql.REAL -sqlalchemy.dialects.mssql.ROWVERSION -sqlalchemy.dialects.mssql.SMALLDATETIME -sqlalchemy.dialects.mssql.SMALLINT -sqlalchemy.dialects.mssql.SMALLMONEY -sqlalchemy.dialects.mssql.SQL_VARIANT -sqlalchemy.dialects.mssql.TEXT -sqlalchemy.dialects.mssql.TIME -sqlalchemy.dialects.mssql.TIMESTAMP -sqlalchemy.dialects.mssql.TINYINT -sqlalchemy.dialects.mssql.UNIQUEIDENTIFIER -sqlalchemy.dialects.mssql.VARBINARY -sqlalchemy.dialects.mssql.VARCHAR -sqlalchemy.dialects.mssql.XML -sqlalchemy.dialects.mssql.base.BIGINT -sqlalchemy.dialects.mssql.base.BINARY -sqlalchemy.dialects.mssql.base.BIT -sqlalchemy.dialects.mssql.base.CHAR -sqlalchemy.dialects.mssql.base.DATE -sqlalchemy.dialects.mssql.base.DATETIME -sqlalchemy.dialects.mssql.base.DATETIME2 -sqlalchemy.dialects.mssql.base.DATETIMEOFFSET -sqlalchemy.dialects.mssql.base.DECIMAL -sqlalchemy.dialects.mssql.base.FLOAT -sqlalchemy.dialects.mssql.base.IMAGE -sqlalchemy.dialects.mssql.base.INTEGER -sqlalchemy.dialects.mssql.base.JSON -sqlalchemy.dialects.mssql.base.MONEY -sqlalchemy.dialects.mssql.base.MSTypeCompiler -sqlalchemy.dialects.mssql.base.NCHAR -sqlalchemy.dialects.mssql.base.NTEXT -sqlalchemy.dialects.mssql.base.NUMERIC -sqlalchemy.dialects.mssql.base.NVARCHAR -sqlalchemy.dialects.mssql.base.REAL -sqlalchemy.dialects.mssql.base.ROWVERSION -sqlalchemy.dialects.mssql.base.SMALLDATETIME -sqlalchemy.dialects.mssql.base.SMALLINT -sqlalchemy.dialects.mssql.base.SMALLMONEY -sqlalchemy.dialects.mssql.base.SQL_VARIANT -sqlalchemy.dialects.mssql.base.TEXT -sqlalchemy.dialects.mssql.base.TIME -sqlalchemy.dialects.mssql.base.TIMESTAMP -sqlalchemy.dialects.mssql.base.TINYINT -sqlalchemy.dialects.mssql.base.TryCast -sqlalchemy.dialects.mssql.base.UNIQUEIDENTIFIER -sqlalchemy.dialects.mssql.base.VARBINARY -sqlalchemy.dialects.mssql.base.VARCHAR -sqlalchemy.dialects.mssql.base.XML -sqlalchemy.dialects.mssql.base._BASETIMEIMPL -sqlalchemy.dialects.mssql.base._MSDate -sqlalchemy.dialects.mssql.base._MSDateTime -sqlalchemy.dialects.mssql.base._MSUnicode -sqlalchemy.dialects.mssql.base._MSUnicodeText -sqlalchemy.dialects.mssql.information_schema.CoerceUnicode -sqlalchemy.dialects.mssql.information_schema.IdentitySqlVariant -sqlalchemy.dialects.mssql.information_schema._cast_on_2005 -sqlalchemy.dialects.mssql.json.JSON -sqlalchemy.dialects.mssql.json.JSONIndexType -sqlalchemy.dialects.mssql.json.JSONPathType -sqlalchemy.dialects.mssql.mxodbc._MSDate_mxodbc -sqlalchemy.dialects.mssql.mxodbc._MSNumeric_mxodbc -sqlalchemy.dialects.mssql.mxodbc._MSTime_mxodbc -sqlalchemy.dialects.mssql.mxodbc._VARBINARY_mxodbc -sqlalchemy.dialects.mssql.pymssql._MSNumeric_pymssql -sqlalchemy.dialects.mssql.pyodbc._BINARY_pyodbc -sqlalchemy.dialects.mssql.pyodbc._MSFloat_pyodbc -sqlalchemy.dialects.mssql.pyodbc._MSNumeric_pyodbc -sqlalchemy.dialects.mssql.pyodbc._ODBCDATETIMEOFFSET -sqlalchemy.dialects.mssql.pyodbc._ODBCDateTime -sqlalchemy.dialects.mssql.pyodbc._VARBINARY_pyodbc -sqlalchemy.dialects.mysql.BIGINT -sqlalchemy.dialects.mysql.BINARY -sqlalchemy.dialects.mysql.BIT -sqlalchemy.dialects.mysql.BLOB -sqlalchemy.dialects.mysql.BOOLEAN -sqlalchemy.dialects.mysql.CHAR -sqlalchemy.dialects.mysql.DATE -sqlalchemy.dialects.mysql.DATETIME -sqlalchemy.dialects.mysql.DECIMAL -sqlalchemy.dialects.mysql.DOUBLE -sqlalchemy.dialects.mysql.ENUM -sqlalchemy.dialects.mysql.FLOAT -sqlalchemy.dialects.mysql.INTEGER -sqlalchemy.dialects.mysql.Insert -sqlalchemy.dialects.mysql.JSON -sqlalchemy.dialects.mysql.LONGBLOB -sqlalchemy.dialects.mysql.LONGTEXT -sqlalchemy.dialects.mysql.MEDIUMBLOB -sqlalchemy.dialects.mysql.MEDIUMINT -sqlalchemy.dialects.mysql.MEDIUMTEXT -sqlalchemy.dialects.mysql.NCHAR -sqlalchemy.dialects.mysql.NUMERIC -sqlalchemy.dialects.mysql.NVARCHAR -sqlalchemy.dialects.mysql.REAL -sqlalchemy.dialects.mysql.SET -sqlalchemy.dialects.mysql.SMALLINT -sqlalchemy.dialects.mysql.TEXT -sqlalchemy.dialects.mysql.TIME -sqlalchemy.dialects.mysql.TIMESTAMP -sqlalchemy.dialects.mysql.TINYBLOB -sqlalchemy.dialects.mysql.TINYINT -sqlalchemy.dialects.mysql.TINYTEXT -sqlalchemy.dialects.mysql.VARBINARY -sqlalchemy.dialects.mysql.VARCHAR -sqlalchemy.dialects.mysql.YEAR -sqlalchemy.dialects.mysql.base.BIGINT -sqlalchemy.dialects.mysql.base.BINARY -sqlalchemy.dialects.mysql.base.BIT -sqlalchemy.dialects.mysql.base.BLOB -sqlalchemy.dialects.mysql.base.BOOLEAN -sqlalchemy.dialects.mysql.base.CHAR -sqlalchemy.dialects.mysql.base.DATE -sqlalchemy.dialects.mysql.base.DATETIME -sqlalchemy.dialects.mysql.base.DECIMAL -sqlalchemy.dialects.mysql.base.DOUBLE -sqlalchemy.dialects.mysql.base.ENUM -sqlalchemy.dialects.mysql.base.FLOAT -sqlalchemy.dialects.mysql.base.INTEGER -sqlalchemy.dialects.mysql.base.JSON -sqlalchemy.dialects.mysql.base.LONGBLOB -sqlalchemy.dialects.mysql.base.LONGTEXT -sqlalchemy.dialects.mysql.base.MEDIUMBLOB -sqlalchemy.dialects.mysql.base.MEDIUMINT -sqlalchemy.dialects.mysql.base.MEDIUMTEXT -sqlalchemy.dialects.mysql.base.MySQLTypeCompiler -sqlalchemy.dialects.mysql.base.NCHAR -sqlalchemy.dialects.mysql.base.NUMERIC -sqlalchemy.dialects.mysql.base.NVARCHAR -sqlalchemy.dialects.mysql.base.REAL -sqlalchemy.dialects.mysql.base.SET -sqlalchemy.dialects.mysql.base.SMALLINT -sqlalchemy.dialects.mysql.base.TEXT -sqlalchemy.dialects.mysql.base.TIME -sqlalchemy.dialects.mysql.base.TIMESTAMP -sqlalchemy.dialects.mysql.base.TINYBLOB -sqlalchemy.dialects.mysql.base.TINYINT -sqlalchemy.dialects.mysql.base.TINYTEXT -sqlalchemy.dialects.mysql.base.VARBINARY -sqlalchemy.dialects.mysql.base.VARCHAR -sqlalchemy.dialects.mysql.base.YEAR -sqlalchemy.dialects.mysql.cymysql._cymysqlBIT -sqlalchemy.dialects.mysql.dml.Insert -sqlalchemy.dialects.mysql.dml.OnDuplicateClause -sqlalchemy.dialects.mysql.enumerated.ENUM -sqlalchemy.dialects.mysql.enumerated.SET -sqlalchemy.dialects.mysql.expression.match -sqlalchemy.dialects.mysql.json.JSON -sqlalchemy.dialects.mysql.json.JSONIndexType -sqlalchemy.dialects.mysql.json.JSONPathType -sqlalchemy.dialects.mysql.match -sqlalchemy.dialects.mysql.mysqlconnector._myconnpyBIT -sqlalchemy.dialects.mysql.oursql._oursqlBIT -sqlalchemy.dialects.mysql.pyodbc._pyodbcTIME -sqlalchemy.dialects.mysql.types.BIGINT -sqlalchemy.dialects.mysql.types.BIT -sqlalchemy.dialects.mysql.types.CHAR -sqlalchemy.dialects.mysql.types.DATETIME -sqlalchemy.dialects.mysql.types.DECIMAL -sqlalchemy.dialects.mysql.types.DOUBLE -sqlalchemy.dialects.mysql.types.FLOAT -sqlalchemy.dialects.mysql.types.INTEGER -sqlalchemy.dialects.mysql.types.LONGBLOB -sqlalchemy.dialects.mysql.types.LONGTEXT -sqlalchemy.dialects.mysql.types.MEDIUMBLOB -sqlalchemy.dialects.mysql.types.MEDIUMINT -sqlalchemy.dialects.mysql.types.MEDIUMTEXT -sqlalchemy.dialects.mysql.types.NCHAR -sqlalchemy.dialects.mysql.types.NUMERIC -sqlalchemy.dialects.mysql.types.NVARCHAR -sqlalchemy.dialects.mysql.types.REAL -sqlalchemy.dialects.mysql.types.SMALLINT -sqlalchemy.dialects.mysql.types.TEXT -sqlalchemy.dialects.mysql.types.TIME -sqlalchemy.dialects.mysql.types.TIMESTAMP -sqlalchemy.dialects.mysql.types.TINYBLOB -sqlalchemy.dialects.mysql.types.TINYINT -sqlalchemy.dialects.mysql.types.TINYTEXT -sqlalchemy.dialects.mysql.types.VARCHAR -sqlalchemy.dialects.mysql.types.YEAR -sqlalchemy.dialects.mysql.types._FloatType -sqlalchemy.dialects.mysql.types._IntegerType -sqlalchemy.dialects.mysql.types._MatchType -sqlalchemy.dialects.mysql.types._StringType -sqlalchemy.dialects.oracle.BFILE -sqlalchemy.dialects.oracle.BINARY_DOUBLE -sqlalchemy.dialects.oracle.BINARY_FLOAT -sqlalchemy.dialects.oracle.BLOB -sqlalchemy.dialects.oracle.CHAR -sqlalchemy.dialects.oracle.CLOB -sqlalchemy.dialects.oracle.DATE -sqlalchemy.dialects.oracle.DOUBLE_PRECISION -sqlalchemy.dialects.oracle.FLOAT -sqlalchemy.dialects.oracle.INTERVAL -sqlalchemy.dialects.oracle.LONG -sqlalchemy.dialects.oracle.NCHAR -sqlalchemy.dialects.oracle.NCLOB -sqlalchemy.dialects.oracle.NUMBER -sqlalchemy.dialects.oracle.NVARCHAR -sqlalchemy.dialects.oracle.RAW -sqlalchemy.dialects.oracle.ROWID -sqlalchemy.dialects.oracle.TIMESTAMP -sqlalchemy.dialects.oracle.VARCHAR -sqlalchemy.dialects.oracle.VARCHAR2 -sqlalchemy.dialects.oracle.base.BFILE -sqlalchemy.dialects.oracle.base.BINARY_DOUBLE -sqlalchemy.dialects.oracle.base.BINARY_FLOAT -sqlalchemy.dialects.oracle.base.BLOB -sqlalchemy.dialects.oracle.base.CHAR -sqlalchemy.dialects.oracle.base.CLOB -sqlalchemy.dialects.oracle.base.DATE -sqlalchemy.dialects.oracle.base.DOUBLE_PRECISION -sqlalchemy.dialects.oracle.base.FLOAT -sqlalchemy.dialects.oracle.base.INTEGER -sqlalchemy.dialects.oracle.base.INTERVAL -sqlalchemy.dialects.oracle.base.LONG -sqlalchemy.dialects.oracle.base.NCHAR -sqlalchemy.dialects.oracle.base.NCLOB -sqlalchemy.dialects.oracle.base.NUMBER -sqlalchemy.dialects.oracle.base.NVARCHAR -sqlalchemy.dialects.oracle.base.OracleTypeCompiler -sqlalchemy.dialects.oracle.base.RAW -sqlalchemy.dialects.oracle.base.ROWID -sqlalchemy.dialects.oracle.base.TIMESTAMP -sqlalchemy.dialects.oracle.base.VARCHAR -sqlalchemy.dialects.oracle.base.VARCHAR2 -sqlalchemy.dialects.oracle.base._OracleBoolean -sqlalchemy.dialects.oracle.base._OuterJoinColumn -sqlalchemy.dialects.oracle.cx_oracle._OracleBINARY_DOUBLE -sqlalchemy.dialects.oracle.cx_oracle._OracleBINARY_FLOAT -sqlalchemy.dialects.oracle.cx_oracle._OracleBinary -sqlalchemy.dialects.oracle.cx_oracle._OracleBinaryFloat -sqlalchemy.dialects.oracle.cx_oracle._OracleChar -sqlalchemy.dialects.oracle.cx_oracle._OracleDate -sqlalchemy.dialects.oracle.cx_oracle._OracleEnum -sqlalchemy.dialects.oracle.cx_oracle._OracleInteger -sqlalchemy.dialects.oracle.cx_oracle._OracleInterval -sqlalchemy.dialects.oracle.cx_oracle._OracleLong -sqlalchemy.dialects.oracle.cx_oracle._OracleNChar -sqlalchemy.dialects.oracle.cx_oracle._OracleNUMBER -sqlalchemy.dialects.oracle.cx_oracle._OracleNumeric -sqlalchemy.dialects.oracle.cx_oracle._OracleRaw -sqlalchemy.dialects.oracle.cx_oracle._OracleRowid -sqlalchemy.dialects.oracle.cx_oracle._OracleString -sqlalchemy.dialects.oracle.cx_oracle._OracleText -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeStringCHAR -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeStringNCHAR -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeTextCLOB -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeTextNCLOB -sqlalchemy.dialects.postgresql.ARRAY -sqlalchemy.dialects.postgresql.BIGINT -sqlalchemy.dialects.postgresql.BIT -sqlalchemy.dialects.postgresql.BOOLEAN -sqlalchemy.dialects.postgresql.BYTEA -sqlalchemy.dialects.postgresql.CHAR -sqlalchemy.dialects.postgresql.CIDR -sqlalchemy.dialects.postgresql.CreateEnumType -sqlalchemy.dialects.postgresql.DATE -sqlalchemy.dialects.postgresql.DATERANGE -sqlalchemy.dialects.postgresql.DOUBLE_PRECISION -sqlalchemy.dialects.postgresql.DropEnumType -sqlalchemy.dialects.postgresql.ENUM -sqlalchemy.dialects.postgresql.ExcludeConstraint -sqlalchemy.dialects.postgresql.FLOAT -sqlalchemy.dialects.postgresql.HSTORE -sqlalchemy.dialects.postgresql.INET -sqlalchemy.dialects.postgresql.INT4RANGE -sqlalchemy.dialects.postgresql.INT8RANGE -sqlalchemy.dialects.postgresql.INTEGER -sqlalchemy.dialects.postgresql.INTERVAL -sqlalchemy.dialects.postgresql.Insert -sqlalchemy.dialects.postgresql.JSON -sqlalchemy.dialects.postgresql.JSONB -sqlalchemy.dialects.postgresql.MACADDR -sqlalchemy.dialects.postgresql.MACADDR8 -sqlalchemy.dialects.postgresql.MONEY -sqlalchemy.dialects.postgresql.NUMERIC -sqlalchemy.dialects.postgresql.NUMRANGE -sqlalchemy.dialects.postgresql.OID -sqlalchemy.dialects.postgresql.REAL -sqlalchemy.dialects.postgresql.REGCLASS -sqlalchemy.dialects.postgresql.SMALLINT -sqlalchemy.dialects.postgresql.TEXT -sqlalchemy.dialects.postgresql.TIME -sqlalchemy.dialects.postgresql.TIMESTAMP -sqlalchemy.dialects.postgresql.TSRANGE -sqlalchemy.dialects.postgresql.TSTZRANGE -sqlalchemy.dialects.postgresql.TSVECTOR -sqlalchemy.dialects.postgresql.UUID -sqlalchemy.dialects.postgresql.VARCHAR -sqlalchemy.dialects.postgresql.aggregate_order_by -sqlalchemy.dialects.postgresql.array -sqlalchemy.dialects.postgresql.array.ARRAY -sqlalchemy.dialects.postgresql.array.array -sqlalchemy.dialects.postgresql.asyncpg.AsyncPgEnum -sqlalchemy.dialects.postgresql.asyncpg.AsyncPgInterval -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgBigInteger -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgBoolean -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgDate -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgDateTime -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgFloat -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgInteger -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSON -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONB -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONIntIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONPathType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONStrIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgNumeric -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgOID -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgREGCLASS -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgTime -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgUUID -sqlalchemy.dialects.postgresql.base.BIGINT -sqlalchemy.dialects.postgresql.base.BIT -sqlalchemy.dialects.postgresql.base.BOOLEAN -sqlalchemy.dialects.postgresql.base.BYTEA -sqlalchemy.dialects.postgresql.base.CHAR -sqlalchemy.dialects.postgresql.base.CIDR -sqlalchemy.dialects.postgresql.base.CreateEnumType -sqlalchemy.dialects.postgresql.base.DATE -sqlalchemy.dialects.postgresql.base.DOUBLE_PRECISION -sqlalchemy.dialects.postgresql.base.DropEnumType -sqlalchemy.dialects.postgresql.base.ENUM -sqlalchemy.dialects.postgresql.base.FLOAT -sqlalchemy.dialects.postgresql.base.INET -sqlalchemy.dialects.postgresql.base.INTEGER -sqlalchemy.dialects.postgresql.base.INTERVAL -sqlalchemy.dialects.postgresql.base.MACADDR -sqlalchemy.dialects.postgresql.base.MACADDR8 -sqlalchemy.dialects.postgresql.base.MONEY -sqlalchemy.dialects.postgresql.base.NUMERIC -sqlalchemy.dialects.postgresql.base.OID -sqlalchemy.dialects.postgresql.base.PGTypeCompiler -sqlalchemy.dialects.postgresql.base.REAL -sqlalchemy.dialects.postgresql.base.REGCLASS -sqlalchemy.dialects.postgresql.base.SMALLINT -sqlalchemy.dialects.postgresql.base.TEXT -sqlalchemy.dialects.postgresql.base.TIME -sqlalchemy.dialects.postgresql.base.TIMESTAMP -sqlalchemy.dialects.postgresql.base.TSVECTOR -sqlalchemy.dialects.postgresql.base.UUID -sqlalchemy.dialects.postgresql.base.VARCHAR -sqlalchemy.dialects.postgresql.base._ColonCast -sqlalchemy.dialects.postgresql.dml.Insert -sqlalchemy.dialects.postgresql.dml.OnConflictClause -sqlalchemy.dialects.postgresql.dml.OnConflictDoNothing -sqlalchemy.dialects.postgresql.dml.OnConflictDoUpdate -sqlalchemy.dialects.postgresql.ext.ExcludeConstraint -sqlalchemy.dialects.postgresql.ext.aggregate_order_by -sqlalchemy.dialects.postgresql.hstore -sqlalchemy.dialects.postgresql.hstore.HSTORE -sqlalchemy.dialects.postgresql.hstore._HStoreArrayFunction -sqlalchemy.dialects.postgresql.hstore._HStoreDefinedFunction -sqlalchemy.dialects.postgresql.hstore._HStoreDeleteFunction -sqlalchemy.dialects.postgresql.hstore._HStoreKeysFunction -sqlalchemy.dialects.postgresql.hstore._HStoreMatrixFunction -sqlalchemy.dialects.postgresql.hstore._HStoreSliceFunction -sqlalchemy.dialects.postgresql.hstore._HStoreValsFunction -sqlalchemy.dialects.postgresql.hstore.hstore -sqlalchemy.dialects.postgresql.json.JSON -sqlalchemy.dialects.postgresql.json.JSONB -sqlalchemy.dialects.postgresql.json.JSONPathType -sqlalchemy.dialects.postgresql.pg8000._PGARRAY -sqlalchemy.dialects.postgresql.pg8000._PGBigInteger -sqlalchemy.dialects.postgresql.pg8000._PGBoolean -sqlalchemy.dialects.postgresql.pg8000._PGEnum -sqlalchemy.dialects.postgresql.pg8000._PGInteger -sqlalchemy.dialects.postgresql.pg8000._PGInterval -sqlalchemy.dialects.postgresql.pg8000._PGJSON -sqlalchemy.dialects.postgresql.pg8000._PGJSONB -sqlalchemy.dialects.postgresql.pg8000._PGJSONIndexType -sqlalchemy.dialects.postgresql.pg8000._PGJSONIntIndexType -sqlalchemy.dialects.postgresql.pg8000._PGJSONPathType -sqlalchemy.dialects.postgresql.pg8000._PGJSONStrIndexType -sqlalchemy.dialects.postgresql.pg8000._PGNullType -sqlalchemy.dialects.postgresql.pg8000._PGNumeric -sqlalchemy.dialects.postgresql.pg8000._PGNumericNoBind -sqlalchemy.dialects.postgresql.pg8000._PGSmallInteger -sqlalchemy.dialects.postgresql.pg8000._PGTime -sqlalchemy.dialects.postgresql.pg8000._PGTimeStamp -sqlalchemy.dialects.postgresql.pg8000._PGUUID -sqlalchemy.dialects.postgresql.psycopg2._PGARRAY -sqlalchemy.dialects.postgresql.psycopg2._PGEnum -sqlalchemy.dialects.postgresql.psycopg2._PGHStore -sqlalchemy.dialects.postgresql.psycopg2._PGJSON -sqlalchemy.dialects.postgresql.psycopg2._PGJSONB -sqlalchemy.dialects.postgresql.psycopg2._PGNumeric -sqlalchemy.dialects.postgresql.psycopg2._PGUUID -sqlalchemy.dialects.postgresql.pygresql._PGHStore -sqlalchemy.dialects.postgresql.pygresql._PGJSON -sqlalchemy.dialects.postgresql.pygresql._PGJSONB -sqlalchemy.dialects.postgresql.pygresql._PGNumeric -sqlalchemy.dialects.postgresql.pygresql._PGUUID -sqlalchemy.dialects.postgresql.pypostgresql.PGNumeric -sqlalchemy.dialects.postgresql.ranges.DATERANGE -sqlalchemy.dialects.postgresql.ranges.INT4RANGE -sqlalchemy.dialects.postgresql.ranges.INT8RANGE -sqlalchemy.dialects.postgresql.ranges.NUMRANGE -sqlalchemy.dialects.postgresql.ranges.TSRANGE -sqlalchemy.dialects.postgresql.ranges.TSTZRANGE -sqlalchemy.dialects.sqlite.BLOB -sqlalchemy.dialects.sqlite.BOOLEAN -sqlalchemy.dialects.sqlite.CHAR -sqlalchemy.dialects.sqlite.DATE -sqlalchemy.dialects.sqlite.DATETIME -sqlalchemy.dialects.sqlite.DECIMAL -sqlalchemy.dialects.sqlite.FLOAT -sqlalchemy.dialects.sqlite.INTEGER -sqlalchemy.dialects.sqlite.Insert -sqlalchemy.dialects.sqlite.JSON -sqlalchemy.dialects.sqlite.NUMERIC -sqlalchemy.dialects.sqlite.REAL -sqlalchemy.dialects.sqlite.SMALLINT -sqlalchemy.dialects.sqlite.TEXT -sqlalchemy.dialects.sqlite.TIME -sqlalchemy.dialects.sqlite.TIMESTAMP -sqlalchemy.dialects.sqlite.VARCHAR -sqlalchemy.dialects.sqlite.base.BLOB -sqlalchemy.dialects.sqlite.base.BOOLEAN -sqlalchemy.dialects.sqlite.base.CHAR -sqlalchemy.dialects.sqlite.base.DATE -sqlalchemy.dialects.sqlite.base.DATETIME -sqlalchemy.dialects.sqlite.base.DECIMAL -sqlalchemy.dialects.sqlite.base.FLOAT -sqlalchemy.dialects.sqlite.base.INTEGER -sqlalchemy.dialects.sqlite.base.JSON -sqlalchemy.dialects.sqlite.base.NUMERIC -sqlalchemy.dialects.sqlite.base.REAL -sqlalchemy.dialects.sqlite.base.SMALLINT -sqlalchemy.dialects.sqlite.base.SQLiteTypeCompiler -sqlalchemy.dialects.sqlite.base.TEXT -sqlalchemy.dialects.sqlite.base.TIME -sqlalchemy.dialects.sqlite.base.TIMESTAMP -sqlalchemy.dialects.sqlite.base.VARCHAR -sqlalchemy.dialects.sqlite.base._SQliteJson -sqlalchemy.dialects.sqlite.dml.Insert -sqlalchemy.dialects.sqlite.dml.OnConflictClause -sqlalchemy.dialects.sqlite.dml.OnConflictDoNothing -sqlalchemy.dialects.sqlite.dml.OnConflictDoUpdate -sqlalchemy.dialects.sqlite.json.JSON -sqlalchemy.dialects.sqlite.json.JSONIndexType -sqlalchemy.dialects.sqlite.json.JSONPathType -sqlalchemy.dialects.sqlite.pysqlite._SQLite_pysqliteDate -sqlalchemy.dialects.sqlite.pysqlite._SQLite_pysqliteTimeStamp -sqlalchemy.dialects.sybase.BIGINT -sqlalchemy.dialects.sybase.BINARY -sqlalchemy.dialects.sybase.BIT -sqlalchemy.dialects.sybase.CHAR -sqlalchemy.dialects.sybase.DATE -sqlalchemy.dialects.sybase.DATETIME -sqlalchemy.dialects.sybase.FLOAT -sqlalchemy.dialects.sybase.IMAGE -sqlalchemy.dialects.sybase.INTEGER -sqlalchemy.dialects.sybase.MONEY -sqlalchemy.dialects.sybase.NCHAR -sqlalchemy.dialects.sybase.NUMERIC -sqlalchemy.dialects.sybase.NVARCHAR -sqlalchemy.dialects.sybase.SMALLINT -sqlalchemy.dialects.sybase.SMALLMONEY -sqlalchemy.dialects.sybase.TEXT -sqlalchemy.dialects.sybase.TIME -sqlalchemy.dialects.sybase.TINYINT -sqlalchemy.dialects.sybase.UNICHAR -sqlalchemy.dialects.sybase.UNITEXT -sqlalchemy.dialects.sybase.UNIVARCHAR -sqlalchemy.dialects.sybase.VARBINARY -sqlalchemy.dialects.sybase.VARCHAR -sqlalchemy.dialects.sybase.base.BIGINT -sqlalchemy.dialects.sybase.base.BINARY -sqlalchemy.dialects.sybase.base.BIT -sqlalchemy.dialects.sybase.base.CHAR -sqlalchemy.dialects.sybase.base.DATE -sqlalchemy.dialects.sybase.base.DATETIME -sqlalchemy.dialects.sybase.base.DECIMAL -sqlalchemy.dialects.sybase.base.FLOAT -sqlalchemy.dialects.sybase.base.IMAGE -sqlalchemy.dialects.sybase.base.INTEGER -sqlalchemy.dialects.sybase.base.MONEY -sqlalchemy.dialects.sybase.base.NCHAR -sqlalchemy.dialects.sybase.base.NUMERIC -sqlalchemy.dialects.sybase.base.NVARCHAR -sqlalchemy.dialects.sybase.base.REAL -sqlalchemy.dialects.sybase.base.SMALLINT -sqlalchemy.dialects.sybase.base.SMALLMONEY -sqlalchemy.dialects.sybase.base.SybaseTypeCompiler -sqlalchemy.dialects.sybase.base.TEXT -sqlalchemy.dialects.sybase.base.TIME -sqlalchemy.dialects.sybase.base.TIMESTAMP -sqlalchemy.dialects.sybase.base.TINYINT -sqlalchemy.dialects.sybase.base.UNICHAR -sqlalchemy.dialects.sybase.base.UNIQUEIDENTIFIER -sqlalchemy.dialects.sybase.base.UNITEXT -sqlalchemy.dialects.sybase.base.UNIVARCHAR -sqlalchemy.dialects.sybase.base.Unicode -sqlalchemy.dialects.sybase.base.VARBINARY -sqlalchemy.dialects.sybase.base.VARCHAR -sqlalchemy.dialects.sybase.pyodbc._SybNumeric_pyodbc -sqlalchemy.dialects.sybase.pysybase._SybNumeric -sqlalchemy.engine.TypeCompiler -sqlalchemy.engine.default._StrDate -sqlalchemy.engine.default._StrDateTime -sqlalchemy.engine.default._StrTime -sqlalchemy.engine.events.ConnectionEvents -sqlalchemy.engine.events.DialectEvents -sqlalchemy.engine.interfaces.TypeCompiler -sqlalchemy.event.Events -sqlalchemy.event.base.Events -sqlalchemy.events.ConnectionEvents -sqlalchemy.events.DDLEvents -sqlalchemy.events.DialectEvents -sqlalchemy.events.PoolEvents -sqlalchemy.ext.asyncio.AsyncConnectionEvents -sqlalchemy.ext.asyncio.AsyncSessionEvents -sqlalchemy.ext.asyncio.events.AsyncConnectionEvents -sqlalchemy.ext.asyncio.events.AsyncSessionEvents -sqlalchemy.orm.AttributeEvents -sqlalchemy.orm.FromStatement -sqlalchemy.orm.InstanceEvents -sqlalchemy.orm.InstrumentationEvents -sqlalchemy.orm.MapperEvents -sqlalchemy.orm.QueryContext.default_load_options -sqlalchemy.orm.QueryEvents -sqlalchemy.orm.SessionEvents -sqlalchemy.orm.context.ORMCompileState.default_compile_options -sqlalchemy.orm.context.QueryContext.default_load_options -sqlalchemy.orm.events.AttributeEvents -sqlalchemy.orm.events.InstanceEvents -sqlalchemy.orm.events.InstrumentationEvents -sqlalchemy.orm.events.MapperEvents -sqlalchemy.orm.events.QueryEvents -sqlalchemy.orm.events.SessionEvents -sqlalchemy.orm.events._InstanceEventsHold.HoldInstanceEvents -sqlalchemy.orm.events._MapperEventsHold.HoldMapperEvents -sqlalchemy.orm.persistence.BulkUDCompileState.default_update_options -sqlalchemy.orm.query.FromStatement -sqlalchemy.orm.query.QueryContext.default_load_options -sqlalchemy.orm.util._ORMJoin -sqlalchemy.pool.events.PoolEvents -sqlalchemy.schema.AddConstraint -sqlalchemy.schema.CheckConstraint -sqlalchemy.schema.Column -sqlalchemy.schema.ColumnCollectionConstraint -sqlalchemy.schema.ColumnDefault -sqlalchemy.schema.Computed -sqlalchemy.schema.Constraint -sqlalchemy.schema.CreateColumn -sqlalchemy.schema.CreateIndex -sqlalchemy.schema.CreateSchema -sqlalchemy.schema.CreateSequence -sqlalchemy.schema.CreateTable -sqlalchemy.schema.DDL -sqlalchemy.schema.DDLElement -sqlalchemy.schema.DefaultGenerator -sqlalchemy.schema.DropColumnComment -sqlalchemy.schema.DropConstraint -sqlalchemy.schema.DropIndex -sqlalchemy.schema.DropSchema -sqlalchemy.schema.DropSequence -sqlalchemy.schema.DropTable -sqlalchemy.schema.DropTableComment -sqlalchemy.schema.ForeignKey -sqlalchemy.schema.ForeignKeyConstraint -sqlalchemy.schema.Identity -sqlalchemy.schema.Index -sqlalchemy.schema.MetaData -sqlalchemy.schema.PrimaryKeyConstraint -sqlalchemy.schema.SchemaItem -sqlalchemy.schema.Sequence -sqlalchemy.schema.SetColumnComment -sqlalchemy.schema.SetTableComment -sqlalchemy.schema.Table -sqlalchemy.schema.ThreadLocalMetaData -sqlalchemy.schema.UniqueConstraint -sqlalchemy.schema._CreateDropBase -sqlalchemy.schema._DDLCompiles -sqlalchemy.schema._DropView -sqlalchemy.sql.Alias -sqlalchemy.sql.ClauseElement -sqlalchemy.sql.ColumnElement -sqlalchemy.sql.CompoundSelect -sqlalchemy.sql.Delete -sqlalchemy.sql.False_ -sqlalchemy.sql.FromClause -sqlalchemy.sql.Insert -sqlalchemy.sql.Join -sqlalchemy.sql.LambdaElement -sqlalchemy.sql.Select -sqlalchemy.sql.Selectable -sqlalchemy.sql.StatementLambdaElement -sqlalchemy.sql.Subquery -sqlalchemy.sql.TableClause -sqlalchemy.sql.TableSample -sqlalchemy.sql.True_ -sqlalchemy.sql.Update -sqlalchemy.sql.Values -sqlalchemy.sql.base.CacheableOptions -sqlalchemy.sql.base.Options -sqlalchemy.sql.compiler.GenericTypeCompiler -sqlalchemy.sql.compiler.StrSQLTypeCompiler -sqlalchemy.sql.compiler.TypeCompiler -sqlalchemy.sql.compiler._CompileLabel -sqlalchemy.sql.crud._multiparam_column -sqlalchemy.sql.ddl.AddConstraint -sqlalchemy.sql.ddl.CreateColumn -sqlalchemy.sql.ddl.CreateIndex -sqlalchemy.sql.ddl.CreateSchema -sqlalchemy.sql.ddl.CreateSequence -sqlalchemy.sql.ddl.CreateTable -sqlalchemy.sql.ddl.DDL -sqlalchemy.sql.ddl.DDLElement -sqlalchemy.sql.ddl.DropColumnComment -sqlalchemy.sql.ddl.DropConstraint -sqlalchemy.sql.ddl.DropIndex -sqlalchemy.sql.ddl.DropSchema -sqlalchemy.sql.ddl.DropSequence -sqlalchemy.sql.ddl.DropTable -sqlalchemy.sql.ddl.DropTableComment -sqlalchemy.sql.ddl.SetColumnComment -sqlalchemy.sql.ddl.SetTableComment -sqlalchemy.sql.ddl._CreateDropBase -sqlalchemy.sql.ddl._DDLCompiles -sqlalchemy.sql.ddl._DropView -sqlalchemy.sql.dml.Delete -sqlalchemy.sql.dml.Insert -sqlalchemy.sql.dml.Update -sqlalchemy.sql.dml.UpdateBase -sqlalchemy.sql.dml.ValuesBase -sqlalchemy.sql.elements.AsBoolean -sqlalchemy.sql.elements.BinaryExpression -sqlalchemy.sql.elements.BindParameter -sqlalchemy.sql.elements.BooleanClauseList -sqlalchemy.sql.elements.Case -sqlalchemy.sql.elements.Cast -sqlalchemy.sql.elements.ClauseElement -sqlalchemy.sql.elements.ClauseList -sqlalchemy.sql.elements.CollationClause -sqlalchemy.sql.elements.CollectionAggregate -sqlalchemy.sql.elements.ColumnClause -sqlalchemy.sql.elements.ColumnElement -sqlalchemy.sql.elements.Extract -sqlalchemy.sql.elements.False_ -sqlalchemy.sql.elements.FunctionFilter -sqlalchemy.sql.elements.GroupedElement -sqlalchemy.sql.elements.Grouping -sqlalchemy.sql.elements.IndexExpression -sqlalchemy.sql.elements.Label -sqlalchemy.sql.elements.NamedColumn -sqlalchemy.sql.elements.Null -sqlalchemy.sql.elements.Over -sqlalchemy.sql.elements.ReleaseSavepointClause -sqlalchemy.sql.elements.RollbackToSavepointClause -sqlalchemy.sql.elements.SavepointClause -sqlalchemy.sql.elements.Slice -sqlalchemy.sql.elements.TableValuedColumn -sqlalchemy.sql.elements.TextClause -sqlalchemy.sql.elements.True_ -sqlalchemy.sql.elements.Tuple -sqlalchemy.sql.elements.TypeClause -sqlalchemy.sql.elements.TypeCoerce -sqlalchemy.sql.elements.UnaryExpression -sqlalchemy.sql.elements.WithinGroup -sqlalchemy.sql.elements._IdentifiedClause -sqlalchemy.sql.elements._label_reference -sqlalchemy.sql.elements._textual_label_reference -sqlalchemy.sql.events.DDLEvents -sqlalchemy.sql.expression.Alias -sqlalchemy.sql.expression.AliasedReturnsRows -sqlalchemy.sql.expression.BinaryExpression -sqlalchemy.sql.expression.BindParameter -sqlalchemy.sql.expression.BooleanClauseList -sqlalchemy.sql.expression.CTE -sqlalchemy.sql.expression.Case -sqlalchemy.sql.expression.Cast -sqlalchemy.sql.expression.ClauseElement -sqlalchemy.sql.expression.ClauseList -sqlalchemy.sql.expression.CollectionAggregate -sqlalchemy.sql.expression.ColumnClause -sqlalchemy.sql.expression.ColumnElement -sqlalchemy.sql.expression.CompoundSelect -sqlalchemy.sql.expression.Delete -sqlalchemy.sql.expression.Exists -sqlalchemy.sql.expression.Extract -sqlalchemy.sql.expression.False_ -sqlalchemy.sql.expression.FromClause -sqlalchemy.sql.expression.FromGrouping -sqlalchemy.sql.expression.Function -sqlalchemy.sql.expression.FunctionElement -sqlalchemy.sql.expression.FunctionFilter -sqlalchemy.sql.expression.GenerativeSelect -sqlalchemy.sql.expression.Grouping -sqlalchemy.sql.expression.Insert -sqlalchemy.sql.expression.Join -sqlalchemy.sql.expression.Label -sqlalchemy.sql.expression.LambdaElement -sqlalchemy.sql.expression.Lateral -sqlalchemy.sql.expression.Null -sqlalchemy.sql.expression.Over -sqlalchemy.sql.expression.ReleaseSavepointClause -sqlalchemy.sql.expression.ReturnsRows -sqlalchemy.sql.expression.RollbackToSavepointClause -sqlalchemy.sql.expression.SavepointClause -sqlalchemy.sql.expression.ScalarSelect -sqlalchemy.sql.expression.Select -sqlalchemy.sql.expression.SelectBase -sqlalchemy.sql.expression.Selectable -sqlalchemy.sql.expression.StatementLambdaElement -sqlalchemy.sql.expression.Subquery -sqlalchemy.sql.expression.TableClause -sqlalchemy.sql.expression.TableSample -sqlalchemy.sql.expression.TableValuedAlias -sqlalchemy.sql.expression.TextClause -sqlalchemy.sql.expression.TextualSelect -sqlalchemy.sql.expression.True_ -sqlalchemy.sql.expression.Tuple -sqlalchemy.sql.expression.TypeClause -sqlalchemy.sql.expression.TypeCoerce -sqlalchemy.sql.expression.UnaryExpression -sqlalchemy.sql.expression.Update -sqlalchemy.sql.expression.UpdateBase -sqlalchemy.sql.expression.Values -sqlalchemy.sql.expression.ValuesBase -sqlalchemy.sql.expression.WithinGroup -sqlalchemy.sql.functions.AnsiFunction -sqlalchemy.sql.functions.Function -sqlalchemy.sql.functions.FunctionAsBinary -sqlalchemy.sql.functions.FunctionElement -sqlalchemy.sql.functions.GenericFunction -sqlalchemy.sql.functions.OrderedSetAgg -sqlalchemy.sql.functions.ReturnTypeFromArgs -sqlalchemy.sql.functions.ScalarFunctionColumn -sqlalchemy.sql.functions.array_agg -sqlalchemy.sql.functions.char_length -sqlalchemy.sql.functions.coalesce -sqlalchemy.sql.functions.concat -sqlalchemy.sql.functions.count -sqlalchemy.sql.functions.cube -sqlalchemy.sql.functions.cume_dist -sqlalchemy.sql.functions.current_date -sqlalchemy.sql.functions.current_time -sqlalchemy.sql.functions.current_timestamp -sqlalchemy.sql.functions.current_user -sqlalchemy.sql.functions.dense_rank -sqlalchemy.sql.functions.grouping_sets -sqlalchemy.sql.functions.localtime -sqlalchemy.sql.functions.localtimestamp -sqlalchemy.sql.functions.max -sqlalchemy.sql.functions.min -sqlalchemy.sql.functions.mode -sqlalchemy.sql.functions.next_value -sqlalchemy.sql.functions.now -sqlalchemy.sql.functions.percent_rank -sqlalchemy.sql.functions.percentile_cont -sqlalchemy.sql.functions.percentile_disc -sqlalchemy.sql.functions.random -sqlalchemy.sql.functions.rank -sqlalchemy.sql.functions.rollup -sqlalchemy.sql.functions.session_user -sqlalchemy.sql.functions.sum -sqlalchemy.sql.functions.sysdate -sqlalchemy.sql.functions.user -sqlalchemy.sql.lambdas.DeferredLambdaElement -sqlalchemy.sql.lambdas.LambdaElement -sqlalchemy.sql.lambdas.LambdaOptions -sqlalchemy.sql.lambdas.LinkedLambdaElement -sqlalchemy.sql.lambdas.NullLambdaStatement -sqlalchemy.sql.lambdas.StatementLambdaElement -sqlalchemy.sql.schema.CheckConstraint -sqlalchemy.sql.schema.Column -sqlalchemy.sql.schema.ColumnCollectionConstraint -sqlalchemy.sql.schema.ColumnDefault -sqlalchemy.sql.schema.Computed -sqlalchemy.sql.schema.Constraint -sqlalchemy.sql.schema.DefaultGenerator -sqlalchemy.sql.schema.ForeignKey -sqlalchemy.sql.schema.ForeignKeyConstraint -sqlalchemy.sql.schema.Identity -sqlalchemy.sql.schema.Index -sqlalchemy.sql.schema.MetaData -sqlalchemy.sql.schema.PrimaryKeyConstraint -sqlalchemy.sql.schema.SchemaItem -sqlalchemy.sql.schema.Sequence -sqlalchemy.sql.schema.Table -sqlalchemy.sql.schema.ThreadLocalMetaData -sqlalchemy.sql.schema.UniqueConstraint -sqlalchemy.sql.selectable.Alias -sqlalchemy.sql.selectable.AliasedReturnsRows -sqlalchemy.sql.selectable.BindParameter -sqlalchemy.sql.selectable.BooleanClauseList -sqlalchemy.sql.selectable.CTE -sqlalchemy.sql.selectable.ClauseElement -sqlalchemy.sql.selectable.ClauseList -sqlalchemy.sql.selectable.ColumnClause -sqlalchemy.sql.selectable.CompoundSelect -sqlalchemy.sql.selectable.Exists -sqlalchemy.sql.selectable.ForUpdateArg -sqlalchemy.sql.selectable.FromClause -sqlalchemy.sql.selectable.FromGrouping -sqlalchemy.sql.selectable.GenerativeSelect -sqlalchemy.sql.selectable.GroupedElement -sqlalchemy.sql.selectable.Grouping -sqlalchemy.sql.selectable.Join -sqlalchemy.sql.selectable.Lateral -sqlalchemy.sql.selectable.ReturnsRows -sqlalchemy.sql.selectable.ScalarSelect -sqlalchemy.sql.selectable.Select -sqlalchemy.sql.selectable.SelectBase -sqlalchemy.sql.selectable.SelectState.default_select_compile_options -sqlalchemy.sql.selectable.SelectStatementGrouping -sqlalchemy.sql.selectable.Selectable -sqlalchemy.sql.selectable.Subquery -sqlalchemy.sql.selectable.TableClause -sqlalchemy.sql.selectable.TableSample -sqlalchemy.sql.selectable.TableValuedAlias -sqlalchemy.sql.selectable.TableValuedColumn -sqlalchemy.sql.selectable.TextualSelect -sqlalchemy.sql.selectable.UnaryExpression -sqlalchemy.sql.selectable.Values -sqlalchemy.sql.selectable._MemoizedSelectEntities -sqlalchemy.sql.selectable._OffsetLimitParam -sqlalchemy.sql.sqltypes.ARRAY -sqlalchemy.sql.sqltypes.BIGINT -sqlalchemy.sql.sqltypes.BINARY -sqlalchemy.sql.sqltypes.BLOB -sqlalchemy.sql.sqltypes.BOOLEAN -sqlalchemy.sql.sqltypes.BigInteger -sqlalchemy.sql.sqltypes.Boolean -sqlalchemy.sql.sqltypes.CHAR -sqlalchemy.sql.sqltypes.CLOB -sqlalchemy.sql.sqltypes.DATE -sqlalchemy.sql.sqltypes.DATETIME -sqlalchemy.sql.sqltypes.DECIMAL -sqlalchemy.sql.sqltypes.Date -sqlalchemy.sql.sqltypes.DateTime -sqlalchemy.sql.sqltypes.Enum -sqlalchemy.sql.sqltypes.FLOAT -sqlalchemy.sql.sqltypes.Float -sqlalchemy.sql.sqltypes.INTEGER -sqlalchemy.sql.sqltypes.Integer -sqlalchemy.sql.sqltypes.Interval -sqlalchemy.sql.sqltypes.JSON -sqlalchemy.sql.sqltypes.JSON.JSONElementType -sqlalchemy.sql.sqltypes.JSON.JSONIndexType -sqlalchemy.sql.sqltypes.JSON.JSONIntIndexType -sqlalchemy.sql.sqltypes.JSON.JSONPathType -sqlalchemy.sql.sqltypes.JSON.JSONStrIndexType -sqlalchemy.sql.sqltypes.LargeBinary -sqlalchemy.sql.sqltypes.MatchType -sqlalchemy.sql.sqltypes.NCHAR -sqlalchemy.sql.sqltypes.NUMERIC -sqlalchemy.sql.sqltypes.NVARCHAR -sqlalchemy.sql.sqltypes.NullType -sqlalchemy.sql.sqltypes.Numeric -sqlalchemy.sql.sqltypes.PickleType -sqlalchemy.sql.sqltypes.REAL -sqlalchemy.sql.sqltypes.SMALLINT -sqlalchemy.sql.sqltypes.SmallInteger -sqlalchemy.sql.sqltypes.String -sqlalchemy.sql.sqltypes.TEXT -sqlalchemy.sql.sqltypes.TIME -sqlalchemy.sql.sqltypes.TIMESTAMP -sqlalchemy.sql.sqltypes.TableValueType -sqlalchemy.sql.sqltypes.Text -sqlalchemy.sql.sqltypes.Time -sqlalchemy.sql.sqltypes.TupleType -sqlalchemy.sql.sqltypes.TypeDecorator -sqlalchemy.sql.sqltypes.TypeEngine -sqlalchemy.sql.sqltypes.Unicode -sqlalchemy.sql.sqltypes.UnicodeText -sqlalchemy.sql.sqltypes.VARBINARY -sqlalchemy.sql.sqltypes.VARCHAR -sqlalchemy.sql.sqltypes.Variant -sqlalchemy.sql.sqltypes._AbstractInterval -sqlalchemy.sql.sqltypes._Binary -sqlalchemy.sql.traversals.ColIdentityComparatorStrategy -sqlalchemy.sql.traversals.TraversalComparatorStrategy -sqlalchemy.sql.traversals._CacheKey -sqlalchemy.sql.traversals._CopyInternals -sqlalchemy.sql.traversals._GetChildren -sqlalchemy.sql.type_api.TypeDecorator -sqlalchemy.sql.type_api.TypeEngine -sqlalchemy.sql.type_api.UserDefinedType -sqlalchemy.sql.type_api.Variant -sqlalchemy.sql.visitors.ExtendedInternalTraversal -sqlalchemy.sql.visitors.InternalTraversal -sqlalchemy.sql.visitors.Traversible -sqlalchemy.types.ARRAY -sqlalchemy.types.BIGINT -sqlalchemy.types.BINARY -sqlalchemy.types.BLOB -sqlalchemy.types.BOOLEAN -sqlalchemy.types.BigInteger -sqlalchemy.types.Boolean -sqlalchemy.types.CHAR -sqlalchemy.types.CLOB -sqlalchemy.types.DATE -sqlalchemy.types.DATETIME -sqlalchemy.types.DECIMAL -sqlalchemy.types.Date -sqlalchemy.types.DateTime -sqlalchemy.types.Enum -sqlalchemy.types.FLOAT -sqlalchemy.types.Float -sqlalchemy.types.INTEGER -sqlalchemy.types.Integer -sqlalchemy.types.Interval -sqlalchemy.types.JSON -sqlalchemy.types.JSON.JSONElementType -sqlalchemy.types.JSON.JSONIndexType -sqlalchemy.types.JSON.JSONIntIndexType -sqlalchemy.types.JSON.JSONPathType -sqlalchemy.types.JSON.JSONStrIndexType -sqlalchemy.types.LargeBinary -sqlalchemy.types.MatchType -sqlalchemy.types.NCHAR -sqlalchemy.types.NUMERIC -sqlalchemy.types.NVARCHAR -sqlalchemy.types.NullType -sqlalchemy.types.Numeric -sqlalchemy.types.PickleType -sqlalchemy.types.REAL -sqlalchemy.types.SMALLINT -sqlalchemy.types.SmallInteger -sqlalchemy.types.String -sqlalchemy.types.TEXT -sqlalchemy.types.TIME -sqlalchemy.types.TIMESTAMP -sqlalchemy.types.Text -sqlalchemy.types.Time -sqlalchemy.types.TupleType -sqlalchemy.types.TypeDecorator -sqlalchemy.types.TypeEngine -sqlalchemy.types.Unicode -sqlalchemy.types.UnicodeText -sqlalchemy.types.UserDefinedType -sqlalchemy.types.VARBINARY -sqlalchemy.types.VARCHAR -sqlalchemy.types._Binary diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 47b9703ad3d3..59d9d16fbc12 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -197,7 +197,6 @@ class MSExecutionContext(default.DefaultExecutionContext): @property def rowcount(self): ... def handle_dbapi_exception(self, e) -> None: ... - def get_result_cursor_strategy(self, result): ... def fire_sequence(self, seq, type_): ... def get_insert_default(self, column): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index d72b1ed8d387..683ada3fc5fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -163,6 +163,7 @@ class PGCompiler(compiler.SQLCompiler): class PGDDLCompiler(compiler.DDLCompiler): def get_column_specification(self, column, **kwargs): ... def visit_check_constraint(self, constraint): ... + def visit_foreign_key_constraint(self, constraint) -> str: ... # type: ignore[override] # Different params def visit_drop_table_comment(self, drop): ... def visit_create_enum_type(self, create): ... def visit_drop_enum_type(self, drop): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index 7b6eac7d8ff0..afe46eb46e85 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -116,7 +116,6 @@ class ExecutionContext: def pre_exec(self) -> None: ... def get_out_parameter_values(self, out_param_names) -> None: ... def post_exec(self) -> None: ... - def get_result_cursor_strategy(self, result) -> None: ... def handle_dbapi_exception(self, e) -> None: ... def should_autocommit_text(self, statement) -> None: ... def lastrow_has_defaults(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index 9b1341c166e8..d968c86e5ddd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -12,7 +12,7 @@ class _Dispatch: class _EventMeta(type): def __init__(cls, classname, bases, dict_) -> None: ... -class Events: +class Events(metaclass=_EventMeta): dispatch: Any class _JoinedDispatcher: diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 0160b4919214..fbce15f4bf6a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,5 +1,14 @@ from _typeshed import Incomplete -from typing import Any +from collections.abc import Iterable, Mapping +from typing import Any, TypeVar, overload +from typing_extensions import Literal, SupportsIndex + +from ..orm.attributes import Event +from ..util.langhelpers import _symbol, symbol + +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") class _PlainColumnGetter: cols: Any @@ -81,12 +90,38 @@ class CollectionAdapter: def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... -class InstrumentedList(list[Any]): ... -class InstrumentedSet(set[Any]): ... -class InstrumentedDict(dict[Any, Any]): ... +class InstrumentedList(list[_T]): + def append(self, item, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def clear(self, index: SupportsIndex = -1) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def insert(self, index: SupportsIndex, value: _T) -> None: ... + def pop(self, index: SupportsIndex = -1) -> _T: ... + def remove(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + +class InstrumentedSet(set[_T]): + def add(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def difference_update(self, value: Iterable[_T]) -> None: ... # type: ignore[override] + def discard(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def intersection_update(self, other: Iterable[_T]) -> None: ... # type: ignore[override] + def remove(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def symmetric_difference_update(self, other: Iterable[_T]) -> None: ... + def update(self, value: Iterable[_T]) -> None: ... # type: ignore[override] + +class InstrumentedDict(dict[_KT, _VT]): ... -class MappedCollection(dict[Any, Any]): +class MappedCollection(dict[_KT, _VT]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... - def remove(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... + def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def __delitem__(self, key: _KT, _sa_initiatorEvent: Event | Literal[False] | None = None) -> None: ... + def __setitem__(self, key: _KT, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + @overload + def pop(self, key: _KT) -> _VT: ... + @overload + def pop(self, key: _KT, default: _VT | _T | _symbol | symbol = ...) -> _VT | _T: ... + @overload # type: ignore[override] + def setdefault(self, key: _KT, default: _T) -> _VT | _T: ... + @overload + def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... + def update(self, __other: Mapping[_KT, _VT] = ..., **kw: _VT) -> None: ... # type: ignore[override] diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 5422cfffb5c5..1b14062cce36 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete -from typing import Any +from collections import Callable +from typing import Any, Generic, Protocol, TypeVar from ..sql.base import Generative from .interfaces import LoaderOption @@ -23,44 +24,116 @@ class Load(Generative, LoaderOption): def set_generic_strategy(self, attrs, strategy) -> None: ... def set_class_strategy(self, strategy, opts) -> None: ... # added dynamically at runtime - def contains_eager(self, attr, alias: Incomplete | None = ...): ... - def load_only(self, *attrs): ... - def joinedload(self, attr, innerjoin: Incomplete | None = ...): ... - def subqueryload(self, attr): ... - def selectinload(self, attr): ... - def lazyload(self, attr): ... - def immediateload(self, attr): ... - def noload(self, attr): ... - def raiseload(self, attr, sql_only: bool = ...): ... - def defaultload(self, attr): ... - def defer(self, key, raiseload: bool = ...): ... - def undefer(self, key): ... - def undefer_group(self, name): ... - def with_expression(self, key, expression): ... - def selectin_polymorphic(self, classes): ... + def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... + def load_only(loadopt, *attrs): ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... + def subqueryload(loadopt, attr): ... + def selectinload(loadopt, attr): ... + def lazyload(loadopt, attr): ... + def immediateload(loadopt, attr): ... + def noload(loadopt, attr): ... + def raiseload(loadopt, attr, sql_only: bool = ...): ... + def defaultload(loadopt, attr): ... + def defer(loadopt, key, raiseload: bool = ...): ... + def undefer(loadopt, key): ... + def undefer_group(loadopt, name): ... + def with_expression(loadopt, key, expression): ... + def selectin_polymorphic(loadopt, classes): ... class _UnboundLoad(Load): path: Any local_opts: Any def __init__(self) -> None: ... -class loader_option: - name: Any - fn: Any - def __call__(self, fn): ... - -def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... -def load_only(loadopt, *attrs): ... -def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... -def subqueryload(loadopt, attr): ... -def selectinload(loadopt, attr): ... -def lazyload(loadopt, attr): ... -def immediateload(loadopt, attr): ... -def noload(loadopt, attr): ... -def raiseload(loadopt, attr, sql_only: bool = ...): ... -def defaultload(loadopt, attr): ... -def defer(loadopt, key, raiseload: bool = ...): ... -def undefer(loadopt, key): ... -def undefer_group(loadopt, name): ... -def with_expression(loadopt, key, expression): ... -def selectin_polymorphic(loadopt, classes): ... +### +# The methods below are decorated with the class loader_option +# They dynamically become instances of loader_option, +# wich is callable with their original parameters. +# +# While both mypy and pyright's validation work, Pylance is unable to +# show the parameters and return types. +# +# There is a workaround (define the method for Pylance, then reassign +# an instance of loader_option to it for mypy, and add pyright+Flake8 +# suppressions), but it is too hacky and relies on some unsupported quirks. +# +# Asking Pylance to add support for these generic callables might be preferable. +### + +_F = TypeVar("_F", bound=Callable[..., loader_option[Any]]) + +class loader_option(Generic[_F]): + name: str + _dynamic: _F + fn: _F + __call__: _F # Cheesy "__call__" definition to use the dynamic methods instead + +class _contains_eager(Protocol): + def __call__(self, loadopt, attr, alias: Incomplete | None = ...) -> loader_option[_contains_eager]: ... + +contains_eager: loader_option[_contains_eager] + +class _load_only(Protocol): + def __call__(self, loadopt, *attrs) -> loader_option[_load_only]: ... + +load_only: loader_option[_load_only] + +class _subqueryload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_subqueryload]: ... + +subqueryload: loader_option[_subqueryload] + +class _selectinload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_selectinload]: ... + +selectinload: loader_option[_selectinload] + +class _lazyload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_lazyload]: ... + +lazyload: loader_option[_lazyload] + +class _immediateload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_immediateload]: ... + +immediateload: loader_option[_immediateload] + +class _noload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_noload]: ... + +noload: loader_option[_noload] + +class _raiseload(Protocol): + def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_raiseload]: ... + +raiseload: loader_option[_raiseload] + +class _defaultload(Protocol): + def __call__(self, loadopt, attr) -> loader_option[_defaultload]: ... + +defaultload: loader_option[_defaultload] + +class _defer(Protocol): + def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_defer]: ... + +defer: loader_option[_defer] + +class _undefer(Protocol): + def __call__(self, loadopt, key) -> loader_option[_undefer]: ... + +undefer: loader_option[_undefer] + +class _undefer_group(Protocol): + def __call__(self, loadopt, name) -> loader_option[_undefer_group]: ... + +undefer_group: loader_option[_undefer_group] + +class _with_expression(Protocol): + def __call__(self, loadopt, key, expression) -> loader_option[_with_expression]: ... + +with_expression: loader_option[_with_expression] + +class _selectin_polymorphic(Protocol): + def __call__(self, loadopt, classes) -> loader_option[_selectin_polymorphic]: ... + +selectin_polymorphic: loader_option[_selectin_polymorphic] diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 54b1d90ee954..2f7be1fbf26f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -72,7 +72,7 @@ class _MetaOptions(type): def __init__(cls, classname, bases, dict_) -> None: ... def __add__(self, other): ... -class Options: +class Options(metaclass=_MetaOptions): def __init__(self, **kw) -> None: ... def __add__(self, other): ... def __eq__(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index 44178d7f6de8..bd521727bdfa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete from typing import NamedTuple +from sqlalchemy.util.langhelpers import EnsureKWArgType + from ..util import memoized_property from . import elements @@ -67,7 +69,7 @@ class Compiled: @property def params(self): ... -class TypeCompiler: +class TypeCompiler(metaclass=EnsureKWArgType): ensure_kwarg: str dialect: Incomplete def __init__(self, dialect) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index c1a0d1ec43ae..d5180c37d9bf 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -87,7 +87,7 @@ class Function(FunctionElement): class _GenericMeta(TraversibleType): def __init__(cls, clsname, bases, clsdict) -> None: ... -class GenericFunction: +class GenericFunction(Function, metaclass=_GenericMeta): name: Incomplete identifier: Incomplete coerce_arguments: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index dd3f84929967..af91551597c6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -55,7 +55,7 @@ class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... class ExternalType: cache_ok: Any -class UserDefinedType: +class UserDefinedType(ExternalType, TypeEngine, metaclass=VisitableCheckKWArg): __visit_name__: str ensure_kwarg: str def coerce_compared_value(self, op, value): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi index c3dd44793e24..398dee26ef9a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -3,14 +3,14 @@ from typing import Any class TraversibleType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... -class Traversible: +class Traversible(metaclass=TraversibleType): def __class_getitem__(cls, key): ... def get_children(self, omit_attrs=..., **kw): ... class _InternalTraversalType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... -class InternalTraversal: +class InternalTraversal(metaclass=_InternalTraversalType): def dispatch(self, visit_symbol): ... def run_generated_dispatch(self, target, internal_dispatch, generate_dispatcher_name): ... def generate_dispatch(self, target_cls, internal_dispatch, generate_dispatcher_name): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index a6c48328be1f..0fc5ecb899b9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,33 +1,117 @@ -from typing import Any +from _typeshed import Incomplete, Self +from collections.abc import Callable +from logging import Logger +from typing import Generic, Protocol, TypeVar -log: Any -FOLLOWER_IDENT: Any +from sqlalchemy.engine.url import URL +from sqlalchemy.testing.config import Config -class register: - fns: Any - @classmethod - def init(cls, fn): ... - def for_db(self, *dbnames): ... - def __call__(self, cfg, *arg): ... +log: Logger +FOLLOWER_IDENT: Incomplete | None def create_follower_db(follower_ident) -> None: ... -def setup_config(db_url, options, file_config, follower_ident): ... +def setup_config(db_url, options, file_config, follower_ident) -> Config: ... def drop_follower_db(follower_ident) -> None: ... def generate_db_urls(db_urls, extra_drivers) -> None: ... -def generate_driver_url(url, driver, query_str): ... -def drop_all_schema_objects_pre_tables(cfg, eng) -> None: ... -def drop_all_schema_objects_post_tables(cfg, eng) -> None: ... def drop_all_schema_objects(cfg, eng) -> None: ... -def create_db(cfg, eng, ident) -> None: ... -def drop_db(cfg, eng, ident) -> None: ... -def update_db_opts(cfg, db_opts) -> None: ... -def post_configure_engine(url, engine, follower_ident) -> None: ... -def follower_url_from_main(url, ident): ... -def configure_follower(cfg, ident) -> None: ... -def run_reap_dbs(url, ident) -> None: ... def reap_dbs(idents_file) -> None: ... -def temp_table_keyword_args(cfg, eng) -> None: ... -def prepare_for_drop_tables(config, connection) -> None: ... -def stop_test_class_outside_fixtures(config, db, testcls) -> None: ... -def get_temp_table_name(cfg, eng, base_name): ... -def set_default_schema_on_connection(cfg, dbapi_connection, schema_name) -> None: ... + +### +# The methods below are decorated with the method register.init +# They dynamically become instances of register, +# wich is callable with their original parameters. +# +# While both mypy and pyright's validation work, Pylance is unable to +# show the parameters and return types. +# +# There is a workaround (define the method for Pylance, then reassign +# an instance of register to it for mypy, and add pyright+Flake8 +# suppressions), but it is too hacky and relies on some unsupported quirks. +# +# Asking Pylance to add support for these generic callables might be preferable. +### + +_F = TypeVar("_F", bound=Callable[..., str | URL | None]) +_S = TypeVar("_S", bound=str) + +class register(Generic[_F]): + fns: dict[str, _F] + @classmethod + def init(cls: type[Self], fn: _F) -> Self: ... + def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... + __call__: _F + +class _generate_driver_url(Protocol): + def __call__(self, url: URL, driver, query_str) -> URL | None: ... + +generate_driver_url: register[_generate_driver_url] + +class _drop_all_schema_objects_pre_tables(Protocol): + def __call__(self, cfg, eng) -> None: ... + +drop_all_schema_objects_pre_tables: register[_drop_all_schema_objects_pre_tables] + +class _drop_all_schema_objects_post_tables(Protocol): + def __call__(self, cfg, eng) -> None: ... + +drop_all_schema_objects_post_tables: register[_drop_all_schema_objects_post_tables] + +class _create_db(Protocol): + def __call__(self, cfg, eng, ident) -> None: ... + +create_db: register[_create_db] + +class _drop_db(Protocol): + def __call__(self, cfg, eng, ident) -> None: ... + +drop_db: register[_drop_db] + +class _update_db_opts(Protocol): + def __call__(self, cfg, db_opts) -> None: ... + +update_db_opts: register[_update_db_opts] + +class _post_configure_engine(Protocol): + def __call__(self, url: URL, engine, follower_ident) -> None: ... + +post_configure_engine: register[_post_configure_engine] + +class _follower_url_from_main(Protocol): + def __call__(self, url: URL, ident) -> URL: ... + +follower_url_from_main: register[_follower_url_from_main] + +class _configure_follower(Protocol): + def __call__(self, cfg, ident) -> None: ... + +configure_follower: register[_configure_follower] + +class _run_reap_dbs(Protocol): + def __call__(self, url: URL, ident) -> None: ... + +run_reap_dbs: register[_run_reap_dbs] + +class _temp_table_keyword_args(Protocol): + def __call__(self, cfg, eng) -> None: ... + +temp_table_keyword_args: register[_temp_table_keyword_args] + +class _prepare_for_drop_tables(Protocol): + def __call__(self, config, connection) -> None: ... + +prepare_for_drop_tables: register[_prepare_for_drop_tables] + +class _stop_test_class_outside_fixtures(Protocol): + def __call__(self, config, db, testcls) -> None: ... + +stop_test_class_outside_fixtures: register[_stop_test_class_outside_fixtures] + +class _get_temp_table_name(Protocol): + def __call__(self, cfg, eng, base_name: _S) -> _S: ... + +get_temp_table_name: register[_get_temp_table_name] # type: ignore[type-var] # _S is bound to string + +class _set_default_schema_on_connection(Protocol): + def __call__(self, cfg, dbapi_connection, schema_name) -> None: ... + +set_default_schema_on_connection: register[_set_default_schema_on_connection] diff --git a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi index d569a665dcd9..ae064446a2b3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi @@ -59,6 +59,7 @@ from .compat import ( has_refcount_gc as has_refcount_gc, inspect_getfullargspec as inspect_getfullargspec, int_types as int_types, + is64bit as is64bit, iterbytes as iterbytes, itertools_filter as itertools_filter, itertools_filterfalse as itertools_filterfalse, @@ -76,6 +77,9 @@ from .compat import ( py37 as py37, py38 as py38, py39 as py39, + py310 as py310, + py311 as py311, + py312 as py312, pypy as pypy, quote_plus as quote_plus, raise_ as raise_, diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index c345cfd901fb..631fcce3bda3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -139,7 +139,7 @@ class IdentitySet: def __hash__(self) -> int: ... class WeakSequence: - def __init__(self, __elements=...) -> None: ... + def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ...) -> None: ... def append(self, item) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index b329ffe40c6e..68bb936f3bdd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -1,19 +1,20 @@ -import builtins -import collections -import contextlib import itertools import operator import pickle as pickle +import sys import threading as threading from _typeshed import Incomplete from abc import ABC as ABC +from builtins import callable as callable, next as next +from collections import namedtuple as namedtuple # noqa: Y024 # Actual import +from contextlib import contextmanager as contextmanager from datetime import timezone as timezone from functools import reduce as reduce -from io import BytesIO as BytesIO, StringIO as StringIO +from io import BytesIO, StringIO as _StringIO from itertools import zip_longest as zip_longest from time import perf_counter as perf_counter from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple -from typing_extensions import Literal +from typing_extensions import Final from urllib.parse import ( parse_qsl as parse_qsl, quote as quote, @@ -24,21 +25,32 @@ from urllib.parse import ( byte_buffer = BytesIO +py312: bool +py311: bool +py310: bool py39: bool py38: bool py37: bool -py3k: Literal[True] -py2k: Literal[False] +py3k: Final = True +py2k: Final = False pypy: bool cpython: bool -win32: bool -osx: bool +if sys.platform == "win32": + win32: Final = True +else: + win32: Final = False +if sys.platform == "darwin": + osx: Final = True +else: + osx: Final = False arm: bool +is64bit: bool has_refcount_gc: bool -contextmanager = contextlib.contextmanager dottedgetter = operator.attrgetter -namedtuple = collections.namedtuple # noqa: Y024 -next = builtins.next + +class StringIO(_StringIO): + def seek(self, __pos: int, __whence: int = 0) -> int: ... + def truncate(self, __pos: int | None = None) -> int: ... class FullArgSpec(NamedTuple): args: Any @@ -82,10 +94,6 @@ def raise_( ) -> None: ... def u(s): ... def ue(s): ... - -callable = builtins.callable - -def safe_bytestring(text): ... def inspect_formatargspec( args, varargs: Incomplete | None = ..., From 0c2003b987b32b57eb5cef14744a02860911504e Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Jan 2023 21:53:54 -0500 Subject: [PATCH 02/25] Import typo --- stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 1b14062cce36..43538eedef88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections import Callable +from collections.abc import Callable from typing import Any, Generic, Protocol, TypeVar from ..sql.base import Generative From 50190e169e2d4e29e5a6c16d754d90ab9f8e3eff Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 28 Jan 2023 22:21:39 -0500 Subject: [PATCH 03/25] Address some PR comments --- stubs/SQLAlchemy/@tests/stubtest_allowlist.txt | 11 ++++++----- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 1 + stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi | 7 +++++-- stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi | 8 +------- stubs/SQLAlchemy/sqlalchemy/testing/config.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 8 +------- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 6 +----- stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi | 10 +++++++--- 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 7760c23792d6..8249c56d663c 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -9,11 +9,6 @@ sqlalchemy.engine.base.Engine.logging_name # initialized if not None sqlalchemy.sql.lambdas.PyWrapper.__clause_element__ sqlalchemy.testing.util.non_refcount_gc_collect -# wrong argument name in implementation ("self" instead of "cls") -sqlalchemy.engine.URL.__new__ -sqlalchemy.engine.url.URL.__new__ -sqlalchemy.util.langhelpers._symbol.__new__ - # abstract fields not present at runtime sqlalchemy.engine.Transaction.connection sqlalchemy.engine.Transaction.is_active @@ -62,3 +57,9 @@ sqlalchemy.sql.quoted_name.lower sqlalchemy.sql.quoted_name.upper sqlalchemy.orm.ColumnProperty.Comparator.__clause_element__ sqlalchemy.orm.properties.ColumnProperty.Comparator.__clause_element__ + +# Same error as in stdlib due to it being re-erported +sqlalchemy.util.compat.StringIO.seek +sqlalchemy.util.compat.StringIO.truncate +sqlalchemy.util.StringIO.seek +sqlalchemy.util.StringIO.truncate diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 30625dfcec8a..04a8ab923ae8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -19,6 +19,7 @@ class _URLTuple(NamedTuple): _Query: TypeAlias = Mapping[str, str | Sequence[str]] | Sequence[tuple[str, str | Sequence[str]]] class URL(_URLTuple): + def __new__(self: type[Self], *arg, **kw) -> Self | URL: ... @classmethod def create( cls, diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index fbce15f4bf6a..3e50992ec0ba 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Iterable, Mapping from typing import Any, TypeVar, overload from typing_extensions import Literal, SupportsIndex @@ -124,4 +124,7 @@ class MappedCollection(dict[_KT, _VT]): def setdefault(self, key: _KT, default: _T) -> _VT | _T: ... @overload def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... - def update(self, __other: Mapping[_KT, _VT] = ..., **kw: _VT) -> None: ... # type: ignore[override] + @overload + def update(self, __other: SupportsKeysAndGetItem[_KT, _VT] = ..., **kwargs: _VT) -> None: ... + @overload + def update(self, __other: Iterable[tuple[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 43538eedef88..fdccd161c3fc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -51,13 +51,7 @@ class _UnboundLoad(Load): # wich is callable with their original parameters. # # While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types. -# -# There is a workaround (define the method for Pylance, then reassign -# an instance of loader_option to it for mypy, and add pyright+Flake8 -# suppressions), but it is too hacky and relies on some unsupported quirks. -# -# Asking Pylance to add support for these generic callables might be preferable. +# show the parameters and return types without a hacky workaround. ### _F = TypeVar("_F", bound=Callable[..., loader_option[Any]]) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index db67aa9cbe9d..dca81e31185f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -26,7 +26,7 @@ class Config: is_async: Any def __init__(self, db, db_opts, options, file_config) -> None: ... @classmethod - def register(cls, db, db_opts, options, file_config): ... + def register(cls, db, db_opts, options, file_config) -> Config: ... @classmethod def set_as_current(cls, config, namespace) -> None: ... @classmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index 0fc5ecb899b9..bec851be3da1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -22,13 +22,7 @@ def reap_dbs(idents_file) -> None: ... # wich is callable with their original parameters. # # While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types. -# -# There is a workaround (define the method for Pylance, then reassign -# an instance of register to it for mypy, and add pyright+Flake8 -# suppressions), but it is too hacky and relies on some unsupported quirks. -# -# Asking Pylance to add support for these generic callables might be preferable. +# show the parameters and return types without a hacky workaround. ### _F = TypeVar("_F", bound=Callable[..., str | URL | None]) diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index 68bb936f3bdd..eae66bce00e1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -10,7 +10,7 @@ from collections import namedtuple as namedtuple # noqa: Y024 # Actual import from contextlib import contextmanager as contextmanager from datetime import timezone as timezone from functools import reduce as reduce -from io import BytesIO, StringIO as _StringIO +from io import BytesIO, StringIO as StringIO from itertools import zip_longest as zip_longest from time import perf_counter as perf_counter from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple @@ -48,10 +48,6 @@ is64bit: bool has_refcount_gc: bool dottedgetter = operator.attrgetter -class StringIO(_StringIO): - def seek(self, __pos: int, __whence: int = 0) -> int: ... - def truncate(self, __pos: int | None = None) -> int: ... - class FullArgSpec(NamedTuple): args: Any varargs: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 4c3949000381..3f0e7c564753 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -30,7 +30,7 @@ class PluginLoader: def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... def clear(self) -> None: ... def load(self, name): ... - def register(self, name, modulepath, objname): ... + def register(self, name, modulepath, objname) -> None: ... def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... def get_func_kwargs(func): ... @@ -129,12 +129,16 @@ class hybridmethod: def classlevel(self, func): ... class _symbol(int): - def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... + def __new__( # noqa: Y034 # Excplicitely instanciates _symbol + self, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any - def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... + def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol + cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + ) -> _symbol: ... @classmethod def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... From 125c2ddd92cdeb66b4ac9b8cc57aef07aaf385b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 29 Jan 2023 03:22:51 +0000 Subject: [PATCH 04/25] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 3e50992ec0ba..8efe02c952a0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete, SupportsKeysAndGetItem -from collections.abc import Iterable, Mapping +from collections.abc import Iterable from typing import Any, TypeVar, overload from typing_extensions import Literal, SupportsIndex From 9d9647f7f59c4281acf5cb38e0c3b11877dfe12b Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 07:08:14 -0500 Subject: [PATCH 05/25] Simplified loader_option and register --- .../SQLAlchemy/@tests/stubtest_allowlist.txt | 2 - .../sqlalchemy/orm/strategy_options.pyi | 167 +++++++----------- .../sqlalchemy/testing/provision.pyi | 130 +++++--------- 3 files changed, 100 insertions(+), 199 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 8249c56d663c..d2716d1ab5eb 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -1,7 +1,5 @@ # Expanding keyword arguments in stubs sqlalchemy.ext.declarative.as_declarative -sqlalchemy.orm.strategy_options.loader_option.__call__ -sqlalchemy.testing.provision.register.__call__ # not always present sqlalchemy.engine.Engine.logging_name # initialized if not None diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index fdccd161c3fc..c83a4c9dab9b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,6 +1,6 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self from collections.abc import Callable -from typing import Any, Generic, Protocol, TypeVar +from typing import Any from ..sql.base import Generative from .interfaces import LoaderOption @@ -18,116 +18,67 @@ class Load(Generative, LoaderOption): propagate_to_loaders: bool def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... - def options(self, *opts) -> None: ... - def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> None: ... - def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> None: ... - def set_generic_strategy(self, attrs, strategy) -> None: ... - def set_class_strategy(self, strategy, opts) -> None: ... - # added dynamically at runtime - def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... - def load_only(loadopt, *attrs): ... - def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... - def subqueryload(loadopt, attr): ... - def selectinload(loadopt, attr): ... - def lazyload(loadopt, attr): ... - def immediateload(loadopt, attr): ... - def noload(loadopt, attr): ... - def raiseload(loadopt, attr, sql_only: bool = ...): ... - def defaultload(loadopt, attr): ... - def defer(loadopt, key, raiseload: bool = ...): ... - def undefer(loadopt, key): ... - def undefer_group(loadopt, name): ... - def with_expression(loadopt, key, expression): ... - def selectin_polymorphic(loadopt, classes): ... + def options(self: Self, *opts) -> Self: ... + def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... + def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... + def set_class_strategy(self: Self, strategy, opts) -> Self: ... + # Added dynamically at runtime + def contains_eager(loadopt: Self, attr, alias: Incomplete | None = ...) -> Self: ... + def load_only(loadopt: Self, *attrs) -> Self: ... + def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def subqueryload(loadopt: Self, attr) -> Self: ... + def selectinload(loadopt: Self, attr) -> Self: ... + def lazyload(loadopt: Self, attr) -> Self: ... + def immediateload(loadopt: Self, attr) -> Self: ... + def noload(loadopt: Self, attr) -> Self: ... + def raiseload(loadopt: Self, attr, sql_only: bool = ...) -> Self: ... + def defaultload(loadopt: Self, attr) -> Self: ... + def defer(loadopt: Self, key, raiseload: bool = ...) -> Self: ... + def undefer(loadopt: Self, key) -> Self: ... + def undefer_group(loadopt: Self, name) -> Self: ... + def with_expression(loadopt: Self, key, expression) -> Self: ... + def selectin_polymorphic(loadopt: Self, classes) -> Self: ... class _UnboundLoad(Load): path: Any local_opts: Any def __init__(self) -> None: ... -### -# The methods below are decorated with the class loader_option -# They dynamically become instances of loader_option, -# wich is callable with their original parameters. -# -# While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types without a hacky workaround. -### - -_F = TypeVar("_F", bound=Callable[..., loader_option[Any]]) - -class loader_option(Generic[_F]): +class loader_option: name: str - _dynamic: _F - fn: _F - __call__: _F # Cheesy "__call__" definition to use the dynamic methods instead - -class _contains_eager(Protocol): - def __call__(self, loadopt, attr, alias: Incomplete | None = ...) -> loader_option[_contains_eager]: ... - -contains_eager: loader_option[_contains_eager] - -class _load_only(Protocol): - def __call__(self, loadopt, *attrs) -> loader_option[_load_only]: ... - -load_only: loader_option[_load_only] - -class _subqueryload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_subqueryload]: ... - -subqueryload: loader_option[_subqueryload] - -class _selectinload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_selectinload]: ... - -selectinload: loader_option[_selectinload] - -class _lazyload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_lazyload]: ... - -lazyload: loader_option[_lazyload] - -class _immediateload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_immediateload]: ... - -immediateload: loader_option[_immediateload] - -class _noload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_noload]: ... - -noload: loader_option[_noload] - -class _raiseload(Protocol): - def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_raiseload]: ... - -raiseload: loader_option[_raiseload] - -class _defaultload(Protocol): - def __call__(self, loadopt, attr) -> loader_option[_defaultload]: ... - -defaultload: loader_option[_defaultload] - -class _defer(Protocol): - def __call__(self, loadopt, attr, sql_only: bool = ...) -> loader_option[_defer]: ... - -defer: loader_option[_defer] - -class _undefer(Protocol): - def __call__(self, loadopt, key) -> loader_option[_undefer]: ... - -undefer: loader_option[_undefer] - -class _undefer_group(Protocol): - def __call__(self, loadopt, name) -> loader_option[_undefer_group]: ... - -undefer_group: loader_option[_undefer_group] - -class _with_expression(Protocol): - def __call__(self, loadopt, key, expression) -> loader_option[_with_expression]: ... - -with_expression: loader_option[_with_expression] - -class _selectin_polymorphic(Protocol): - def __call__(self, loadopt, classes) -> loader_option[_selectin_polymorphic]: ... - -selectin_polymorphic: loader_option[_selectin_polymorphic] + # The first parameter of this Callable should always be `loadopt: Load` + fn: Callable[..., loader_option] + def __call__(self: Self, fn: Callable[..., loader_option]) -> Self: ... + +# loader_option instances that can be used to dynamically add methods to Load at runtime +@loader_option() +def contains_eager(loadopt: Load, attr, alias: Incomplete | None = ...) -> loader_option: ... +@loader_option() +def load_only(loadopt: Load, *attrs) -> loader_option: ... +@loader_option() +def joinedload(loadopt, attr, innerjoin=None): ... +@loader_option() +def subqueryload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def selectinload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def lazyload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def immediateload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def noload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def raiseload(loadopt: Load, attr, sql_only: bool = ...) -> loader_option: ... +@loader_option() +def defaultload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def defer(loadopt: Load, key, raiseload: bool = ...) -> loader_option: ... +@loader_option() +def undefer(loadopt: Load, key) -> loader_option: ... +@loader_option() +def undefer_group(loadopt: Load, name) -> loader_option: ... +@loader_option() +def with_expression(loadopt: Load, key) -> loader_option: ... +@loader_option() +def selectin_polymorphic(loadopt: Load, classes) -> loader_option: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index bec851be3da1..fa82409a6acb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,11 +1,18 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger -from typing import Generic, Protocol, TypeVar +from typing import Any, Generic, NoReturn, TypeVar +from typing_extensions import TypeAlias +from sqlalchemy.engine.interfaces import Connectable from sqlalchemy.engine.url import URL from sqlalchemy.testing.config import Config +_Unused: TypeAlias = object +_S = TypeVar("_S", bound=str) +_U = TypeVar("_U", bound=URL) +_F = TypeVar("_F", bound=Callable[..., str | URL | None]) + log: Logger FOLLOWER_IDENT: Incomplete | None @@ -16,96 +23,41 @@ def generate_db_urls(db_urls, extra_drivers) -> None: ... def drop_all_schema_objects(cfg, eng) -> None: ... def reap_dbs(idents_file) -> None: ... -### -# The methods below are decorated with the method register.init -# They dynamically become instances of register, -# wich is callable with their original parameters. -# -# While both mypy and pyright's validation work, Pylance is unable to -# show the parameters and return types without a hacky workaround. -### - -_F = TypeVar("_F", bound=Callable[..., str | URL | None]) -_S = TypeVar("_S", bound=str) - class register(Generic[_F]): fns: dict[str, _F] @classmethod def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... - __call__: _F - -class _generate_driver_url(Protocol): - def __call__(self, url: URL, driver, query_str) -> URL | None: ... - -generate_driver_url: register[_generate_driver_url] - -class _drop_all_schema_objects_pre_tables(Protocol): - def __call__(self, cfg, eng) -> None: ... - -drop_all_schema_objects_pre_tables: register[_drop_all_schema_objects_pre_tables] - -class _drop_all_schema_objects_post_tables(Protocol): - def __call__(self, cfg, eng) -> None: ... - -drop_all_schema_objects_post_tables: register[_drop_all_schema_objects_post_tables] - -class _create_db(Protocol): - def __call__(self, cfg, eng, ident) -> None: ... - -create_db: register[_create_db] - -class _drop_db(Protocol): - def __call__(self, cfg, eng, ident) -> None: ... - -drop_db: register[_drop_db] - -class _update_db_opts(Protocol): - def __call__(self, cfg, db_opts) -> None: ... - -update_db_opts: register[_update_db_opts] - -class _post_configure_engine(Protocol): - def __call__(self, url: URL, engine, follower_ident) -> None: ... - -post_configure_engine: register[_post_configure_engine] - -class _follower_url_from_main(Protocol): - def __call__(self, url: URL, ident) -> URL: ... - -follower_url_from_main: register[_follower_url_from_main] - -class _configure_follower(Protocol): - def __call__(self, cfg, ident) -> None: ... - -configure_follower: register[_configure_follower] - -class _run_reap_dbs(Protocol): - def __call__(self, url: URL, ident) -> None: ... - -run_reap_dbs: register[_run_reap_dbs] - -class _temp_table_keyword_args(Protocol): - def __call__(self, cfg, eng) -> None: ... - -temp_table_keyword_args: register[_temp_table_keyword_args] - -class _prepare_for_drop_tables(Protocol): - def __call__(self, config, connection) -> None: ... - -prepare_for_drop_tables: register[_prepare_for_drop_tables] - -class _stop_test_class_outside_fixtures(Protocol): - def __call__(self, config, db, testcls) -> None: ... - -stop_test_class_outside_fixtures: register[_stop_test_class_outside_fixtures] - -class _get_temp_table_name(Protocol): - def __call__(self, cfg, eng, base_name: _S) -> _S: ... - -get_temp_table_name: register[_get_temp_table_name] # type: ignore[type-var] # _S is bound to string - -class _set_default_schema_on_connection(Protocol): - def __call__(self, cfg, dbapi_connection, schema_name) -> None: ... - -set_default_schema_on_connection: register[_set_default_schema_on_connection] + # Impossible to specify the args from the generic Callable in the current type system + def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... + +@register.init +def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... +@register.init +def drop_all_schema_objects_pre_tables(cfg: _Unused, eng: _Unused) -> None: ... +@register.init +def drop_all_schema_objects_post_tables(cfg: _Unused, eng: _Unused) -> None: ... +@register.init +def create_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +@register.init +def drop_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +@register.init +def update_db_opts(db_url: _Unused, db_opts: _Unused) -> None: ... +@register.init +def post_configure_engine(url: _Unused, engine: _Unused, follower_ident: _Unused) -> None: ... +@register.init +def follower_url_from_main(url: _U, ident) -> _U: ... +@register.init +def configure_follower(cfg: _Unused, ident: _Unused) -> None: ... +@register.init +def run_reap_dbs(url: _Unused, ident: _Unused) -> None: ... +@register.init +def temp_table_keyword_args(cfg: _Unused, eng: Connectable) -> NoReturn: ... +@register.init +def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... +@register.init +def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... +@register.init # type: ignore[type-var] # False-positive, _S is bound to str +def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... +@register.init +def set_default_schema_on_connection(cfg, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... From 597d925b688596940623898a3527b221ffaf1764 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 10:30:49 -0500 Subject: [PATCH 06/25] Tests with showing limitaitons --- .../@tests/test_cases/check_loader_option.py | 58 +++++++++++ .../@tests/test_cases/check_register.py | 96 +++++++++++++++++++ stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 2 +- .../sqlalchemy/testing/provision.pyi | 12 +-- 4 files changed, 161 insertions(+), 7 deletions(-) create mode 100644 stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py create mode 100644 stubs/SQLAlchemy/@tests/test_cases/check_register.py diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py new file mode 100644 index 000000000000..43444ac00974 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py @@ -0,0 +1,58 @@ +from typing_extensions import assert_type + +from sqlalchemy.orm.strategy_options import ( + Load, + contains_eager, + defaultload, + defer, + immediateload, + joinedload, + lazyload, + load_only, + loader_option, + noload, + raiseload, + selectin_polymorphic, + selectinload, + subqueryload, + undefer, + undefer_group, + with_expression, +) + + +def fn(loadopt: Load, *args: object) -> loader_option: + return loader_option() + + +# Testing that the function and return type of function are actually all instances of "loader_option" +assert_type(contains_eager, loader_option) +assert_type(contains_eager(fn), loader_option) +assert_type(load_only, loader_option) +assert_type(load_only(fn), loader_option) +assert_type(joinedload, loader_option) +assert_type(joinedload(fn), loader_option) +assert_type(subqueryload, loader_option) +assert_type(subqueryload(fn), loader_option) +assert_type(selectinload, loader_option) +assert_type(selectinload(fn), loader_option) +assert_type(lazyload, loader_option) +assert_type(lazyload(fn), loader_option) +assert_type(immediateload, loader_option) +assert_type(immediateload(fn), loader_option) +assert_type(noload, loader_option) +assert_type(noload(fn), loader_option) +assert_type(raiseload, loader_option) +assert_type(raiseload(fn), loader_option) +assert_type(defaultload, loader_option) +assert_type(defaultload(fn), loader_option) +assert_type(defer, loader_option) +assert_type(defer(fn), loader_option) +assert_type(undefer, loader_option) +assert_type(undefer(fn), loader_option) +assert_type(undefer_group, loader_option) +assert_type(undefer_group(fn), loader_option) +assert_type(with_expression, loader_option) +assert_type(with_expression(fn), loader_option) +assert_type(selectin_polymorphic, loader_option) +assert_type(selectin_polymorphic(fn), loader_option) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py new file mode 100644 index 000000000000..63d630717ac6 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections import Callable +from typing import NoReturn, Optional, Union +from typing_extensions import assert_type + +from sqlalchemy.engine.base import Connection +from sqlalchemy.engine.interfaces import Connectable +from sqlalchemy.engine.url import URL +from sqlalchemy.testing.config import Config +from sqlalchemy.testing.provision import ( + _S, + _U, + configure_follower, + create_db, + drop_all_schema_objects_post_tables, + drop_all_schema_objects_pre_tables, + drop_db, + follower_url_from_main, + generate_driver_url, + get_temp_table_name, + post_configure_engine, + prepare_for_drop_tables, + register, + run_reap_dbs, + set_default_schema_on_connection, + stop_test_class_outside_fixtures, + temp_table_keyword_args, + update_db_opts, +) + +config: Config +url: URL +engine: Connectable +connection: Connection + +# # Expression is of type "register[Callable[[object, object], None]]", not "register[Callable[[object, object], None]]" [assert-type] + +# Testing that the functions are actually all instances of "register" +assert_type(generate_driver_url, register[Callable[[_U, str, str], Optional[_U]]]) +assert_type(drop_all_schema_objects_pre_tables, register[Callable[[object, object], None]]) +assert_type(drop_all_schema_objects_post_tables, register[Callable[[object, object], None]]) +assert_type(create_db, register[Callable[[object, Connectable, object], NoReturn]]) +assert_type(drop_db, register[Callable[[object, Connectable, object], NoReturn]]) +assert_type(update_db_opts, register) +assert_type(post_configure_engine, register) +assert_type(follower_url_from_main, register) +assert_type(configure_follower, register) +assert_type(run_reap_dbs, register) +assert_type(temp_table_keyword_args, register) +assert_type(prepare_for_drop_tables, register) +assert_type(stop_test_class_outside_fixtures, register) +assert_type(get_temp_table_name, register) +assert_type(set_default_schema_on_connection, register) + +# Because it's impossible to define register.__call__ return type through the use of a decorator, +# we can't use assert_type to test that teh right type would be returned, (it always expects Union[str, URL, None]) + +assert_type(generate_driver_url(url, ""), Optional[URL]) # type: ignore[assert-type] +assert_type(drop_all_schema_objects_pre_tables(url, engine), None) +assert_type(drop_all_schema_objects_post_tables(url, engine), None) +assert_type(create_db(url, engine, ""), NoReturn) +assert_type(drop_db(url, engine, ""), NoReturn) +assert_type(update_db_opts(url, {}), None) +assert_type(post_configure_engine(url, engine, ""), None) +assert_type(follower_url_from_main(url, ""), URL) +assert_type(configure_follower(url, ""), None) +assert_type(run_reap_dbs(url, ""), None) +assert_type(temp_table_keyword_args(url, engine), NoReturn) +assert_type(prepare_for_drop_tables(url, connection), None) +assert_type(stop_test_class_outside_fixtures(url, connection, type), None) +assert_type(get_temp_table_name(url, engine, ""), str) +assert_type(set_default_schema_on_connection(url, connection, ""), NoReturn) + +# The decorator changes the first parameter to "cfg: str | URL" +@register.init +def no_args(foo: int) -> None: + pass + + +no_args(cfg=url) +generate_driver_url(url, "") +drop_all_schema_objects_pre_tables(url, engine) +drop_all_schema_objects_post_tables(url, engine) +create_db(url, engine, "") +drop_db(url, engine, "") +update_db_opts(url, {}) +post_configure_engine(url, engine, "") +follower_url_from_main(url, "") +configure_follower(url, "") +run_reap_dbs(url, "") +temp_table_keyword_args(url, engine) +prepare_for_drop_tables(url, connection) +stop_test_class_outside_fixtures(url, connection, type) +get_temp_table_name(url, engine, "") +set_default_schema_on_connection(url, connection, "") diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 8938a45ad691..c54ea44d0485 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -13,7 +13,7 @@ _DeclT = TypeVar("_DeclT", bound=type[_DeclarativeBase]) # Dynamic class as created by registry.generate_base() via DeclarativeMeta # or another metaclass. This class does not exist at runtime. -class _DeclarativeBase(Any): # super classes are dynamic +class _DeclarativeBase(Any): # type: ignore[misc] # super classes are dynamic registry: ClassVar[registry] metadata: ClassVar[MetaData] __abstract__: ClassVar[bool] diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index fa82409a6acb..d6784e405e9f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -2,11 +2,11 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias +from typing_extensions import TypeAlias, reveal_type -from sqlalchemy.engine.interfaces import Connectable -from sqlalchemy.engine.url import URL -from sqlalchemy.testing.config import Config +from ..engine.interfaces import Connectable +from ..engine.url import URL +from ..testing.config import Config _Unused: TypeAlias = object _S = TypeVar("_S", bound=str) @@ -29,7 +29,7 @@ class register(Generic[_F]): def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system - def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... + def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @@ -46,7 +46,7 @@ def update_db_opts(db_url: _Unused, db_opts: _Unused) -> None: ... @register.init def post_configure_engine(url: _Unused, engine: _Unused, follower_ident: _Unused) -> None: ... @register.init -def follower_url_from_main(url: _U, ident) -> _U: ... +def follower_url_from_main(url: _U, ident: str) -> _U: ... @register.init def configure_follower(cfg: _Unused, ident: _Unused) -> None: ... @register.init From 6a5ca2c9166d7629dc33eaae85f0f77f599d0c8d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 15:32:22 +0000 Subject: [PATCH 07/25] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/SQLAlchemy/@tests/test_cases/check_register.py | 3 +-- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 63d630717ac6..98dc046420ef 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections import Callable -from typing import NoReturn, Optional, Union +from typing import NoReturn, Optional from typing_extensions import assert_type from sqlalchemy.engine.base import Connection @@ -9,7 +9,6 @@ from sqlalchemy.engine.url import URL from sqlalchemy.testing.config import Config from sqlalchemy.testing.provision import ( - _S, _U, configure_follower, create_db, diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index d6784e405e9f..e32fec0eaee4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias, reveal_type +from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL From 5d35846c0c378ce183820eea67f14a76ae5ad6bc Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 10:40:11 -0500 Subject: [PATCH 08/25] Remove test limitation demo --- .../@tests/test_cases/check_register.py | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 63d630717ac6..ab585fc81f67 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,16 +1,7 @@ -from __future__ import annotations - -from collections import Callable -from typing import NoReturn, Optional, Union -from typing_extensions import assert_type - from sqlalchemy.engine.base import Connection from sqlalchemy.engine.interfaces import Connectable from sqlalchemy.engine.url import URL -from sqlalchemy.testing.config import Config from sqlalchemy.testing.provision import ( - _S, - _U, configure_follower, create_db, drop_all_schema_objects_post_tables, @@ -29,49 +20,10 @@ update_db_opts, ) -config: Config url: URL engine: Connectable connection: Connection -# # Expression is of type "register[Callable[[object, object], None]]", not "register[Callable[[object, object], None]]" [assert-type] - -# Testing that the functions are actually all instances of "register" -assert_type(generate_driver_url, register[Callable[[_U, str, str], Optional[_U]]]) -assert_type(drop_all_schema_objects_pre_tables, register[Callable[[object, object], None]]) -assert_type(drop_all_schema_objects_post_tables, register[Callable[[object, object], None]]) -assert_type(create_db, register[Callable[[object, Connectable, object], NoReturn]]) -assert_type(drop_db, register[Callable[[object, Connectable, object], NoReturn]]) -assert_type(update_db_opts, register) -assert_type(post_configure_engine, register) -assert_type(follower_url_from_main, register) -assert_type(configure_follower, register) -assert_type(run_reap_dbs, register) -assert_type(temp_table_keyword_args, register) -assert_type(prepare_for_drop_tables, register) -assert_type(stop_test_class_outside_fixtures, register) -assert_type(get_temp_table_name, register) -assert_type(set_default_schema_on_connection, register) - -# Because it's impossible to define register.__call__ return type through the use of a decorator, -# we can't use assert_type to test that teh right type would be returned, (it always expects Union[str, URL, None]) - -assert_type(generate_driver_url(url, ""), Optional[URL]) # type: ignore[assert-type] -assert_type(drop_all_schema_objects_pre_tables(url, engine), None) -assert_type(drop_all_schema_objects_post_tables(url, engine), None) -assert_type(create_db(url, engine, ""), NoReturn) -assert_type(drop_db(url, engine, ""), NoReturn) -assert_type(update_db_opts(url, {}), None) -assert_type(post_configure_engine(url, engine, ""), None) -assert_type(follower_url_from_main(url, ""), URL) -assert_type(configure_follower(url, ""), None) -assert_type(run_reap_dbs(url, ""), None) -assert_type(temp_table_keyword_args(url, engine), NoReturn) -assert_type(prepare_for_drop_tables(url, connection), None) -assert_type(stop_test_class_outside_fixtures(url, connection, type), None) -assert_type(get_temp_table_name(url, engine, ""), str) -assert_type(set_default_schema_on_connection(url, connection, ""), NoReturn) - # The decorator changes the first parameter to "cfg: str | URL" @register.init def no_args(foo: int) -> None: From 36952cd9fc2c4cdd8183a0ba5bd103c48f3b651d Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 10:43:38 -0500 Subject: [PATCH 09/25] Ensure modern syntax --- stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py | 2 ++ stubs/SQLAlchemy/@tests/test_cases/check_register.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py index 43444ac00974..1f596af83356 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing_extensions import assert_type from sqlalchemy.orm.strategy_options import ( diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index ab585fc81f67..2cc2b423aa02 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from sqlalchemy.engine.base import Connection from sqlalchemy.engine.interfaces import Connectable from sqlalchemy.engine.url import URL From 952f8a7cfd2eab70cc8dd764ae8e3f414bcefa2c Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 11:29:55 -0500 Subject: [PATCH 10/25] fix pyrigth test_cases --- .../@tests/test_cases/check_register.py | 41 +++++++++++-------- stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 4 +- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 2cc2b423aa02..57498c44ea44 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -1,8 +1,12 @@ from __future__ import annotations -from sqlalchemy.engine.base import Connection -from sqlalchemy.engine.interfaces import Connectable +from _typeshed.dbapi import DBAPIConnection +from typing import cast + +from sqlalchemy.engine.base import Engine +from sqlalchemy.engine.default import DefaultDialect from sqlalchemy.engine.url import URL +from sqlalchemy.pool.base import Pool from sqlalchemy.testing.provision import ( configure_follower, create_db, @@ -21,10 +25,11 @@ temp_table_keyword_args, update_db_opts, ) +from sqlalchemy.util import immutabledict -url: URL -engine: Connectable -connection: Connection +url = URL("", "", "", "", 0, "", immutabledict()) +engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") +unused = None # The decorator changes the first parameter to "cfg: str | URL" @register.init @@ -33,18 +38,18 @@ def no_args(foo: int) -> None: no_args(cfg=url) -generate_driver_url(url, "") -drop_all_schema_objects_pre_tables(url, engine) -drop_all_schema_objects_post_tables(url, engine) -create_db(url, engine, "") -drop_db(url, engine, "") -update_db_opts(url, {}) -post_configure_engine(url, engine, "") +generate_driver_url(url, "", "") +drop_all_schema_objects_pre_tables(url, unused) +drop_all_schema_objects_post_tables(url, unused) +create_db(url, engine, unused) +drop_db(url, engine, unused) +update_db_opts(url, unused) +post_configure_engine(url, unused, unused) follower_url_from_main(url, "") -configure_follower(url, "") -run_reap_dbs(url, "") +configure_follower(url, unused) +run_reap_dbs(url, unused) temp_table_keyword_args(url, engine) -prepare_for_drop_tables(url, connection) -stop_test_class_outside_fixtures(url, connection, type) -get_temp_table_name(url, engine, "") -set_default_schema_on_connection(url, connection, "") +prepare_for_drop_tables(url, unused) +stop_test_class_outside_fixtures(url, unused, type) +get_temp_table_name(url, unused, "") +set_default_schema_on_connection(url, unused, unused) diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index b169e6d8e166..14e6e99b8afc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -1,4 +1,6 @@ from _typeshed import Incomplete +from _typeshed.dbapi import DBAPIConnection +from collections.abc import Callable from typing import Any from .. import log @@ -24,7 +26,7 @@ class Pool(log.Identified): echo: Any def __init__( self, - creator, + creator: Callable[[], DBAPIConnection], recycle: int = ..., echo: Incomplete | None = ..., logging_name: Incomplete | None = ..., From 724e24851985f07c3938d08156c8461dbdf136ac Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 30 Jan 2023 11:38:05 -0500 Subject: [PATCH 11/25] Even better first arg check --- stubs/SQLAlchemy/@tests/test_cases/check_register.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 57498c44ea44..41ad1f1d1ae5 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -31,9 +31,14 @@ engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") unused = None + +class Foo: + pass + + # The decorator changes the first parameter to "cfg: str | URL" @register.init -def no_args(foo: int) -> None: +def no_args(__foo: Foo) -> None: pass From dc04a31d909019a1a411d7e036602f425a425662 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 26 Jan 2023 21:47:08 -0500 Subject: [PATCH 12/25] Fix most stubtest_allowlist entries in SQLAlchemy --- .github/workflows/mypy_primer_comment.yml | 8 +- .github/workflows/tests.yml | 2 +- .pre-commit-config.yaml | 4 +- pyproject.toml | 2 +- requirements-tests.txt | 4 +- scripts/stubsabot.py | 3 +- stdlib/_bisect.pyi | 40 +- stdlib/_bootlocale.pyi | 2 +- stdlib/_codecs.pyi | 18 +- stdlib/_decimal.pyi | 2 +- stdlib/_dummy_thread.pyi | 6 +- stdlib/_dummy_threading.pyi | 40 +- stdlib/_warnings.pyi | 4 +- stdlib/_weakrefset.pyi | 2 +- stdlib/_winapi.pyi | 6 +- stdlib/aifc.pyi | 4 +- stdlib/argparse.pyi | 38 +- stdlib/ast.pyi | 50 +- stdlib/asyncio/base_events.pyi | 218 +-- stdlib/asyncio/events.pyi | 224 +-- stdlib/asyncio/futures.pyi | 2 +- stdlib/asyncio/locks.pyi | 4 +- stdlib/asyncio/proactor_events.pyi | 6 +- stdlib/asyncio/queues.pyi | 2 +- stdlib/asyncio/runners.pyi | 2 +- stdlib/asyncio/sslproto.pyi | 18 +- stdlib/asyncio/streams.pyi | 16 +- stdlib/asyncio/subprocess.pyi | 36 +- stdlib/asyncio/tasks.pyi | 78 +- stdlib/asyncio/windows_events.pyi | 12 +- stdlib/asyncio/windows_utils.pyi | 8 +- stdlib/asyncore.pyi | 6 +- stdlib/builtins.pyi | 163 +-- stdlib/bz2.pyi | 76 +- stdlib/cgi.pyi | 2 +- stdlib/cmath.pyi | 2 +- stdlib/codecs.pyi | 2 +- stdlib/collections/__init__.pyi | 29 +- stdlib/compileall.pyi | 80 +- stdlib/concurrent/futures/_base.pyi | 2 +- stdlib/concurrent/futures/process.pyi | 12 +- stdlib/configparser.pyi | 48 +- stdlib/contextlib.pyi | 4 +- stdlib/csv.pyi | 14 +- stdlib/ctypes/__init__.pyi | 9 +- stdlib/dataclasses.pyi | 168 ++- stdlib/datetime.pyi | 2 +- stdlib/difflib.pyi | 16 +- stdlib/dis.pyi | 14 +- stdlib/distutils/command/bdist_msi.pyi | 6 +- stdlib/distutils/command/bdist_wininst.pyi | 2 +- stdlib/distutils/fancy_getopt.pyi | 2 +- stdlib/distutils/filelist.pyi | 12 +- stdlib/distutils/log.pyi | 2 +- stdlib/email/feedparser.pyi | 4 +- stdlib/enum.pyi | 20 +- stdlib/fileinput.pyi | 200 +-- stdlib/formatter.pyi | 18 +- stdlib/fractions.pyi | 6 +- stdlib/ftplib.pyi | 26 +- stdlib/functools.pyi | 14 +- stdlib/gettext.pyi | 68 +- stdlib/glob.pyi | 8 +- stdlib/graphlib.pyi | 2 +- stdlib/gzip.pyi | 70 +- stdlib/hmac.pyi | 2 +- stdlib/http/cookiejar.pyi | 26 +- stdlib/imaplib.pyi | 18 +- stdlib/imghdr.pyi | 2 +- stdlib/importlib/abc.pyi | 2 +- stdlib/inspect.pyi | 10 +- stdlib/lib2to3/pytree.pyi | 2 +- stdlib/locale.pyi | 4 +- stdlib/logging/__init__.pyi | 26 +- stdlib/logging/config.pyi | 4 +- stdlib/logging/handlers.pyi | 30 +- stdlib/lzma.pyi | 72 +- stdlib/mailbox.pyi | 10 +- stdlib/math.pyi | 8 +- stdlib/mimetypes.pyi | 6 +- stdlib/modulefinder.pyi | 4 +- stdlib/msilib/__init__.pyi | 28 +- stdlib/multiprocessing/connection.pyi | 4 +- stdlib/multiprocessing/context.pyi | 18 +- stdlib/multiprocessing/dummy/connection.pyi | 2 +- stdlib/multiprocessing/heap.pyi | 2 +- stdlib/multiprocessing/managers.pyi | 8 +- stdlib/multiprocessing/popen_spawn_win32.pyi | 2 +- stdlib/multiprocessing/reduction.pyi | 6 +- stdlib/multiprocessing/shared_memory.pyi | 4 +- stdlib/multiprocessing/sharedctypes.pyi | 30 +- stdlib/nntplib.pyi | 2 +- stdlib/ntpath.pyi | 4 +- stdlib/numbers.pyi | 2 +- stdlib/optparse.pyi | 4 +- stdlib/os/__init__.pyi | 40 +- stdlib/pathlib.pyi | 42 +- stdlib/pickle.pyi | 8 +- stdlib/platform.pyi | 12 +- stdlib/plistlib.pyi | 8 +- stdlib/posixpath.pyi | 10 +- stdlib/pprint.pyi | 58 +- stdlib/py_compile.pyi | 12 +- stdlib/pyclbr.pyi | 4 +- stdlib/pydoc.pyi | 12 +- stdlib/pyexpat/__init__.pyi | 2 +- stdlib/random.pyi | 12 +- stdlib/re.pyi | 96 +- stdlib/shutil.pyi | 34 +- stdlib/smtpd.pyi | 4 +- stdlib/smtplib.pyi | 8 +- stdlib/socket.pyi | 52 +- stdlib/socketserver.pyi | 2 +- stdlib/sqlite3/dbapi2.pyi | 2 +- stdlib/sre_constants.pyi | 4 + stdlib/sre_parse.pyi | 4 +- stdlib/ssl.pyi | 10 +- stdlib/statistics.pyi | 4 +- stdlib/subprocess.pyi | 1270 ++++++++--------- stdlib/sunau.pyi | 2 +- stdlib/symtable.pyi | 2 +- stdlib/tarfile.pyi | 22 +- stdlib/tempfile.pyi | 227 +-- stdlib/tkinter/__init__.pyi | 380 ++--- stdlib/tkinter/colorchooser.pyi | 4 +- stdlib/tkinter/commondialog.pyi | 2 +- stdlib/tkinter/dialog.pyi | 2 +- stdlib/tkinter/dnd.pyi | 4 +- stdlib/tkinter/filedialog.pyi | 16 +- stdlib/tkinter/font.pyi | 30 +- stdlib/tkinter/messagebox.pyi | 16 +- stdlib/tkinter/scrolledtext.pyi | 2 +- stdlib/tkinter/simpledialog.pyi | 16 +- stdlib/tkinter/tix.pyi | 72 +- stdlib/tkinter/ttk.pyi | 164 +-- stdlib/traceback.pyi | 50 +- stdlib/turtle.pyi | 168 +-- stdlib/types.pyi | 28 +- stdlib/typing.pyi | 4 +- stdlib/typing_extensions.pyi | 20 +- stdlib/unittest/case.pyi | 44 +- stdlib/unittest/mock.pyi | 7 +- stdlib/unittest/signals.pyi | 2 +- stdlib/urllib/parse.pyi | 20 +- stdlib/uuid.pyi | 2 +- stdlib/venv/__init__.pyi | 22 +- stdlib/warnings.pyi | 32 +- stdlib/wave.pyi | 2 +- stdlib/weakref.pyi | 2 +- stdlib/webbrowser.pyi | 2 +- stdlib/winreg.pyi | 8 +- stdlib/winsound.pyi | 2 +- stdlib/wsgiref/headers.pyi | 2 +- stdlib/xml/dom/minidom.pyi | 12 +- stdlib/xml/etree/ElementInclude.pyi | 2 +- stdlib/xml/etree/ElementTree.pyi | 88 +- stdlib/xmlrpc/client.pyi | 22 +- stdlib/zipfile.pyi | 48 +- stdlib/zlib.pyi | 2 +- .../SQLAlchemy/@tests/stubtest_allowlist.txt | 1173 +-------------- .../@tests/test_cases/check_loader_option.py | 60 + .../@tests/test_cases/check_register.py | 60 + stubs/SQLAlchemy/METADATA.toml | 1 + .../sqlalchemy/dialects/mssql/base.pyi | 1 - .../sqlalchemy/dialects/postgresql/base.pyi | 1 + .../sqlalchemy/engine/interfaces.pyi | 1 - stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 1 + stubs/SQLAlchemy/sqlalchemy/event/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/collections.pyi | 54 +- stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 2 +- .../sqlalchemy/orm/strategy_options.pyi | 98 +- stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi | 4 +- .../SQLAlchemy/sqlalchemy/testing/config.pyi | 2 +- .../sqlalchemy/testing/provision.pyi | 80 +- stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi | 4 + .../sqlalchemy/util/_collections.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 36 +- .../sqlalchemy/util/langhelpers.pyi | 10 +- stubs/croniter/@tests/stubtest_allowlist.txt | 5 - stubs/croniter/croniter/croniter.pyi | 54 +- stubs/influxdb-client/METADATA.toml | 2 +- stubs/ldap3/ldap3/protocol/rfc4511.pyi | 2 +- stubs/python-slugify/METADATA.toml | 2 +- stubs/redis/redis/asyncio/client.pyi | 4 +- stubs/whatthepatch/whatthepatch/patch.pyi | 1 + test_cases/stdlib/check_dataclasses.py | 81 ++ test_cases/stdlib/check_re.py | 26 + test_cases/stdlib/typing/check_pattern.py | 10 - tests/check_consistent.py | 82 +- tests/get_external_stub_requirements.py | 2 +- tests/get_stubtest_system_requirements.py | 13 +- tests/mypy_test.py | 3 +- tests/parse_metadata.py | 264 ++++ tests/pytype_test.py | 4 +- tests/regr_test.py | 2 +- tests/stubtest_allowlists/py37.txt | 2 - tests/stubtest_allowlists/py38.txt | 1 - tests/stubtest_third_party.py | 33 +- tests/utils.py | 82 +- 204 files changed, 3642 insertions(+), 4213 deletions(-) create mode 100644 stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py create mode 100644 stubs/SQLAlchemy/@tests/test_cases/check_register.py delete mode 100644 stubs/croniter/@tests/stubtest_allowlist.txt create mode 100644 test_cases/stdlib/check_dataclasses.py create mode 100644 test_cases/stdlib/check_re.py delete mode 100644 test_cases/stdlib/typing/check_pattern.py mode change 100755 => 100644 tests/check_consistent.py create mode 100644 tests/parse_metadata.py diff --git a/.github/workflows/mypy_primer_comment.yml b/.github/workflows/mypy_primer_comment.yml index 172bb9cfb86c..0be8c376bb60 100644 --- a/.github/workflows/mypy_primer_comment.yml +++ b/.github/workflows/mypy_primer_comment.yml @@ -50,9 +50,11 @@ jobs: script: | const fs = require('fs') let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' }) - // posting comment fails if too long, so truncate - if (data.length > 30000) { - let truncated_data = data.substring(0, 30000) + + // Maximum comment length is 65536 characters. We need much less than 236 for extra text. + const MAX_LENGTH = 65300 + if (data.length > MAX_LENGTH) { + let truncated_data = data.substring(0, MAX_LENGTH) let lines_truncated = data.split('\n').length - truncated_data.split('\n').length data = truncated_data + `\n\n... (truncated ${lines_truncated} lines) ...\n` } diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 51f3391f3444..19f8d571f023 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: cache: pip cache-dependency-path: requirements-tests.txt - run: pip install -r requirements-tests.txt - - run: ./tests/check_consistent.py + - run: python ./tests/check_consistent.py new-syntax: name: Ensure new syntax usage diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c3bcea9af66..ef762f280afa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - id: black language_version: python3.10 - repo: https://github.com/pycqa/isort - rev: 5.11.4 # must match requirements-tests.txt + rev: 5.12.0 # must match requirements-tests.txt hooks: - id: isort name: isort (python) @@ -32,7 +32,7 @@ repos: additional_dependencies: - "flake8-bugbear==23.1.14" # must match requirements-tests.txt - "flake8-noqa==1.3.0" # must match requirements-tests.txt - - "flake8-pyi==23.1.0" # must match requirements-tests.txt + - "flake8-pyi==23.1.1" # must match requirements-tests.txt - repo: https://github.com/pre-commit/mirrors-prettier rev: v3.0.0-alpha.4 python_requirement: false diff --git a/pyproject.toml b/pyproject.toml index 43aeda05d5a6..497a7a905a93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ extra_standard_library = [ "opcode", "pyexpat", ] -known_first_party = ["utils"] +known_first_party = ["utils", "parse_metadata"] [tool.pycln] all = true diff --git a/requirements-tests.txt b/requirements-tests.txt index 0a77cf0bcf1b..7d34c0a73fa3 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -3,8 +3,8 @@ black==22.12.0 # must match .pre-commit-confi flake8==6.0.0; python_version >= "3.8" # must match .pre-commit-config.yaml flake8-bugbear==23.1.14; python_version >= "3.8" # must match .pre-commit-config.yaml flake8-noqa==1.3.0; python_version >= "3.8" # must match .pre-commit-config.yaml -flake8-pyi==23.1.0; python_version >= "3.8" # must match .pre-commit-config.yaml -isort==5.11.4 # must match .pre-commit-config.yaml +flake8-pyi==23.1.1; python_version >= "3.8" # must match .pre-commit-config.yaml +isort==5.12.0; python_version >= "3.8" # must match .pre-commit-config.yaml mypy==0.991 packaging==23.0 pathspec>=0.10.3 diff --git a/scripts/stubsabot.py b/scripts/stubsabot.py index 574a7361153c..a9a19e333c2b 100644 --- a/scripts/stubsabot.py +++ b/scripts/stubsabot.py @@ -173,7 +173,8 @@ async def release_contains_py_typed(release_to_download: PypiReleaseDownload, *, async def find_first_release_with_py_typed(pypi_info: PypiInfo, *, session: aiohttp.ClientSession) -> PypiReleaseDownload: release_iter = pypi_info.releases_in_descending_order() while await release_contains_py_typed(release := next(release_iter), session=session): - first_release_with_py_typed = release + if not release.version.is_prerelease: + first_release_with_py_typed = release return first_release_with_py_typed diff --git a/stdlib/_bisect.pyi b/stdlib/_bisect.pyi index d902e1eea7d4..4c79eec14d72 100644 --- a/stdlib/_bisect.pyi +++ b/stdlib/_bisect.pyi @@ -8,67 +8,67 @@ _T = TypeVar("_T") if sys.version_info >= (3, 10): @overload def bisect_left( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ..., *, key: None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None, *, key: None = None ) -> int: ... @overload def bisect_left( a: Sequence[_T], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = ..., + key: Callable[[_T], SupportsRichComparisonT], ) -> int: ... @overload def bisect_right( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ..., *, key: None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None, *, key: None = None ) -> int: ... @overload def bisect_right( a: Sequence[_T], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = ..., + key: Callable[[_T], SupportsRichComparisonT], ) -> int: ... @overload def insort_left( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: None = ..., + key: None = None, ) -> None: ... @overload def insort_left( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparisonT] = ... + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] ) -> None: ... @overload def insort_right( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: None = ..., + key: None = None, ) -> None: ... @overload def insort_right( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparisonT] = ... + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] ) -> None: ... else: def bisect_left( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... def bisect_right( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... def insort_left( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... def insort_right( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... diff --git a/stdlib/_bootlocale.pyi b/stdlib/_bootlocale.pyi index ee2d89347a9f..233d4934f3c6 100644 --- a/stdlib/_bootlocale.pyi +++ b/stdlib/_bootlocale.pyi @@ -1 +1 @@ -def getpreferredencoding(do_setlocale: bool = ...) -> str: ... +def getpreferredencoding(do_setlocale: bool = True) -> str: ... diff --git a/stdlib/_codecs.pyi b/stdlib/_codecs.pyi index 232256fbf614..e1b158db812e 100644 --- a/stdlib/_codecs.pyi +++ b/stdlib/_codecs.pyi @@ -45,27 +45,29 @@ _BytesToBytesEncoding: TypeAlias = Literal[ _StrToStrEncoding: TypeAlias = Literal["rot13", "rot_13"] @overload -def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... +def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... @overload -def encode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... # type: ignore[misc] +def encode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # type: ignore[misc] @overload -def encode(obj: str, encoding: str = ..., errors: str = ...) -> bytes: ... +def encode(obj: str, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... @overload -def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... # type: ignore[misc] +def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... # type: ignore[misc] @overload -def decode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... +def decode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # these are documented as text encodings but in practice they also accept str as input @overload def decode( - obj: str, encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], errors: str = ... + obj: str, + encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], + errors: str = "strict", ) -> str: ... # hex is officially documented as a bytes to bytes encoding, but it appears to also work with str @overload -def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = ...) -> bytes: ... +def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = "strict") -> bytes: ... @overload -def decode(obj: ReadableBuffer, encoding: str = ..., errors: str = ...) -> str: ... +def decode(obj: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> str: ... def lookup(__encoding: str) -> codecs.CodecInfo: ... def charmap_build(__map: str) -> _CharMap: ... def ascii_decode(__data: ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ... diff --git a/stdlib/_decimal.pyi b/stdlib/_decimal.pyi index c0e6c9882181..5176f4cde9ba 100644 --- a/stdlib/_decimal.pyi +++ b/stdlib/_decimal.pyi @@ -66,7 +66,7 @@ if sys.version_info >= (3, 11): ) -> _ContextManager: ... else: - def localcontext(ctx: Context | None = ...) -> _ContextManager: ... + def localcontext(ctx: Context | None = None) -> _ContextManager: ... class Decimal: def __new__(cls: type[Self], value: _DecimalNew = ..., context: Context | None = ...) -> Self: ... diff --git a/stdlib/_dummy_thread.pyi b/stdlib/_dummy_thread.pyi index ff16b1d3dcf4..e371dd0e9933 100644 --- a/stdlib/_dummy_thread.pyi +++ b/stdlib/_dummy_thread.pyi @@ -11,12 +11,12 @@ def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwa def exit() -> NoReturn: ... def get_ident() -> int: ... def allocate_lock() -> LockType: ... -def stack_size(size: int | None = ...) -> int: ... +def stack_size(size: int | None = None) -> int: ... class LockType: locked_status: bool - def acquire(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ... - def __enter__(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ... + def acquire(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... + def __enter__(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... def release(self) -> bool: ... def locked(self) -> bool: ... diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index 8f7f5a9b994c..9a49dfa9649e 100644 --- a/stdlib/_dummy_threading.pyi +++ b/stdlib/_dummy_threading.pyi @@ -41,7 +41,7 @@ def enumerate() -> list[Thread]: ... def main_thread() -> Thread: ... def settrace(func: TraceFunction) -> None: ... def setprofile(func: ProfileFunction | None) -> None: ... -def stack_size(size: int = ...) -> int: ... +def stack_size(size: int | None = None) -> int: ... TIMEOUT_MAX: float @@ -59,17 +59,17 @@ class Thread: def ident(self) -> int | None: ... def __init__( self, - group: None = ..., - target: Callable[..., object] | None = ..., - name: str | None = ..., + group: None = None, + target: Callable[..., object] | None = None, + name: str | None = None, args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] | None = ..., + kwargs: Mapping[str, Any] | None = None, *, - daemon: bool | None = ..., + daemon: bool | None = None, ) -> None: ... def start(self) -> None: ... def run(self) -> None: ... - def join(self, timeout: float | None = ...) -> None: ... + def join(self, timeout: float | None = None) -> None: ... def getName(self) -> str: ... def setName(self, name: str) -> None: ... if sys.version_info >= (3, 8): @@ -99,32 +99,32 @@ class _RLock: def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... RLock = _RLock class Condition: - def __init__(self, lock: Lock | _RLock | None = ...) -> None: ... + def __init__(self, lock: Lock | _RLock | None = None) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... def release(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... - def wait_for(self, predicate: Callable[[], _T], timeout: float | None = ...) -> _T: ... - def notify(self, n: int = ...) -> None: ... + def wait(self, timeout: float | None = None) -> bool: ... + def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ... + def notify(self, n: int = 1) -> None: ... def notify_all(self) -> None: ... def notifyAll(self) -> None: ... class Semaphore: - def __init__(self, value: int = ...) -> None: ... + def __init__(self, value: int = 1) -> None: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... - def __enter__(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... + def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 9): def release(self, n: int = ...) -> None: ... else: @@ -136,7 +136,7 @@ class Event: def is_set(self) -> bool: ... def set(self) -> None: ... def clear(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 8): from _thread import _excepthook, _ExceptHookArgs @@ -149,8 +149,8 @@ class Timer(Thread): self, interval: float, function: Callable[..., object], - args: Iterable[Any] | None = ..., - kwargs: Mapping[str, Any] | None = ..., + args: Iterable[Any] | None = None, + kwargs: Mapping[str, Any] | None = None, ) -> None: ... def cancel(self) -> None: ... @@ -161,8 +161,8 @@ class Barrier: def n_waiting(self) -> int: ... @property def broken(self) -> bool: ... - def __init__(self, parties: int, action: Callable[[], None] | None = ..., timeout: float | None = ...) -> None: ... - def wait(self, timeout: float | None = ...) -> int: ... + def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ... + def wait(self, timeout: float | None = None) -> int: ... def reset(self) -> None: ... def abort(self) -> None: ... diff --git a/stdlib/_warnings.pyi b/stdlib/_warnings.pyi index 2eb9ae478a5d..0981dfeaafee 100644 --- a/stdlib/_warnings.pyi +++ b/stdlib/_warnings.pyi @@ -5,9 +5,9 @@ _onceregistry: dict[Any, Any] filters: list[tuple[str, str | None, type[Warning], str | None, int]] @overload -def warn(message: str, category: type[Warning] | None = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ... +def warn(message: str, category: type[Warning] | None = None, stacklevel: int = 1, source: Any | None = None) -> None: ... @overload -def warn(message: Warning, category: Any = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ... +def warn(message: Warning, category: Any = None, stacklevel: int = 1, source: Any | None = None) -> None: ... @overload def warn_explicit( message: str, diff --git a/stdlib/_weakrefset.pyi b/stdlib/_weakrefset.pyi index da09442e855b..fdf26641bbeb 100644 --- a/stdlib/_weakrefset.pyi +++ b/stdlib/_weakrefset.pyi @@ -13,7 +13,7 @@ _T = TypeVar("_T") class WeakSet(MutableSet[_T], Generic[_T]): @overload - def __init__(self, data: None = ...) -> None: ... + def __init__(self, data: None = None) -> None: ... @overload def __init__(self, data: Iterable[_T]) -> None: ... def add(self, item: _T) -> None: ... diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index 4fbefc33abb1..fc56cadf0967 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -128,7 +128,7 @@ if sys.platform == "win32": @overload def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ... @overload - def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ... + def ConnectNamedPipe(handle: int, overlapped: Literal[False] = False) -> None: ... @overload def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ... def CreateFile( @@ -189,7 +189,7 @@ if sys.platform == "win32": @overload def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... @overload - def ReadFile(handle: int, size: int, overlapped: Literal[False] = ...) -> tuple[bytes, int]: ... + def ReadFile(handle: int, size: int, overlapped: Literal[False] = False) -> tuple[bytes, int]: ... @overload def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ... def SetNamedPipeHandleState( @@ -202,7 +202,7 @@ if sys.platform == "win32": @overload def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... @overload - def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = ...) -> tuple[int, int]: ... + def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = False) -> tuple[int, int]: ... @overload def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ... @final diff --git a/stdlib/aifc.pyi b/stdlib/aifc.pyi index 14e824f3d22e..ad126d6cdbef 100644 --- a/stdlib/aifc.pyi +++ b/stdlib/aifc.pyi @@ -81,7 +81,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): @overload @@ -89,4 +89,4 @@ if sys.version_info < (3, 9): @overload def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload - def openfp(f: _File, mode: str | None = ...) -> Any: ... + def openfp(f: _File, mode: str | None = None) -> Any: ... diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index 01a3f01b9751..20d9dfa9d137 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -148,23 +148,23 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): else: def __init__( self, - prog: str | None = ..., - usage: str | None = ..., - description: str | None = ..., - epilog: str | None = ..., + prog: str | None = None, + usage: str | None = None, + description: str | None = None, + epilog: str | None = None, parents: Sequence[ArgumentParser] = ..., formatter_class: _FormatterClass = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: str | None = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ..., + prefix_chars: str = "-", + fromfile_prefix_chars: str | None = None, + argument_default: Any = None, + conflict_handler: str = "error", + add_help: bool = True, + allow_abbrev: bool = True, ) -> None: ... # The type-ignores in these overloads should be temporary. See: # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 @overload - def parse_args(self, args: Sequence[str] | None = ...) -> Namespace: ... + def parse_args(self, args: Sequence[str] | None = None) -> Namespace: ... @overload def parse_args(self, args: Sequence[str] | None, namespace: None) -> Namespace: ... # type: ignore[misc] @overload @@ -378,10 +378,10 @@ class _StoreConstAction(Action): option_strings: Sequence[str], dest: str, const: Any, - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... # undocumented @@ -422,10 +422,10 @@ class _AppendConstAction(Action): option_strings: Sequence[str], dest: str, const: Any, - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... # undocumented diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index ad14c643fe9e..ea899e150f97 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -174,11 +174,11 @@ if sys.version_info >= (3, 8): @overload def parse( source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = ..., - mode: Literal["exec"] = ..., + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: Literal["exec"] = "exec", *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Module: ... @overload def parse( @@ -186,8 +186,8 @@ if sys.version_info >= (3, 8): filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["eval"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Expression: ... @overload def parse( @@ -195,8 +195,8 @@ if sys.version_info >= (3, 8): filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["func_type"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> FunctionType: ... @overload def parse( @@ -204,47 +204,49 @@ if sys.version_info >= (3, 8): filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["single"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Interactive: ... @overload def parse( source: str | ReadableBuffer, *, mode: Literal["eval"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Expression: ... @overload def parse( source: str | ReadableBuffer, *, mode: Literal["func_type"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> FunctionType: ... @overload def parse( source: str | ReadableBuffer, *, mode: Literal["single"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Interactive: ... @overload def parse( source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = ..., - mode: str = ..., + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: str = "exec", *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> AST: ... else: @overload def parse( - source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = ..., mode: Literal["exec"] = ... + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: Literal["exec"] = "exec", ) -> Module: ... @overload def parse( @@ -259,7 +261,9 @@ else: @overload def parse(source: str | ReadableBuffer, *, mode: Literal["single"]) -> Interactive: ... @overload - def parse(source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = ..., mode: str = ...) -> AST: ... + def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = "", mode: str = "exec" + ) -> AST: ... if sys.version_info >= (3, 9): def unparse(ast_obj: AST) -> str: ... @@ -272,7 +276,7 @@ if sys.version_info >= (3, 9): ) -> str: ... else: - def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... + def dump(node: AST, annotate_fields: bool = True, include_attributes: bool = False) -> str: ... def fix_missing_locations(node: _T) -> _T: ... def get_docstring(node: AsyncFunctionDef | FunctionDef | ClassDef | Module, clean: bool = True) -> str | None: ... diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 8af829d4f4a9..3b8f286710b9 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -90,7 +90,7 @@ class BaseEventLoop(AbstractEventLoop): self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None, context: Context | None = None ) -> Task[_T]: ... elif sys.version_info >= (3, 8): - def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = ...) -> Task[_T]: ... + def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None) -> Task[_T]: ... else: def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T]) -> Task[_T]: ... @@ -120,36 +120,36 @@ class BaseEventLoop(AbstractEventLoop): host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 8): @overload @@ -159,34 +159,34 @@ class BaseEventLoop(AbstractEventLoop): host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... else: @overload @@ -196,67 +196,67 @@ class BaseEventLoop(AbstractEventLoop): host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... async def start_tls( self, @@ -283,35 +283,35 @@ class BaseEventLoop(AbstractEventLoop): async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... async def start_tls( self, @@ -319,17 +319,17 @@ class BaseEventLoop(AbstractEventLoop): protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> Transport: ... async def connect_accepted_socket( self, protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... async def sock_sendfile( @@ -356,16 +356,16 @@ class BaseEventLoop(AbstractEventLoop): async def create_datagram_endpoint( self, protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | str | None = ..., - remote_addr: tuple[str, int] | str | None = ..., + local_addr: tuple[str, int] | str | None = None, + remote_addr: tuple[str, int] | str | None = None, *, - family: int = ..., - proto: int = ..., - flags: int = ..., + family: int = 0, + proto: int = 0, + flags: int = 0, reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - allow_broadcast: bool | None = ..., - sock: socket | None = ..., + reuse_port: bool | None = None, + allow_broadcast: bool | None = None, + sock: socket | None = None, ) -> tuple[DatagramTransport, _ProtocolT]: ... # Pipes and subprocesses. async def connect_read_pipe( diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index aa209828161e..b2292801ee0d 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -167,7 +167,7 @@ class AbstractEventLoop: elif sys.version_info >= (3, 8): @abstractmethod def create_task( - self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: str | None = ... + self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: str | None = None ) -> Task[_T]: ... else: @abstractmethod @@ -212,37 +212,37 @@ class AbstractEventLoop: host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 8): @overload @@ -253,35 +253,35 @@ class AbstractEventLoop: host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... else: @overload @@ -292,31 +292,31 @@ class AbstractEventLoop: host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): @overload @@ -324,38 +324,38 @@ class AbstractEventLoop: async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @abstractmethod async def start_tls( @@ -387,36 +387,36 @@ class AbstractEventLoop: async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., + host: str | Sequence[str] | None = None, port: int = ..., *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @abstractmethod async def start_tls( @@ -425,20 +425,20 @@ class AbstractEventLoop: protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> Transport: ... async def create_unix_server( self, protocol_factory: _ProtocolFactory, - path: StrPath | None = ..., + path: StrPath | None = None, *, - sock: socket | None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket | None = None, + backlog: int = 100, + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... if sys.version_info >= (3, 11): async def connect_accepted_socket( @@ -456,8 +456,8 @@ class AbstractEventLoop: protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): async def create_unix_connection( @@ -475,12 +475,12 @@ class AbstractEventLoop: async def create_unix_connection( self, protocol_factory: Callable[[], _ProtocolT], - path: str | None = ..., + path: str | None = None, *, - ssl: _SSLContext = ..., - sock: socket | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + sock: socket | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... @abstractmethod diff --git a/stdlib/asyncio/futures.pyi b/stdlib/asyncio/futures.pyi index 9ae1fe6bd50e..f325272d2403 100644 --- a/stdlib/asyncio/futures.pyi +++ b/stdlib/asyncio/futures.pyi @@ -44,7 +44,7 @@ class Future(Awaitable[_T], Iterable[_T]): def get_loop(self) -> AbstractEventLoop: ... @property def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ... - def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ... + def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = None) -> None: ... if sys.version_info >= (3, 9): def cancel(self, msg: Any | None = None) -> bool: ... else: diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index 76aad7be2d46..3e348e8c35e0 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -69,7 +69,7 @@ class Condition(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, lock: Lock | None = None) -> None: ... else: - def __init__(self, lock: Lock | None = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -85,7 +85,7 @@ class Semaphore(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, value: int = 1) -> None: ... else: - def __init__(self, value: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... diff --git a/stdlib/asyncio/proactor_events.pyi b/stdlib/asyncio/proactor_events.pyi index 7fa1af0ca457..9d582684a261 100644 --- a/stdlib/asyncio/proactor_events.pyi +++ b/stdlib/asyncio/proactor_events.pyi @@ -47,9 +47,9 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTran loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = ..., - extra: Mapping[Any, Any] | None = ..., - server: events.AbstractServer | None = ..., + waiter: futures.Future[Any] | None = None, + extra: Mapping[Any, Any] | None = None, + server: events.AbstractServer | None = None, ) -> None: ... class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): ... diff --git a/stdlib/asyncio/queues.pyi b/stdlib/asyncio/queues.pyi index 6c64f6aa4dc2..76273be7588c 100644 --- a/stdlib/asyncio/queues.pyi +++ b/stdlib/asyncio/queues.pyi @@ -16,7 +16,7 @@ class Queue(Generic[_T]): if sys.version_info >= (3, 11): def __init__(self, maxsize: int = 0) -> None: ... else: - def __init__(self, maxsize: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = ...) -> None: ... def _init(self, maxsize: int) -> None: ... def _get(self) -> _T: ... diff --git a/stdlib/asyncio/runners.pyi b/stdlib/asyncio/runners.pyi index e85d291a7382..484f9eb831a1 100644 --- a/stdlib/asyncio/runners.pyi +++ b/stdlib/asyncio/runners.pyi @@ -32,4 +32,4 @@ elif sys.version_info >= (3, 8): def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = None) -> _T: ... else: - def run(main: Coroutine[Any, Any, _T], *, debug: bool = ...) -> _T: ... + def run(main: Coroutine[Any, Any, _T], *, debug: bool = False) -> _T: ... diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index cf4761745c8a..b6cf4918b5a3 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -48,7 +48,7 @@ if sys.version_info < (3, 11): _need_ssldata: bool _handshake_cb: Callable[[BaseException | None], None] | None _shutdown_cb: Callable[[], None] | None - def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = ...) -> None: ... + def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = None) -> None: ... @property def context(self) -> ssl.SSLContext: ... @property @@ -57,11 +57,11 @@ if sys.version_info < (3, 11): def need_ssldata(self) -> bool: ... @property def wrapped(self) -> bool: ... - def do_handshake(self, callback: Callable[[BaseException | None], object] | None = ...) -> list[bytes]: ... - def shutdown(self, callback: Callable[[], object] | None = ...) -> list[bytes]: ... + def do_handshake(self, callback: Callable[[BaseException | None], object] | None = None) -> list[bytes]: ... + def shutdown(self, callback: Callable[[], object] | None = None) -> list[bytes]: ... def feed_eof(self) -> None: ... - def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> tuple[list[bytes], list[bytes]]: ... - def feed_appdata(self, data: bytes, offset: int = ...) -> tuple[list[bytes], int]: ... + def feed_ssldata(self, data: bytes, only_handshake: bool = False) -> tuple[list[bytes], list[bytes]]: ... + def feed_appdata(self, data: bytes, offset: int = 0) -> tuple[list[bytes], int]: ... class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): @@ -131,10 +131,10 @@ class SSLProtocol(_SSLProtocolBase): app_protocol: protocols.BaseProtocol, sslcontext: ssl.SSLContext, waiter: futures.Future[Any], - server_side: bool = ..., - server_hostname: str | None = ..., - call_connection_made: bool = ..., - ssl_handshake_timeout: int | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + call_connection_made: bool = True, + ssl_handshake_timeout: int | None = None, ) -> None: ... def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ... diff --git a/stdlib/asyncio/streams.pyi b/stdlib/asyncio/streams.pyi index 091ad521bd2f..c09c1027eea8 100644 --- a/stdlib/asyncio/streams.pyi +++ b/stdlib/asyncio/streams.pyi @@ -78,21 +78,21 @@ if sys.version_info >= (3, 10): else: async def open_connection( - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> tuple[StreamReader, StreamWriter]: ... async def start_server( client_connected_cb: _ClientConnectedCallback, - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> Server: ... diff --git a/stdlib/asyncio/subprocess.pyi b/stdlib/asyncio/subprocess.pyi index 15487c3befc5..b112a9d80a32 100644 --- a/stdlib/asyncio/subprocess.pyi +++ b/stdlib/asyncio/subprocess.pyi @@ -109,10 +109,10 @@ if sys.version_info >= (3, 11): elif sys.version_info >= (3, 10): async def create_subprocess_shell( cmd: str | bytes, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell universal_newlines: Literal[False] = ..., @@ -141,10 +141,10 @@ elif sys.version_info >= (3, 10): async def create_subprocess_exec( program: _ExecArg, *args: _ExecArg, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell universal_newlines: Literal[False] = ..., shell: Literal[True] = ..., @@ -173,11 +173,11 @@ elif sys.version_info >= (3, 10): else: # >= 3.9 async def create_subprocess_shell( cmd: str | bytes, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell universal_newlines: Literal[False] = ..., @@ -205,11 +205,11 @@ else: # >= 3.9 async def create_subprocess_exec( program: _ExecArg, *args: _ExecArg, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell universal_newlines: Literal[False] = ..., shell: Literal[True] = ..., diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 76bc4e2a29e0..0a44255a3ac8 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -55,13 +55,13 @@ if sys.version_info >= (3, 10): else: def as_completed( - fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ... + fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = None, timeout: float | None = None ) -> Iterator[Future[_T]]: ... @overload -def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = ...) -> _FT: ... # type: ignore[misc] +def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = None) -> _FT: ... # type: ignore[misc] @overload -def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = ...) -> Task[_T]: ... +def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = None) -> Task[_T]: ... # `gather()` actually returns a list with length equal to the number # of tasks passed; however, Tuple is used similar to the annotation for @@ -72,10 +72,10 @@ def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | No # but having overlapping overloads is the only way to get acceptable type inference in all edge cases. if sys.version_info >= (3, 10): @overload - def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = ...) -> Future[tuple[_T1]]: ... # type: ignore[misc] + def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = False) -> Future[tuple[_T1]]: ... # type: ignore[misc] @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = ... + __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = False ) -> Future[tuple[_T1, _T2]]: ... @overload def gather( # type: ignore[misc] @@ -83,7 +83,7 @@ if sys.version_info >= (3, 10): __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3]]: ... @overload def gather( # type: ignore[misc] @@ -92,7 +92,7 @@ if sys.version_info >= (3, 10): __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... @overload def gather( # type: ignore[misc] @@ -102,7 +102,7 @@ if sys.version_info >= (3, 10): __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[misc] @@ -140,20 +140,20 @@ if sys.version_info >= (3, 10): tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload - def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = ...) -> Future[list[Any]]: ... # type: ignore[misc] + def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = False) -> Future[list[Any]]: ... # type: ignore[misc] else: @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: Literal[False] = ... + __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False ) -> Future[tuple[_T1]]: ... @overload def gather( # type: ignore[misc] __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2]]: ... @overload def gather( # type: ignore[misc] @@ -161,8 +161,8 @@ else: __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3]]: ... @overload def gather( # type: ignore[misc] @@ -171,8 +171,8 @@ else: __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... @overload def gather( # type: ignore[misc] @@ -182,19 +182,19 @@ else: __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: bool + __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: bool ) -> Future[tuple[_T1 | BaseException]]: ... @overload def gather( # type: ignore[misc] __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ... @overload @@ -203,7 +203,7 @@ else: __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ... @overload @@ -213,7 +213,7 @@ else: __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ... @overload @@ -224,14 +224,14 @@ else: __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[ tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload def gather( # type: ignore[misc] - *coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = ..., return_exceptions: bool = ... + *coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = None, return_exceptions: bool = False ) -> Future[list[Any]]: ... def run_coroutine_threadsafe(coro: _FutureLike[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... @@ -243,28 +243,36 @@ if sys.version_info >= (3, 10): @overload async def sleep(delay: float, result: _T) -> _T: ... @overload - async def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] + async def wait(fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED") -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] @overload async def wait( - fs: Iterable[Awaitable[_T]], *, timeout: float | None = ..., return_when: str = ... + fs: Iterable[Awaitable[_T]], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... async def wait_for(fut: _FutureLike[_T], timeout: float | None) -> _T: ... else: - def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ... + def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ... @overload - async def sleep(delay: float, *, loop: AbstractEventLoop | None = ...) -> None: ... + async def sleep(delay: float, *, loop: AbstractEventLoop | None = None) -> None: ... @overload - async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = ...) -> _T: ... + async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = None) -> _T: ... @overload async def wait( # type: ignore[misc] - fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ... + fs: Iterable[_FT], + *, + loop: AbstractEventLoop | None = None, + timeout: float | None = None, + return_when: str = "ALL_COMPLETED", ) -> tuple[set[_FT], set[_FT]]: ... @overload async def wait( - fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ... + fs: Iterable[Awaitable[_T]], + *, + loop: AbstractEventLoop | None = None, + timeout: float | None = None, + return_when: str = "ALL_COMPLETED", ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... - async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> _T: ... + async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = None) -> _T: ... # mypy and pyright complain that a subclass of an invariant class shouldn't be covariant. # While this is true in general, here it's sort-of okay to have a covariant subclass, @@ -295,9 +303,9 @@ class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] # pyright: def uncancel(self) -> int: ... if sys.version_info < (3, 9): @classmethod - def current_task(cls, loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ... + def current_task(cls, loop: AbstractEventLoop | None = None) -> Task[Any] | None: ... @classmethod - def all_tasks(cls, loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ... + def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... @@ -309,7 +317,7 @@ if sys.version_info >= (3, 11): ) -> Task[_T]: ... elif sys.version_info >= (3, 8): - def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ...) -> Task[_T]: ... + def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None) -> Task[_T]: ... else: def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T]) -> Task[_T]: ... diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index dca06ea33b13..8c554f0d0314 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -33,7 +33,7 @@ if sys.platform == "win32": class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... class ProactorEventLoop(proactor_events.BaseProactorEventLoop): - def __init__(self, proactor: IocpProactor | None = ...) -> None: ... + def __init__(self, proactor: IocpProactor | None = None) -> None: ... async def create_pipe_connection( self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str ) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... @@ -45,10 +45,10 @@ if sys.platform == "win32": def __init__(self, concurrency: int = ...) -> None: ... def __del__(self) -> None: ... def set_loop(self, loop: events.AbstractEventLoop) -> None: ... - def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ... - def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... - def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... - def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... + def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ... + def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ... + def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... + def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... def accept(self, listener: socket.socket) -> futures.Future[Any]: ... def connect( self, @@ -58,7 +58,7 @@ if sys.platform == "win32": def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ... - def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = ...) -> bool: ... + def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ... def close(self) -> None: ... SelectorEventLoop = _WindowsSelectorEventLoop diff --git a/stdlib/asyncio/windows_utils.pyi b/stdlib/asyncio/windows_utils.pyi index 6e170dcb073a..6ac4e0d89aa4 100644 --- a/stdlib/asyncio/windows_utils.pyi +++ b/stdlib/asyncio/windows_utils.pyi @@ -16,7 +16,7 @@ if sys.platform == "win32": BUFSIZE: Literal[8192] PIPE = subprocess.PIPE STDOUT = subprocess.STDOUT - def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ... + def pipe(*, duplex: bool = False, overlapped: tuple[bool, bool] = ..., bufsize: int = 8192) -> tuple[int, int]: ... class PipeHandle: def __init__(self, handle: int) -> None: ... @@ -51,8 +51,8 @@ if sys.platform == "win32": def __init__( self, args: subprocess._CMD, - stdin: subprocess._FILE | None = ..., - stdout: subprocess._FILE | None = ..., - stderr: subprocess._FILE | None = ..., + stdin: subprocess._FILE | None = None, + stdout: subprocess._FILE | None = None, + stderr: subprocess._FILE | None = None, **kwds: Any, ) -> None: ... diff --git a/stdlib/asyncore.pyi b/stdlib/asyncore.pyi index 667f50ad45c6..b287eb28e755 100644 --- a/stdlib/asyncore.pyi +++ b/stdlib/asyncore.pyi @@ -15,12 +15,12 @@ class ExitNow(Exception): ... def read(obj: Any) -> None: ... def write(obj: Any) -> None: ... def readwrite(obj: Any, flags: int) -> None: ... -def poll(timeout: float = ..., map: _MapType | None = None) -> None: ... -def poll2(timeout: float = ..., map: _MapType | None = None) -> None: ... +def poll(timeout: float = 0.0, map: _MapType | None = None) -> None: ... +def poll2(timeout: float = 0.0, map: _MapType | None = None) -> None: ... poll3 = poll2 -def loop(timeout: float = ..., use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ... +def loop(timeout: float = 30.0, use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ... # Not really subclass of socket.socket; it's only delegation. # It is not covariant to it. diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 9a1cfa407a1a..8a71c680399c 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -228,14 +228,14 @@ class int: signed: bool = False, ) -> Self: ... else: - def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ... + def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: ... @classmethod def from_bytes( cls: type[Self], bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer, byteorder: Literal["little", "big"], *, - signed: bool = ..., + signed: bool = False, ) -> Self: ... def __add__(self, __x: int) -> int: ... @@ -432,14 +432,14 @@ class str(Sequence[str]): ) -> bool: ... if sys.version_info >= (3, 8): @overload - def expandtabs(self: LiteralString, tabsize: SupportsIndex = ...) -> LiteralString: ... + def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ... @overload - def expandtabs(self, tabsize: SupportsIndex = ...) -> str: ... # type: ignore[misc] + def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc] else: @overload - def expandtabs(self: LiteralString, tabsize: int = ...) -> LiteralString: ... + def expandtabs(self: LiteralString, tabsize: int = 8) -> LiteralString: ... @overload - def expandtabs(self, tabsize: int = ...) -> str: ... # type: ignore[misc] + def expandtabs(self, tabsize: int = 8) -> str: ... # type: ignore[misc] def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... @overload @@ -507,21 +507,21 @@ class str(Sequence[str]): @overload def rpartition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc] @overload - def rsplit(self: LiteralString, sep: LiteralString | None = ..., maxsplit: SupportsIndex = ...) -> list[LiteralString]: ... + def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... @overload - def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ... # type: ignore[misc] + def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] @overload def rstrip(self: LiteralString, __chars: LiteralString | None = ...) -> LiteralString: ... @overload def rstrip(self, __chars: str | None = ...) -> str: ... # type: ignore[misc] @overload - def split(self: LiteralString, sep: LiteralString | None = ..., maxsplit: SupportsIndex = ...) -> list[LiteralString]: ... + def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... @overload - def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ... # type: ignore[misc] + def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] @overload - def splitlines(self: LiteralString, keepends: bool = ...) -> list[LiteralString]: ... + def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: ... @overload - def splitlines(self, keepends: bool = ...) -> list[str]: ... # type: ignore[misc] + def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc] def startswith( self, __prefix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> bool: ... @@ -551,7 +551,10 @@ class str(Sequence[str]): def maketrans(__x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... @staticmethod @overload - def maketrans(__x: str, __y: str, __z: str | None = ...) -> dict[int, int | None]: ... + def maketrans(__x: str, __y: str) -> dict[int, int]: ... + @staticmethod + @overload + def maketrans(__x: str, __y: str, __z: str) -> dict[int, int | None]: ... @overload def __add__(self: LiteralString, __s: LiteralString) -> LiteralString: ... @overload @@ -847,7 +850,7 @@ class memoryview(Sequence[int]): @overload def __setitem__(self, __i: SupportsIndex, __o: SupportsIndex) -> None: ... if sys.version_info >= (3, 8): - def tobytes(self, order: Literal["C", "F", "A"] | None = "C") -> bytes: ... + def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ... else: def tobytes(self) -> bytes: ... @@ -976,9 +979,9 @@ class list(MutableSequence[_T], Generic[_T]): # Use list[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload - def sort(self: list[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: list[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: ... @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... + def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] @@ -1481,13 +1484,13 @@ _Opener: TypeAlias = Callable[[str, int], int] @overload def open( file: FileDescriptorOrPath, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + mode: OpenTextMode = "r", + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> TextIOWrapper: ... # Unbuffered binary mode: returns a FileIO @@ -1496,11 +1499,11 @@ def open( file: FileDescriptorOrPath, mode: OpenBinaryMode, buffering: Literal[0], - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @@ -1508,34 +1511,34 @@ def open( def open( file: FileDescriptorOrPath, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedRandom: ... @overload def open( file: FileDescriptorOrPath, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedWriter: ... @overload def open( file: FileDescriptorOrPath, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @@ -1543,12 +1546,12 @@ def open( def open( file: FileDescriptorOrPath, mode: OpenBinaryMode, - buffering: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: int = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BinaryIO: ... # Fallback if mode is not specified @@ -1556,12 +1559,12 @@ def open( def open( file: FileDescriptorOrPath, mode: str, - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> IO[Any]: ... def ord(__c: str | bytes | bytearray) -> int: ... @@ -1571,14 +1574,14 @@ class _SupportsWriteAndFlush(SupportsWrite[_T_contra], Protocol[_T_contra]): @overload def print( *values: object, - sep: str | None = ..., - end: str | None = ..., - file: SupportsWrite[str] | None = ..., - flush: Literal[False] = ..., + sep: str | None = " ", + end: str | None = "\n", + file: SupportsWrite[str] | None = None, + flush: Literal[False] = False, ) -> None: ... @overload def print( - *values: object, sep: str | None = ..., end: str | None = ..., file: _SupportsWriteAndFlush[str] | None = ..., flush: bool + *values: object, sep: str | None = " ", end: str | None = "\n", file: _SupportsWriteAndFlush[str] | None = None, flush: bool ) -> None: ... _E = TypeVar("_E", contravariant=True) @@ -1603,38 +1606,38 @@ if sys.version_info >= (3, 8): @overload def pow(base: int, exp: int, mod: int) -> int: ... @overload - def pow(base: int, exp: Literal[0], mod: None = ...) -> Literal[1]: ... # type: ignore[misc] + def pow(base: int, exp: Literal[0], mod: None = None) -> Literal[1]: ... # type: ignore[misc] @overload - def pow(base: int, exp: _PositiveInteger, mod: None = ...) -> int: ... # type: ignore[misc] + def pow(base: int, exp: _PositiveInteger, mod: None = None) -> int: ... # type: ignore[misc] @overload - def pow(base: int, exp: _NegativeInteger, mod: None = ...) -> float: ... # type: ignore[misc] + def pow(base: int, exp: _NegativeInteger, mod: None = None) -> float: ... # type: ignore[misc] # int base & positive-int exp -> int; int base & negative-int exp -> float # return type must be Any as `int | float` causes too many false-positive errors @overload - def pow(base: int, exp: int, mod: None = ...) -> Any: ... + def pow(base: int, exp: int, mod: None = None) -> Any: ... @overload - def pow(base: _PositiveInteger, exp: float, mod: None = ...) -> float: ... + def pow(base: _PositiveInteger, exp: float, mod: None = None) -> float: ... @overload - def pow(base: _NegativeInteger, exp: float, mod: None = ...) -> complex: ... + def pow(base: _NegativeInteger, exp: float, mod: None = None) -> complex: ... @overload - def pow(base: float, exp: int, mod: None = ...) -> float: ... + def pow(base: float, exp: int, mod: None = None) -> float: ... # float base & float exp could return float or complex # return type must be Any (same as complex base, complex exp), # as `float | complex` causes too many false-positive errors @overload - def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = ...) -> Any: ... + def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> Any: ... @overload - def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = ...) -> complex: ... + def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ... @overload - def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = ...) -> _T_co: ... + def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload - def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = ...) -> _T_co: ... + def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M = ...) -> _T_co: ... @overload - def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = ...) -> Any: ... + def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ... @overload - def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = ...) -> complex: ... + def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex: ... else: @overload @@ -1692,7 +1695,7 @@ class _SupportsRound2(Protocol[_T_co]): def __round__(self, __ndigits: int) -> _T_co: ... @overload -def round(number: _SupportsRound1[_T], ndigits: None = ...) -> _T: ... +def round(number: _SupportsRound1[_T], ndigits: None = None) -> _T: ... @overload def round(number: _SupportsRound2[_T], ndigits: SupportsIndex) -> _T: ... @@ -1701,10 +1704,10 @@ def round(number: _SupportsRound2[_T], ndigits: SupportsIndex) -> _T: ... def setattr(__obj: object, __name: str, __value: Any) -> None: ... @overload def sorted( - __iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ... + __iterable: Iterable[SupportsRichComparisonT], *, key: None = None, reverse: bool = False ) -> list[SupportsRichComparisonT]: ... @overload -def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> list[_T]: ... +def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> list[_T]: ... _AddableT1 = TypeVar("_AddableT1", bound=SupportsAdd[Any, Any]) _AddableT2 = TypeVar("_AddableT2", bound=SupportsAdd[Any, Any]) @@ -1719,7 +1722,7 @@ _SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWit # Instead, we special-case the most common examples of this: bool and literal integers. if sys.version_info >= (3, 8): @overload - def sum(__iterable: Iterable[bool | _LiteralInteger], start: int = ...) -> int: ... # type: ignore[misc] + def sum(__iterable: Iterable[bool | _LiteralInteger], start: int = 0) -> int: ... # type: ignore[misc] else: @overload diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index 39ecc2927a2c..8a7151d9e456 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -30,94 +30,94 @@ _WriteTextMode: TypeAlias = Literal["wt", "xt", "at"] @overload def open( filename: _ReadableFileobj, - mode: _ReadBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode = "rb", + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: _ReadableFileobj, mode: _ReadTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: _WritableFileobj, mode: _WriteBinaryMode, - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: _WritableFileobj, mode: _WriteTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode | _WriteBinaryMode = "rb", + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: StrOrBytesPath, mode: _ReadTextMode | _WriteTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, mode: str, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BZ2File | TextIO: ... class BZ2File(BaseStream, IO[bytes]): def __enter__(self: Self) -> Self: ... if sys.version_info >= (3, 9): @overload - def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = ...) -> None: ... + def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = 9) -> None: ... @overload - def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = ..., *, compresslevel: int = ...) -> None: ... + def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", *, compresslevel: int = 9) -> None: ... @overload def __init__( - self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = ..., *, compresslevel: int = ... + self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = "r", *, compresslevel: int = 9 ) -> None: ... else: @overload def __init__( - self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = ..., compresslevel: int = ... + self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( - self, filename: _ReadableFileobj, mode: _ReadBinaryMode = ..., buffering: Any | None = ..., compresslevel: int = ... + self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = ..., - buffering: Any | None = ..., - compresslevel: int = ..., + mode: _ReadBinaryMode | _WriteBinaryMode = "r", + buffering: Any | None = None, + compresslevel: int = 9, ) -> None: ... def read(self, size: int | None = -1) -> bytes: ... diff --git a/stdlib/cgi.pyi b/stdlib/cgi.pyi index 76e7a348335c..4780969f042b 100644 --- a/stdlib/cgi.pyi +++ b/stdlib/cgi.pyi @@ -52,7 +52,7 @@ def print_directory() -> None: ... def print_environ_usage() -> None: ... if sys.version_info < (3, 8): - def escape(s: str, quote: bool | None = ...) -> str: ... + def escape(s: str, quote: bool | None = None) -> str: ... class MiniFieldStorage: # The first five "Any" attributes here are always None, but mypy doesn't support that diff --git a/stdlib/cmath.pyi b/stdlib/cmath.pyi index 30ada5d5b5ef..0a85600e99b7 100644 --- a/stdlib/cmath.pyi +++ b/stdlib/cmath.pyi @@ -27,7 +27,7 @@ def atanh(__z: _C) -> complex: ... def cos(__z: _C) -> complex: ... def cosh(__z: _C) -> complex: ... def exp(__z: _C) -> complex: ... -def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ... def isinf(__z: _C) -> bool: ... def isnan(__z: _C) -> bool: ... def log(__x: _C, __y_obj: _C = ...) -> complex: ... diff --git a/stdlib/codecs.pyi b/stdlib/codecs.pyi index 7eaf6b5091d4..7f852906c2d5 100644 --- a/stdlib/codecs.pyi +++ b/stdlib/codecs.pyi @@ -128,7 +128,7 @@ def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... def getreader(encoding: str) -> _StreamReader: ... def getwriter(encoding: str) -> _StreamWriter: ... def open( - filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1 + filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = ... ) -> StreamReaderWriter: ... def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ... def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ... diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 63380af3f5a6..2835e49df9e2 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -76,7 +76,7 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> UserDict[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> UserDict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, iterable: Iterable[_T], value: _S) -> UserDict[_T, _S]: ... @@ -92,7 +92,7 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): class UserList(MutableSequence[_T]): data: list[_T] @overload - def __init__(self, initlist: None = ...) -> None: ... + def __init__(self, initlist: None = None) -> None: ... @overload def __init__(self, initlist: Iterable[_T]) -> None: ... def __lt__(self, other: list[_T] | UserList[_T]) -> bool: ... @@ -163,18 +163,18 @@ class UserString(Sequence[UserString]): def capitalize(self: Self) -> Self: ... def casefold(self: Self) -> Self: ... def center(self: Self, width: int, *args: Any) -> Self: ... - def count(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ... + def count(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... if sys.version_info >= (3, 8): def encode(self: UserString, encoding: str | None = "utf-8", errors: str | None = "strict") -> bytes: ... else: - def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ... + def encode(self: Self, encoding: str | None = None, errors: str | None = None) -> Self: ... - def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = ...) -> bool: ... + def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... def expandtabs(self: Self, tabsize: int = 8) -> Self: ... - def find(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ... + def find(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... def format(self, *args: Any, **kwds: Any) -> str: ... def format_map(self, mapping: Mapping[str, Any]) -> str: ... - def index(self, sub: str, start: int = 0, end: int = ...) -> int: ... + def index(self, sub: str, start: int = 0, end: int = sys.maxsize) -> int: ... def isalpha(self) -> bool: ... def isalnum(self) -> bool: ... def isdecimal(self) -> bool: ... @@ -191,27 +191,22 @@ class UserString(Sequence[UserString]): def ljust(self: Self, width: int, *args: Any) -> Self: ... def lower(self: Self) -> Self: ... def lstrip(self: Self, chars: str | None = None) -> Self: ... - @staticmethod - @overload - def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ... + maketrans = str.maketrans def partition(self, sep: str) -> tuple[str, str, str]: ... if sys.version_info >= (3, 9): def removeprefix(self: Self, __prefix: str | UserString) -> Self: ... def removesuffix(self: Self, __suffix: str | UserString) -> Self: ... def replace(self: Self, old: str | UserString, new: str | UserString, maxsplit: int = -1) -> Self: ... - def rfind(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ... - def rindex(self, sub: str | UserString, start: int = 0, end: int = ...) -> int: ... + def rfind(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... + def rindex(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... def rjust(self: Self, width: int, *args: Any) -> Self: ... def rpartition(self, sep: str) -> tuple[str, str, str]: ... def rstrip(self: Self, chars: str | None = None) -> Self: ... def split(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... def rsplit(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... def splitlines(self, keepends: bool = False) -> list[str]: ... - def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = ...) -> bool: ... + def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... def strip(self: Self, chars: str | None = None) -> Self: ... def swapcase(self: Self) -> Self: ... def title(self: Self) -> Self: ... @@ -353,7 +348,7 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> OrderedDict[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> OrderedDict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, iterable: Iterable[_T], value: _S) -> OrderedDict[_T, _S]: ... diff --git a/stdlib/compileall.pyi b/stdlib/compileall.pyi index 613a2bc40987..7520c2f5b676 100644 --- a/stdlib/compileall.pyi +++ b/stdlib/compileall.pyi @@ -45,59 +45,59 @@ if sys.version_info >= (3, 10): elif sys.version_info >= (3, 9): def compile_dir( dir: StrPath, - maxlevels: int | None = ..., - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - workers: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int | None = None, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, *, - stripdir: str | None = ..., # https://bugs.python.org/issue40447 - prependdir: StrPath | None = ..., - limit_sl_dest: StrPath | None = ..., - hardlink_dupes: bool = ..., + stripdir: str | None = None, # https://bugs.python.org/issue40447 + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, ) -> int: ... def compile_file( fullname: StrPath, - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, *, - stripdir: str | None = ..., # https://bugs.python.org/issue40447 - prependdir: StrPath | None = ..., - limit_sl_dest: StrPath | None = ..., - hardlink_dupes: bool = ..., + stripdir: str | None = None, # https://bugs.python.org/issue40447 + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, ) -> int: ... else: def compile_dir( dir: StrPath, - maxlevels: int = ..., - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - workers: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int = 10, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... def compile_file( fullname: StrPath, - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... def compile_path( diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 4a044bc761a3..64084a884433 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -60,7 +60,7 @@ class Executor: if sys.version_info >= (3, 9): def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ... else: - def shutdown(self, wait: bool = ...) -> None: ... + def shutdown(self, wait: bool = True) -> None: ... def __enter__(self: Self) -> Self: ... def __exit__( diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index f3ce4e6d68b8..85af2e7f84c7 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -58,7 +58,7 @@ class _ResultItem: self, work_id: int, exception: Exception | None = None, result: Any | None = None, exit_pid: int | None = None ) -> None: ... else: - def __init__(self, work_id: int, exception: Exception | None = ..., result: Any | None = ...) -> None: ... + def __init__(self, work_id: int, exception: Exception | None = None, result: Any | None = None) -> None: ... class _CallItem: work_id: int @@ -83,7 +83,7 @@ class _SafeQueue(Queue[Future[Any]]): ) -> None: ... else: def __init__( - self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] + self, max_size: int | None = 0, *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] ) -> None: ... def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ... @@ -102,7 +102,7 @@ if sys.version_info >= (3, 11): else: def _sendback_result( - result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = ..., exception: Exception | None = ... + result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = None, exception: Exception | None = None ) -> None: ... if sys.version_info >= (3, 11): @@ -181,9 +181,9 @@ class ProcessPoolExecutor(Executor): else: def __init__( self, - max_workers: int | None = ..., - mp_context: BaseContext | None = ..., - initializer: Callable[..., object] | None = ..., + max_workers: int | None = None, + mp_context: BaseContext | None = None, + initializer: Callable[..., object] | None = None, initargs: tuple[Any, ...] = ..., ) -> None: ... if sys.version_info >= (3, 9): diff --git a/stdlib/configparser.pyi b/stdlib/configparser.pyi index 89dcaf18ce6e..1ab7977fae75 100644 --- a/stdlib/configparser.pyi +++ b/stdlib/configparser.pyi @@ -65,32 +65,32 @@ class RawConfigParser(_Parser): @overload def __init__( self, - defaults: Mapping[str, str | None] | None = ..., + defaults: Mapping[str, str | None] | None = None, dict_type: type[Mapping[str, str]] = ..., allow_no_value: Literal[True] = ..., *, delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Sequence[str] | None = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @overload def __init__( self, - defaults: _Section | None = ..., + defaults: _Section | None = None, dict_type: type[Mapping[str, str]] = ..., - allow_no_value: bool = ..., + allow_no_value: bool = False, *, delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Sequence[str] | None = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -114,22 +114,22 @@ class RawConfigParser(_Parser): # These get* methods are partially applied (with the same names) in # SectionProxy; the stubs should be kept updated together @overload - def getint(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> int: ... + def getint(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ... @overload def getint( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> int | _T: ... @overload - def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> float: ... + def getfloat(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ... @overload def getfloat( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> float | _T: ... @overload - def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> bool: ... + def getboolean(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ... @overload def getboolean( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> bool | _T: ... def _get_conv( self, @@ -143,13 +143,15 @@ class RawConfigParser(_Parser): ) -> _T: ... # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore[override] - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> str | Any: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str | Any: ... @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T) -> str | _T | Any: ... + def get( + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T + ) -> str | _T | Any: ... @overload - def items(self, *, raw: bool = ..., vars: _Section | None = ...) -> ItemsView[str, SectionProxy]: ... + def items(self, *, raw: bool = False, vars: _Section | None = None) -> ItemsView[str, SectionProxy]: ... @overload - def items(self, section: str, raw: bool = ..., vars: _Section | None = ...) -> list[tuple[str, str]]: ... + def items(self, section: str, raw: bool = False, vars: _Section | None = None) -> list[tuple[str, str]]: ... def set(self, section: str, option: str, value: str | None = None) -> None: ... def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = True) -> None: ... def remove_option(self, section: str, option: str) -> bool: ... @@ -159,9 +161,9 @@ class RawConfigParser(_Parser): class ConfigParser(RawConfigParser): # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore[override] - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> str: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str: ... @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T) -> str | _T: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T) -> str | _T: ... if sys.version_info < (3, 12): class SafeConfigParser(ConfigParser): ... # deprecated alias diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index bc32ce0ffac5..522285abbc72 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -174,7 +174,7 @@ if sys.version_info >= (3, 10): class nullcontext(AbstractContextManager[_T], AbstractAsyncContextManager[_T]): enter_result: _T @overload - def __init__(self: nullcontext[None], enter_result: None = ...) -> None: ... + def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... def __enter__(self) -> _T: ... @@ -186,7 +186,7 @@ else: class nullcontext(AbstractContextManager[_T]): enter_result: _T @overload - def __init__(self: nullcontext[None], enter_result: None = ...) -> None: ... + def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... def __enter__(self) -> _T: ... diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 5a72648a3d20..13b483b219d5 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -76,9 +76,9 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): self, f: Iterable[str], fieldnames: Sequence[_T], - restkey: str | None = ..., - restval: str | None = ..., - dialect: _DialectLike = ..., + restkey: str | None = None, + restval: str | None = None, + dialect: _DialectLike = "excel", *, delimiter: str = ..., quotechar: str | None = ..., @@ -93,10 +93,10 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): def __init__( self: DictReader[str], f: Iterable[str], - fieldnames: Sequence[str] | None = ..., - restkey: str | None = ..., - restval: str | None = ..., - dialect: _DialectLike = ..., + fieldnames: Sequence[str] | None = None, + restkey: str | None = None, + restval: str | None = None, + dialect: _DialectLike = "excel", *, delimiter: str = ..., quotechar: str | None = ..., diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index f3ffd3ec402e..f3ee2245ab6d 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -33,7 +33,12 @@ class CDLL: ) -> None: ... else: def __init__( - self, name: str | None, mode: int = ..., handle: int | None = ..., use_errno: bool = ..., use_last_error: bool = ... + self, + name: str | None, + mode: int = ..., + handle: int | None = None, + use_errno: bool = False, + use_last_error: bool = False, ) -> None: ... def __getattr__(self, name: str) -> _NamedFuncPointer: ... @@ -181,7 +186,7 @@ def sizeof(obj_or_type: _CData | type[_CData]) -> int: ... def string_at(address: _CVoidConstPLike, size: int = -1) -> bytes: ... if sys.platform == "win32": - def WinError(code: int | None = ..., descr: str | None = ...) -> OSError: ... + def WinError(code: int | None = None, descr: str | None = None) -> OSError: ... def wstring_at(address: _CVoidConstPLike, size: int = -1) -> str: ... diff --git a/stdlib/dataclasses.pyi b/stdlib/dataclasses.pyi index 4f50cad1f617..3b7327137ec5 100644 --- a/stdlib/dataclasses.pyi +++ b/stdlib/dataclasses.pyi @@ -3,8 +3,8 @@ import sys import types from builtins import type as Type # alias to avoid name clashes with fields named "type" from collections.abc import Callable, Iterable, Mapping -from typing import Any, Generic, Protocol, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing import Any, ClassVar, Generic, Protocol, TypeVar, overload +from typing_extensions import Literal, TypeAlias, TypeGuard if sys.version_info >= (3, 9): from types import GenericAlias @@ -30,6 +30,11 @@ __all__ = [ if sys.version_info >= (3, 10): __all__ += ["KW_ONLY"] +class _DataclassInstance(Protocol): + __dataclass_fields__: ClassVar[dict[str, Field[Any]]] + +_DataclassT = TypeVar("_DataclassT", bound=_DataclassInstance) + # define _MISSING_TYPE as an enum within the type stubs, # even though that is not really its type at runtime # this allows us to use Literal[_MISSING_TYPE.MISSING] @@ -44,13 +49,13 @@ if sys.version_info >= (3, 10): class KW_ONLY: ... @overload -def asdict(obj: Any) -> dict[str, Any]: ... +def asdict(obj: _DataclassInstance) -> dict[str, Any]: ... @overload -def asdict(obj: Any, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ... +def asdict(obj: _DataclassInstance, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ... @overload -def astuple(obj: Any) -> tuple[Any, ...]: ... +def astuple(obj: _DataclassInstance) -> tuple[Any, ...]: ... @overload -def astuple(obj: Any, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ... +def astuple(obj: _DataclassInstance, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ... if sys.version_info >= (3, 8): # cls argument is now positional-only @@ -69,37 +74,43 @@ if sys.version_info >= (3, 11): @overload def dataclass( *, - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., - weakref_slot: bool = ..., + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, + weakref_slot: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... elif sys.version_info >= (3, 10): @overload def dataclass( *, - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... else: @overload def dataclass( - *, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ..., frozen: bool = ... + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... # See https://github.com/python/mypy/issues/10750 @@ -152,32 +163,32 @@ if sys.version_info >= (3, 10): def field( *, default: _T, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> _T: ... @overload def field( *, default_factory: Callable[[], _T], - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> _T: ... @overload def field( *, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> Any: ... @@ -186,34 +197,39 @@ else: def field( *, default: _T, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> _T: ... @overload def field( *, default_factory: Callable[[], _T], - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> _T: ... @overload def field( *, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> Any: ... -def fields(class_or_instance: Any) -> tuple[Field[Any], ...]: ... -def is_dataclass(obj: Any) -> bool: ... +def fields(class_or_instance: _DataclassInstance | type[_DataclassInstance]) -> tuple[Field[Any], ...]: ... +@overload +def is_dataclass(obj: _DataclassInstance | type[_DataclassInstance]) -> Literal[True]: ... +@overload +def is_dataclass(obj: type) -> TypeGuard[type[_DataclassInstance]]: ... +@overload +def is_dataclass(obj: object) -> TypeGuard[_DataclassInstance | type[_DataclassInstance]]: ... class FrozenInstanceError(AttributeError): ... @@ -258,16 +274,16 @@ elif sys.version_info >= (3, 10): fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, ) -> type: ... else: @@ -276,13 +292,13 @@ else: fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, ) -> type: ... -def replace(__obj: _T, **changes: Any) -> _T: ... +def replace(__obj: _DataclassT, **changes: Any) -> _DataclassT: ... diff --git a/stdlib/datetime.pyi b/stdlib/datetime.pyi index d9ef2dbd236e..377ef0067485 100644 --- a/stdlib/datetime.pyi +++ b/stdlib/datetime.pyi @@ -265,7 +265,7 @@ class datetime(date): else: @overload @classmethod - def now(cls: type[Self], tz: None = ...) -> Self: ... + def now(cls: type[Self], tz: None = None) -> Self: ... @overload @classmethod def now(cls, tz: _TzInfo) -> datetime: ... diff --git a/stdlib/difflib.pyi b/stdlib/difflib.pyi index 9e7aeb40021f..b8efcafa31b9 100644 --- a/stdlib/difflib.pyi +++ b/stdlib/difflib.pyi @@ -29,16 +29,16 @@ class Match(NamedTuple): class SequenceMatcher(Generic[_T]): @overload - def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = ...) -> None: ... + def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... @overload - def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = ...) -> None: ... + def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... @overload def __init__( self: SequenceMatcher[str], - isjunk: Callable[[str], bool] | None = ..., - a: Sequence[str] = ..., - b: Sequence[str] = ..., - autojunk: bool = ..., + isjunk: Callable[[str], bool] | None = None, + a: Sequence[str] = "", + b: Sequence[str] = "", + autojunk: bool = True, ) -> None: ... def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... def set_seq1(self, a: Sequence[_T]) -> None: ... @@ -59,10 +59,10 @@ class SequenceMatcher(Generic[_T]): # mypy thinks the signatures of the overloads overlap, but the types still work fine @overload -def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...) -> list[AnyStr]: ... # type: ignore[misc] +def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ... # type: ignore[misc] @overload def get_close_matches( - word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ... + word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = 3, cutoff: float = 0.6 ) -> list[Sequence[_T]]: ... class Differ: diff --git a/stdlib/dis.pyi b/stdlib/dis.pyi index 4d39a54d41dd..ea837f09c806 100644 --- a/stdlib/dis.pyi +++ b/stdlib/dis.pyi @@ -86,7 +86,9 @@ class Bytecode: cls: type[Self], tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False ) -> Self: ... else: - def __init__(self, x: _HaveCodeType | str, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ... + def __init__( + self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None + ) -> None: ... @classmethod def from_traceback(cls: type[Self], tb: types.TracebackType) -> Self: ... @@ -113,7 +115,7 @@ if sys.version_info >= (3, 11): else: def dis( - x: _HaveCodeType | str | bytes | bytearray | None = ..., *, file: IO[str] | None = ..., depth: int | None = ... + x: _HaveCodeType | str | bytes | bytearray | None = None, *, file: IO[str] | None = None, depth: int | None = None ) -> None: ... if sys.version_info >= (3, 11): @@ -131,9 +133,9 @@ if sys.version_info >= (3, 11): ) -> Iterator[Instruction]: ... else: - def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... - def disco(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... - def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ...) -> None: ... - def get_instructions(x: _HaveCodeType, *, first_line: int | None = ...) -> Iterator[Instruction]: ... + def disassemble(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... + def disco(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... + def distb(tb: types.TracebackType | None = None, *, file: IO[str] | None = None) -> None: ... + def get_instructions(x: _HaveCodeType, *, first_line: int | None = None) -> Iterator[Instruction]: ... def show_code(co: _HaveCodeType, *, file: IO[str] | None = None) -> None: ... diff --git a/stdlib/distutils/command/bdist_msi.pyi b/stdlib/distutils/command/bdist_msi.pyi index 66202e841d3c..fa98e86d592a 100644 --- a/stdlib/distutils/command/bdist_msi.pyi +++ b/stdlib/distutils/command/bdist_msi.pyi @@ -9,9 +9,9 @@ if sys.platform == "win32": class PyDialog(Dialog): def __init__(self, *args, **kw) -> None: ... def title(self, title) -> None: ... - def back(self, title, next, name: str = ..., active: int = ...): ... - def cancel(self, title, next, name: str = ..., active: int = ...): ... - def next(self, title, next, name: str = ..., active: int = ...): ... + def back(self, title, next, name: str = "Back", active: int = 1): ... + def cancel(self, title, next, name: str = "Cancel", active: int = 1): ... + def next(self, title, next, name: str = "Next", active: int = 1): ... def xbutton(self, name, title, next, xpos): ... class bdist_msi(Command): diff --git a/stdlib/distutils/command/bdist_wininst.pyi b/stdlib/distutils/command/bdist_wininst.pyi index 1091fb278493..8491d3126200 100644 --- a/stdlib/distutils/command/bdist_wininst.pyi +++ b/stdlib/distutils/command/bdist_wininst.pyi @@ -11,6 +11,6 @@ class bdist_wininst(Command): def finalize_options(self) -> None: ... def run(self) -> None: ... def get_inidata(self) -> str: ... - def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = ...) -> None: ... + def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = None) -> None: ... def get_installer_filename(self, fullname: str) -> str: ... def get_exe_bytes(self) -> bytes: ... diff --git a/stdlib/distutils/fancy_getopt.pyi b/stdlib/distutils/fancy_getopt.pyi index e72e7996aaa0..153583be6b5d 100644 --- a/stdlib/distutils/fancy_getopt.pyi +++ b/stdlib/distutils/fancy_getopt.pyi @@ -14,7 +14,7 @@ class FancyGetopt: def __init__(self, option_table: list[_Option] | None = None) -> None: ... # TODO kinda wrong, `getopt(object=object())` is invalid @overload - def getopt(self, args: list[str] | None = ...) -> _GR: ... + def getopt(self, args: list[str] | None = None) -> _GR: ... @overload def getopt(self, args: list[str] | None, object: Any) -> list[str]: ... def get_option_order(self) -> list[tuple[str, str]]: ... diff --git a/stdlib/distutils/filelist.pyi b/stdlib/distutils/filelist.pyi index 4bd9d3a331eb..77be175b9afb 100644 --- a/stdlib/distutils/filelist.pyi +++ b/stdlib/distutils/filelist.pyi @@ -18,34 +18,34 @@ class FileList: def process_template_line(self, line: str) -> None: ... @overload def include_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... @overload def include_pattern( - self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> bool: ... @overload def exclude_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... @overload def exclude_pattern( - self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> bool: ... def findall(dir: str = ".") -> list[str]: ... def glob_to_re(pattern: str) -> str: ... @overload def translate_pattern( - pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ... + pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[False, 0] = 0 ) -> Pattern[str]: ... @overload def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ... @overload def translate_pattern( - pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> Pattern[str]: ... diff --git a/stdlib/distutils/log.pyi b/stdlib/distutils/log.pyi index 14ed8d8aefa8..549b569e7356 100644 --- a/stdlib/distutils/log.pyi +++ b/stdlib/distutils/log.pyi @@ -7,7 +7,7 @@ ERROR: int FATAL: int class Log: - def __init__(self, threshold: int = 3) -> None: ... + def __init__(self, threshold: int = ...) -> None: ... def log(self, level: int, msg: str, *args: Any) -> None: ... def debug(self, msg: str, *args: Any) -> None: ... def info(self, msg: str, *args: Any) -> None: ... diff --git a/stdlib/email/feedparser.pyi b/stdlib/email/feedparser.pyi index 809f0b0e112b..4b7f73b9c015 100644 --- a/stdlib/email/feedparser.pyi +++ b/stdlib/email/feedparser.pyi @@ -9,7 +9,7 @@ _MessageT = TypeVar("_MessageT", bound=Message) class FeedParser(Generic[_MessageT]): @overload - def __init__(self: FeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + def __init__(self: FeedParser[Message], _factory: None = None, *, policy: Policy = ...) -> None: ... @overload def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ... def feed(self, data: str) -> None: ... @@ -17,7 +17,7 @@ class FeedParser(Generic[_MessageT]): class BytesFeedParser(Generic[_MessageT]): @overload - def __init__(self: BytesFeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + def __init__(self: BytesFeedParser[Message], _factory: None = None, *, policy: Policy = ...) -> None: ... @overload def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ... def feed(self, data: bytes | bytearray) -> None: ... diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index b51b51c0e672..182076731ab2 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -112,7 +112,7 @@ class EnumMeta(ABCMeta): def __dir__(self) -> list[str]: ... # Simple value lookup @overload # type: ignore[override] - def __call__(cls: type[_EnumMemberT], value: Any, names: None = ...) -> _EnumMemberT: ... + def __call__(cls: type[_EnumMemberT], value: Any, names: None = None) -> _EnumMemberT: ... # Functional Enum API if sys.version_info >= (3, 11): @overload @@ -121,11 +121,11 @@ class EnumMeta(ABCMeta): value: str, names: _EnumNames, *, - module: str | None = ..., - qualname: str | None = ..., - type: type | None = ..., - start: int = ..., - boundary: FlagBoundary | None = ..., + module: str | None = None, + qualname: str | None = None, + type: type | None = None, + start: int = 1, + boundary: FlagBoundary | None = None, ) -> type[Enum]: ... else: @overload @@ -134,10 +134,10 @@ class EnumMeta(ABCMeta): value: str, names: _EnumNames, *, - module: str | None = ..., - qualname: str | None = ..., - type: type | None = ..., - start: int = ..., + module: str | None = None, + qualname: str | None = None, + type: type | None = None, + start: int = 1, ) -> type[Enum]: ... _member_names_: list[str] # undocumented _member_map_: dict[str, Enum] # undocumented diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index dc51b0a2a238..17379e92ba5f 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -36,89 +36,89 @@ if sys.version_info >= (3, 10): # encoding and errors are added @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> FileInput[str]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., - encoding: None = ..., - errors: None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, + encoding: None = None, + errors: None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> FileInput[Any]: ... elif sys.version_info >= (3, 8): # bufsize is dropped and mode and openhook become keyword-only @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... else: @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... # Because mode isn't keyword-only here yet, we need two overloads each for # the bytes case and the fallback case. @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( @@ -127,17 +127,17 @@ else: backup: str, bufsize: int, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... @overload def input( @@ -146,7 +146,7 @@ else: backup: str, bufsize: int, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... def close() -> None: ... @@ -164,38 +164,38 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., - encoding: None = ..., - errors: None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, + encoding: None = None, + errors: None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... elif sys.version_info >= (3, 8): @@ -203,57 +203,57 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... else: @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, + mode: _TextMode = "r", + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... # Because mode isn't keyword-only here yet, we need two overloads each for # the bytes case and the fallback case. @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( @@ -263,18 +263,18 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): backup: str, bufsize: int, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = "", + bufsize: int = 0, *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... @overload def __init__( @@ -284,7 +284,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): backup: str, bufsize: int, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... def __del__(self) -> None: ... diff --git a/stdlib/formatter.pyi b/stdlib/formatter.pyi index 388dbd6071ac..05c3c8b3dd41 100644 --- a/stdlib/formatter.pyi +++ b/stdlib/formatter.pyi @@ -8,11 +8,11 @@ _StylesType: TypeAlias = tuple[Any, ...] class NullFormatter: writer: NullWriter | None - def __init__(self, writer: NullWriter | None = ...) -> None: ... + def __init__(self, writer: NullWriter | None = None) -> None: ... def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... def add_flowing_data(self, data: str) -> None: ... def add_literal_data(self, data: str) -> None: ... def flush_softspace(self) -> None: ... @@ -24,8 +24,8 @@ class NullFormatter: def pop_margin(self) -> None: ... def set_spacing(self, spacing: str | None) -> None: ... def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = ...) -> None: ... - def assert_line_data(self, flag: int = ...) -> None: ... + def pop_style(self, n: int = 1) -> None: ... + def assert_line_data(self, flag: int = 1) -> None: ... class AbstractFormatter: writer: NullWriter @@ -45,7 +45,7 @@ class AbstractFormatter: def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... def format_counter(self, format: Iterable[str], counter: int) -> str: ... def format_letter(self, case: str, counter: int) -> str: ... def format_roman(self, case: str, counter: int) -> str: ... @@ -60,8 +60,8 @@ class AbstractFormatter: def pop_margin(self) -> None: ... def set_spacing(self, spacing: str | None) -> None: ... def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = ...) -> None: ... - def assert_line_data(self, flag: int = ...) -> None: ... + def pop_style(self, n: int = 1) -> None: ... + def assert_line_data(self, flag: int = 1) -> None: ... class NullWriter: def flush(self) -> None: ... @@ -82,7 +82,7 @@ class AbstractWriter(NullWriter): ... class DumbWriter(NullWriter): file: IO[str] maxcol: int - def __init__(self, file: IO[str] | None = ..., maxcol: int = ...) -> None: ... + def __init__(self, file: IO[str] | None = None, maxcol: int = 72) -> None: ... def reset(self) -> None: ... -def test(file: str | None = ...) -> None: ... +def test(file: str | None = None) -> None: ... diff --git a/stdlib/fractions.pyi b/stdlib/fractions.pyi index 1cad2353ed8d..95e4aad0f9ca 100644 --- a/stdlib/fractions.pyi +++ b/stdlib/fractions.pyi @@ -24,10 +24,10 @@ else: class Fraction(Rational): @overload def __new__( - cls: type[Self], numerator: int | Rational = ..., denominator: int | Rational | None = ..., *, _normalize: bool = ... + cls: type[Self], numerator: int | Rational = 0, denominator: int | Rational | None = None, *, _normalize: bool = True ) -> Self: ... @overload - def __new__(cls: type[Self], __value: float | Decimal | str, *, _normalize: bool = ...) -> Self: ... + def __new__(cls: type[Self], __value: float | Decimal | str, *, _normalize: bool = True) -> Self: ... @classmethod def from_float(cls: type[Self], f: float) -> Self: ... @classmethod @@ -129,7 +129,7 @@ class Fraction(Rational): def __floor__(a) -> int: ... def __ceil__(a) -> int: ... @overload - def __round__(self, ndigits: None = ...) -> int: ... + def __round__(self, ndigits: None = None) -> int: ... @overload def __round__(self, ndigits: int) -> Fraction: ... def __hash__(self) -> int: ... diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 4a735ab4bef6..6c33f1409822 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -56,12 +56,12 @@ class FTP: else: def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, ) -> None: ... def connect( @@ -136,15 +136,15 @@ class FTP_TLS(FTP): else: def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - context: SSLContext | None = ..., + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", + keyfile: str | None = None, + certfile: str | None = None, + context: SSLContext | None = None, timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, ) -> None: ... ssl_version: int keyfile: str | None diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 2174e8c573bc..b0ed37ff8615 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -55,12 +55,12 @@ class _lru_cache_wrapper(Generic[_T]): if sys.version_info >= (3, 8): @overload - def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... @overload - def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ... + def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ... else: - def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... WRAPPER_ASSIGNMENTS: tuple[ Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"], @@ -132,9 +132,9 @@ if sys.version_info >= (3, 8): @property def __isabstractmethod__(self) -> bool: ... @overload - def register(self, cls: type[Any], method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register(self, cls: type[Any], method: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... @overload - def register(self, cls: Callable[..., _T], method: None = ...) -> Callable[..., _T]: ... + def register(self, cls: Callable[..., _T], method: None = None) -> Callable[..., _T]: ... @overload def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ... def __get__(self, obj: _S, cls: type[_S] | None = None) -> Callable[..., _T]: ... @@ -144,9 +144,9 @@ if sys.version_info >= (3, 8): attrname: str | None def __init__(self, func: Callable[[Any], _T]) -> None: ... @overload - def __get__(self, instance: None, owner: type[Any] | None = ...) -> cached_property[_T]: ... + def __get__(self, instance: None, owner: type[Any] | None = None) -> cached_property[_T]: ... @overload - def __get__(self, instance: object, owner: type[Any] | None = ...) -> _T: ... + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ... def __set_name__(self, owner: type[Any], name: str) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 83cf65dcb61c..5d98227ec1f4 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -59,14 +59,16 @@ class GNUTranslations(NullTranslations): @overload # ignores incompatible overloads def find( # type: ignore[misc] - domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[False] = ... + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[False] = False ) -> str | None: ... @overload def find( - domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[True] = ... + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, *, all: Literal[True] ) -> list[str]: ... @overload -def find(domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: bool = ...) -> Any: ... +def find(domain: str, localedir: StrPath | None, languages: Iterable[str] | None, all: Literal[True]) -> list[str]: ... +@overload +def find(domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: bool = False) -> Any: ... _NullTranslationsT = TypeVar("_NullTranslationsT", bound=NullTranslations) @@ -74,19 +76,19 @@ if sys.version_info >= (3, 11): @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: None = ..., - fallback: Literal[False] = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: None = None, + fallback: Literal[False] = False, ) -> GNUTranslations: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, *, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, ) -> _NullTranslationsT: ... @overload def translation( @@ -94,15 +96,15 @@ if sys.version_info >= (3, 11): localedir: StrPath | None, languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, ) -> _NullTranslationsT: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: Callable[[io.BufferedReader], NullTranslations] | None = ..., - fallback: bool = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: Callable[[io.BufferedReader], NullTranslations] | None = None, + fallback: bool = False, ) -> NullTranslations: ... def install(domain: str, localedir: StrPath | None = None, *, names: Container[str] | None = None) -> None: ... @@ -110,21 +112,21 @@ else: @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: None = ..., - fallback: Literal[False] = ..., - codeset: str | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: None = None, + fallback: Literal[False] = False, + codeset: str | None = None, ) -> GNUTranslations: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, *, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., - codeset: str | None = ..., + fallback: Literal[False] = False, + codeset: str | None = None, ) -> _NullTranslationsT: ... @overload def translation( @@ -132,20 +134,20 @@ else: localedir: StrPath | None, languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., - codeset: str | None = ..., + fallback: Literal[False] = False, + codeset: str | None = None, ) -> _NullTranslationsT: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: Callable[[io.BufferedReader], NullTranslations] | None = ..., - fallback: bool = ..., - codeset: str | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: Callable[[io.BufferedReader], NullTranslations] | None = None, + fallback: bool = False, + codeset: str | None = None, ) -> NullTranslations: ... def install( - domain: str, localedir: StrPath | None = ..., codeset: str | None = ..., names: Container[str] | None = ... + domain: str, localedir: StrPath | None = None, codeset: str | None = None, names: Container[str] | None = None ) -> None: ... def textdomain(domain: str | None = None) -> str: ... @@ -166,6 +168,6 @@ if sys.version_info < (3, 11): def ldgettext(domain: str, message: str) -> str: ... def lngettext(msgid1: str, msgid2: str, n: int) -> str: ... def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... - def bind_textdomain_codeset(domain: str, codeset: str | None = ...) -> str: ... + def bind_textdomain_codeset(domain: str, codeset: str | None = None) -> str: ... Catalog = translation diff --git a/stdlib/glob.pyi b/stdlib/glob.pyi index d6c885d70792..914ccc12ef1e 100644 --- a/stdlib/glob.pyi +++ b/stdlib/glob.pyi @@ -28,15 +28,15 @@ if sys.version_info >= (3, 11): elif sys.version_info >= (3, 10): def glob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ... + pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False ) -> list[AnyStr]: ... def iglob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ... + pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False ) -> Iterator[AnyStr]: ... else: - def glob(pathname: AnyStr, *, recursive: bool = ...) -> list[AnyStr]: ... - def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... + def glob(pathname: AnyStr, *, recursive: bool = False) -> list[AnyStr]: ... + def iglob(pathname: AnyStr, *, recursive: bool = False) -> Iterator[AnyStr]: ... def escape(pathname: AnyStr) -> AnyStr: ... def has_magic(s: str | bytes) -> bool: ... # undocumented diff --git a/stdlib/graphlib.pyi b/stdlib/graphlib.pyi index 4c6959decc4b..c02d447ad501 100644 --- a/stdlib/graphlib.pyi +++ b/stdlib/graphlib.pyi @@ -12,7 +12,7 @@ if sys.version_info >= (3, 11): class TopologicalSorter(Generic[_T]): @overload - def __init__(self, graph: None = ...) -> None: ... + def __init__(self, graph: None = None) -> None: ... @overload def __init__(self, graph: SupportsItems[_T, Iterable[_T]]) -> None: ... def add(self, node: _T, *predecessors: _T) -> None: ... diff --git a/stdlib/gzip.pyi b/stdlib/gzip.pyi index 01c285d94d9e..36f91036fd7c 100644 --- a/stdlib/gzip.pyi +++ b/stdlib/gzip.pyi @@ -43,38 +43,38 @@ class _WritableFileobj(Protocol): @overload def open( filename: StrOrBytesPath | _ReadableFileobj, - mode: _ReadBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode = "rb", + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> GzipFile: ... @overload def open( filename: StrOrBytesPath | _WritableFileobj, mode: _WriteBinaryMode, - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> GzipFile: ... @overload def open( filename: StrOrBytesPath, mode: _OpenTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, mode: str, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> GzipFile | TextIO: ... class _PaddedFile: @@ -99,45 +99,45 @@ class GzipFile(_compression.BaseStream): self, filename: StrOrBytesPath | None, mode: _ReadBinaryMode, - compresslevel: int = ..., - fileobj: _ReadableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _ReadableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, *, mode: _ReadBinaryMode, - compresslevel: int = ..., - fileobj: _ReadableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _ReadableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath | None, mode: _WriteBinaryMode, - compresslevel: int = ..., - fileobj: _WritableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, *, mode: _WriteBinaryMode, - compresslevel: int = ..., - fileobj: _WritableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, - filename: StrOrBytesPath | None = ..., - mode: str | None = ..., - compresslevel: int = ..., - fileobj: _ReadableFileobj | _WritableFileobj | None = ..., - mtime: float | None = ..., + filename: StrOrBytesPath | None = None, + mode: str | None = None, + compresslevel: int = 9, + fileobj: _ReadableFileobj | _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @property def filename(self) -> str: ... @@ -162,6 +162,6 @@ if sys.version_info >= (3, 8): def compress(data: _BufferWithLen, compresslevel: int = 9, *, mtime: float | None = None) -> bytes: ... else: - def compress(data: _BufferWithLen, compresslevel: int = ...) -> bytes: ... + def compress(data: _BufferWithLen, compresslevel: int = 9) -> bytes: ... def decompress(data: ReadableBuffer) -> bytes: ... diff --git a/stdlib/hmac.pyi b/stdlib/hmac.pyi index 98fdfce561fe..b9a867f7bd61 100644 --- a/stdlib/hmac.pyi +++ b/stdlib/hmac.pyi @@ -23,7 +23,7 @@ if sys.version_info >= (3, 8): def new(key: bytes | bytearray, *, digestmod: _DigestMod) -> HMAC: ... else: - def new(key: bytes | bytearray, msg: ReadableBuffer | None = ..., digestmod: _DigestMod | None = ...) -> HMAC: ... + def new(key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod | None = None) -> HMAC: ... class HMAC: digest_size: int diff --git a/stdlib/http/cookiejar.pyi b/stdlib/http/cookiejar.pyi index 40cc5ab46ba6..7f2c9c6cc8f4 100644 --- a/stdlib/http/cookiejar.pyi +++ b/stdlib/http/cookiejar.pyi @@ -49,7 +49,7 @@ class FileCookieJar(CookieJar): self, filename: StrPath | None = None, delayload: bool = False, policy: CookiePolicy | None = None ) -> None: ... else: - def __init__(self, filename: str | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ... + def __init__(self, filename: str | None = None, delayload: bool = False, policy: CookiePolicy | None = None) -> None: ... def save(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... def load(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... @@ -104,18 +104,18 @@ class DefaultCookiePolicy(CookiePolicy): else: def __init__( self, - blocked_domains: Sequence[str] | None = ..., - allowed_domains: Sequence[str] | None = ..., - netscape: bool = ..., - rfc2965: bool = ..., - rfc2109_as_netscape: bool | None = ..., - hide_cookie2: bool = ..., - strict_domain: bool = ..., - strict_rfc2965_unverifiable: bool = ..., - strict_ns_unverifiable: bool = ..., - strict_ns_domain: int = ..., - strict_ns_set_initial_dollar: bool = ..., - strict_ns_set_path: bool = ..., + blocked_domains: Sequence[str] | None = None, + allowed_domains: Sequence[str] | None = None, + netscape: bool = True, + rfc2965: bool = False, + rfc2109_as_netscape: bool | None = None, + hide_cookie2: bool = False, + strict_domain: bool = False, + strict_rfc2965_unverifiable: bool = True, + strict_ns_unverifiable: bool = False, + strict_ns_domain: int = 0, + strict_ns_set_initial_dollar: bool = False, + strict_ns_set_path: bool = False, ) -> None: ... def blocked_domains(self) -> tuple[str, ...]: ... diff --git a/stdlib/imaplib.pyi b/stdlib/imaplib.pyi index f6ed8de48b8b..8016d8bec5cd 100644 --- a/stdlib/imaplib.pyi +++ b/stdlib/imaplib.pyi @@ -44,8 +44,8 @@ class IMAP4: def __init__(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... def open(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... else: - def __init__(self, host: str = ..., port: int = ...) -> None: ... - def open(self, host: str = ..., port: int = ...) -> None: ... + def __init__(self, host: str = "", port: int = 143) -> None: ... + def open(self, host: str = "", port: int = 143) -> None: ... def __getattr__(self, attr: str) -> Any: ... host: str @@ -123,18 +123,18 @@ class IMAP4_SSL(IMAP4): else: def __init__( self, - host: str = ..., - port: int = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - ssl_context: SSLContext | None = ..., + host: str = "", + port: int = 993, + keyfile: str | None = None, + certfile: str | None = None, + ssl_context: SSLContext | None = None, ) -> None: ... sslobj: SSLSocket file: IO[Any] if sys.version_info >= (3, 9): def open(self, host: str = "", port: int | None = 993, timeout: float | None = None) -> None: ... else: - def open(self, host: str = ..., port: int | None = ...) -> None: ... + def open(self, host: str = "", port: int | None = 993) -> None: ... def ssl(self) -> SSLSocket: ... @@ -148,7 +148,7 @@ class IMAP4_stream(IMAP4): if sys.version_info >= (3, 9): def open(self, host: str | None = None, port: int | None = None, timeout: float | None = None) -> None: ... else: - def open(self, host: str | None = ..., port: int | None = ...) -> None: ... + def open(self, host: str | None = None, port: int | None = None) -> None: ... class _Authenticator: mech: Callable[[bytes], bytes | bytearray | memoryview | str | None] diff --git a/stdlib/imghdr.pyi b/stdlib/imghdr.pyi index 5f439779a69c..ed3647f20fc5 100644 --- a/stdlib/imghdr.pyi +++ b/stdlib/imghdr.pyi @@ -10,7 +10,7 @@ class _ReadableBinary(Protocol): def seek(self, offset: int) -> Any: ... @overload -def what(file: StrPath | _ReadableBinary, h: None = ...) -> str | None: ... +def what(file: StrPath | _ReadableBinary, h: None = None) -> str | None: ... @overload def what(file: Any, h: bytes) -> str | None: ... diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index bac7b50c6737..78b79267d06e 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -123,7 +123,7 @@ if sys.version_info >= (3, 9): @abstractmethod def open( self, - mode: OpenTextMode = ..., + mode: OpenTextMode = "r", buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index 0e9c3bce9993..3b82e0b0af2a 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -297,7 +297,7 @@ if sys.version_info >= (3, 10): ) -> Signature: ... else: - def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = ...) -> Signature: ... + def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Signature: ... class _void: ... class _empty: ... @@ -329,7 +329,7 @@ class Signature: ) -> Self: ... else: @classmethod - def from_callable(cls: type[Self], obj: _IntrospectableCallable, *, follow_wrapped: bool = ...) -> Self: ... + def from_callable(cls: type[Self], obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Self: ... def __eq__(self, other: object) -> bool: ... @@ -442,9 +442,9 @@ def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... if sys.version_info < (3, 11): def formatargspec( args: list[str], - varargs: str | None = ..., - varkw: str | None = ..., - defaults: tuple[Any, ...] | None = ..., + varargs: str | None = None, + varkw: str | None = None, + defaults: tuple[Any, ...] | None = None, kwonlyargs: Sequence[str] | None = ..., kwonlydefaults: Mapping[str, Any] | None = ..., annotations: Mapping[str, Any] = ..., diff --git a/stdlib/lib2to3/pytree.pyi b/stdlib/lib2to3/pytree.pyi index cb56d20f6c36..ff3ac1a4dc25 100644 --- a/stdlib/lib2to3/pytree.pyi +++ b/stdlib/lib2to3/pytree.pyi @@ -83,7 +83,7 @@ class NodePattern(BasePattern): class WildcardPattern(BasePattern): min: int max: int - def __init__(self, content: str | None = None, min: int = 0, max: int = 2147483647, name: str | None = None) -> None: ... + def __init__(self, content: str | None = None, min: int = 0, max: int = ..., name: str | None = None) -> None: ... class NegatedPattern(BasePattern): def __init__(self, content: str | None = None) -> None: ... diff --git a/stdlib/locale.pyi b/stdlib/locale.pyi index 99b78b50adff..0b0dd9456e52 100644 --- a/stdlib/locale.pyi +++ b/stdlib/locale.pyi @@ -115,10 +115,10 @@ def setlocale(category: int, locale: _str | Iterable[_str | None] | None = None) def localeconv() -> Mapping[_str, int | _str | list[int]]: ... def nl_langinfo(__key: int) -> _str: ... def getdefaultlocale(envvars: tuple[_str, ...] = ...) -> tuple[_str | None, _str | None]: ... -def getlocale(category: int = 2) -> tuple[_str | None, _str | None]: ... +def getlocale(category: int = ...) -> tuple[_str | None, _str | None]: ... def getpreferredencoding(do_setlocale: bool = True) -> _str: ... def normalize(localename: _str) -> _str: ... -def resetlocale(category: int = 0) -> None: ... +def resetlocale(category: int = ...) -> None: ... def strcoll(__os1: _str, __os2: _str) -> int: ... def strxfrm(__string: _str) -> _str: ... def format(percent: _str, value: float | Decimal, grouping: bool = False, monetary: bool = False, *additional: Any) -> _str: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index a103aacd3e0e..231700653a32 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -257,7 +257,7 @@ class Logger(Filterer): self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., + exc_info: _ExcInfoType = True, stack_info: bool = ..., extra: Mapping[str, object] | None = ..., ) -> None: ... @@ -266,9 +266,9 @@ class Logger(Filterer): level: int, msg: object, args: _ArgsType, - exc_info: _ExcInfoType | None = ..., - extra: Mapping[str, object] | None = ..., - stack_info: bool = ..., + exc_info: _ExcInfoType | None = None, + extra: Mapping[str, object] | None = None, + stack_info: bool = False, ) -> None: ... # undocumented fatal = critical def addHandler(self, hdlr: Handler) -> None: ... @@ -276,7 +276,7 @@ class Logger(Filterer): if sys.version_info >= (3, 8): def findCaller(self, stack_info: bool = False, stacklevel: int = 1) -> tuple[str, int, str, str | None]: ... else: - def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, str | None]: ... + def findCaller(self, stack_info: bool = False) -> tuple[str, int, str, str | None]: ... def handle(self, record: LogRecord) -> None: ... def makeRecord( @@ -347,10 +347,10 @@ class Formatter: ) -> None: ... elif sys.version_info >= (3, 8): def __init__( - self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ..., validate: bool = ... + self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%", validate: bool = True ) -> None: ... else: - def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ... + def __init__(self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%") -> None: ... def format(self, record: LogRecord) -> str: ... def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: ... @@ -559,7 +559,7 @@ class LoggerAdapter(Generic[_L]): self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., + exc_info: _ExcInfoType = True, stack_info: bool = ..., extra: Mapping[str, object] | None = ..., **kwargs: object, @@ -693,7 +693,11 @@ else: msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... ) -> None: ... def exception( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = True, + stack_info: bool = ..., + extra: Mapping[str, object] | None = ..., ) -> None: ... def log( level: int, @@ -771,7 +775,7 @@ class StreamHandler(Handler, Generic[_StreamT]): stream: _StreamT # undocumented terminator: str @overload - def __init__(self: StreamHandler[TextIO], stream: None = ...) -> None: ... + def __init__(self: StreamHandler[TextIO], stream: None = None) -> None: ... @overload def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... def setStream(self, stream: _StreamT) -> _StreamT | None: ... @@ -789,7 +793,7 @@ class FileHandler(StreamHandler[TextIOWrapper]): self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False) -> None: ... def _open(self) -> TextIOWrapper: ... # undocumented diff --git a/stdlib/logging/config.pyi b/stdlib/logging/config.pyi index 529dd65ff7cf..f76f655a6196 100644 --- a/stdlib/logging/config.pyi +++ b/stdlib/logging/config.pyi @@ -57,8 +57,8 @@ if sys.version_info >= (3, 10): else: def fileConfig( fname: StrOrBytesPath | IO[str] | RawConfigParser, - defaults: dict[str, str] | None = ..., - disable_existing_loggers: bool = ..., + defaults: dict[str, str] | None = None, + disable_existing_loggers: bool = True, ) -> None: ... def valid_ident(s: str) -> Literal[True]: ... # undocumented diff --git a/stdlib/logging/handlers.pyi b/stdlib/logging/handlers.pyi index ff9aaf8283e1..7e0bfd705895 100644 --- a/stdlib/logging/handlers.pyi +++ b/stdlib/logging/handlers.pyi @@ -25,7 +25,7 @@ class WatchedFileHandler(FileHandler): self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False) -> None: ... def _statstream(self) -> None: ... # undocumented def reopenIfNeeded(self) -> None: ... @@ -38,7 +38,7 @@ class BaseRotatingHandler(FileHandler): self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False) -> None: ... def rotation_filename(self, default_name: str) -> str: ... def rotate(self, source: str, dest: str) -> None: ... @@ -61,11 +61,11 @@ class RotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - mode: str = ..., - maxBytes: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., + mode: str = "a", + maxBytes: int = 0, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, ) -> None: ... def doRollover(self) -> None: ... @@ -98,13 +98,13 @@ class TimedRotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - when: str = ..., - interval: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., - utc: bool = ..., - atTime: datetime.time | None = ..., + when: str = "h", + interval: int = 1, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, + utc: bool = False, + atTime: datetime.time | None = None, ) -> None: ... def doRollover(self) -> None: ... @@ -210,7 +210,7 @@ class SMTPHandler(Handler): subject: str, credentials: tuple[str, str] | None = None, secure: tuple[()] | tuple[str] | tuple[str, str] | None = None, - timeout: float = ..., + timeout: float = 5.0, ) -> None: ... def getSubject(self, record: LogRecord) -> str: ... diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index 0f1fa8de4193..2feb28a8e743 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -126,67 +126,67 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]): @overload def open( filename: _PathOrFile, - mode: Literal["r", "rb"] = ..., + mode: Literal["r", "rb"] = "rb", *, - format: int | None = ..., - check: Literal[-1] = ..., - preset: None = ..., - filters: _FilterChain | None = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + format: int | None = None, + check: Literal[-1] = -1, + preset: None = None, + filters: _FilterChain | None = None, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> LZMAFile: ... @overload def open( filename: _PathOrFile, mode: _OpenBinaryWritingMode, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> LZMAFile: ... @overload def open( filename: StrOrBytesPath, mode: Literal["rt"], *, - format: int | None = ..., - check: Literal[-1] = ..., - preset: None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: Literal[-1] = -1, + preset: None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath, mode: _OpenTextWritingMode, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: _PathOrFile, mode: str, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> LZMAFile | TextIO: ... def compress( data: ReadableBuffer, format: int = 1, check: int = -1, preset: int | None = None, filters: _FilterChain | None = None diff --git a/stdlib/mailbox.pyi b/stdlib/mailbox.pyi index 229052f91ecc..7d667dd09f54 100644 --- a/stdlib/mailbox.pyi +++ b/stdlib/mailbox.pyi @@ -50,9 +50,9 @@ class Mailbox(Generic[_MessageT]): _path: str # undocumented _factory: Callable[[IO[Any]], _MessageT] | None # undocumented @overload - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], _MessageT], create: bool = ...) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], _MessageT], create: bool = True) -> None: ... @overload - def __init__(self, path: StrPath, factory: None = ..., create: bool = ...) -> None: ... + def __init__(self, path: StrPath, factory: None = None, create: bool = True) -> None: ... @abstractmethod def add(self, message: _MessageData) -> str: ... @abstractmethod @@ -62,7 +62,7 @@ class Mailbox(Generic[_MessageT]): @abstractmethod def __setitem__(self, key: str, message: _MessageData) -> None: ... @overload - def get(self, key: str, default: None = ...) -> _MessageT | None: ... + def get(self, key: str, default: None = None) -> _MessageT | None: ... @overload def get(self, key: str, default: _T) -> _MessageT | _T: ... def __getitem__(self, key: str) -> _MessageT: ... @@ -88,9 +88,9 @@ class Mailbox(Generic[_MessageT]): def __len__(self) -> int: ... def clear(self) -> None: ... @overload - def pop(self, key: str, default: None = ...) -> _MessageT | None: ... + def pop(self, key: str, default: None = None) -> _MessageT | None: ... @overload - def pop(self, key: str, default: _T = ...) -> _MessageT | _T: ... + def pop(self, key: str, default: _T) -> _MessageT | _T: ... def popitem(self) -> tuple[str, _MessageT]: ... def update(self, arg: _HasIteritems | _HasItems | Iterable[tuple[str, _MessageData]] | None = None) -> None: ... @abstractmethod diff --git a/stdlib/math.pyi b/stdlib/math.pyi index ca30acd7e97d..23bacfefd1e3 100644 --- a/stdlib/math.pyi +++ b/stdlib/math.pyi @@ -91,8 +91,8 @@ def isclose( a: _SupportsFloatOrIndex, b: _SupportsFloatOrIndex, *, - rel_tol: _SupportsFloatOrIndex = ..., - abs_tol: _SupportsFloatOrIndex = ..., + rel_tol: _SupportsFloatOrIndex = 1e-09, + abs_tol: _SupportsFloatOrIndex = 0.0, ) -> bool: ... def isinf(__x: _SupportsFloatOrIndex) -> bool: ... def isfinite(__x: _SupportsFloatOrIndex) -> bool: ... @@ -122,9 +122,9 @@ def pow(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... if sys.version_info >= (3, 8): @overload - def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = ...) -> int: ... # type: ignore[misc] + def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = 1) -> int: ... # type: ignore[misc] @overload - def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = ...) -> float: ... + def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = 1) -> float: ... def radians(__x: _SupportsFloatOrIndex) -> float: ... def remainder(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... diff --git a/stdlib/mimetypes.pyi b/stdlib/mimetypes.pyi index decbf2fee19d..fd3908680009 100644 --- a/stdlib/mimetypes.pyi +++ b/stdlib/mimetypes.pyi @@ -23,7 +23,7 @@ if sys.version_info >= (3, 8): def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... else: - def guess_type(url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(url: str, strict: bool = True) -> tuple[str | None, str | None]: ... def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ... def guess_extension(type: str, strict: bool = True) -> str | None: ... @@ -48,10 +48,10 @@ class MimeTypes: if sys.version_info >= (3, 8): def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... else: - def guess_type(self, url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(self, url: str, strict: bool = True) -> tuple[str | None, str | None]: ... def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ... def read(self, filename: str, strict: bool = True) -> None: ... def readfp(self, fp: IO[str], strict: bool = True) -> None: ... if sys.platform == "win32": - def read_windows_registry(self, strict: bool = ...) -> None: ... + def read_windows_registry(self, strict: bool = True) -> None: ... diff --git a/stdlib/modulefinder.pyi b/stdlib/modulefinder.pyi index 601d374ed35a..6e12e5ef8ce2 100644 --- a/stdlib/modulefinder.pyi +++ b/stdlib/modulefinder.pyi @@ -43,8 +43,8 @@ class ModuleFinder: else: def __init__( self, - path: list[str] | None = ..., - debug: int = ..., + path: list[str] | None = None, + debug: int = 0, excludes: Container[str] = ..., replace_paths: Sequence[tuple[str, str]] = ..., ) -> None: ... diff --git a/stdlib/msilib/__init__.pyi b/stdlib/msilib/__init__.pyi index 0e18350b226e..039fa3582712 100644 --- a/stdlib/msilib/__init__.pyi +++ b/stdlib/msilib/__init__.pyi @@ -82,19 +82,19 @@ if sys.platform == "win32": physical: str, _logical: str, default: str, - componentflags: int | None = ..., + componentflags: int | None = None, ) -> None: ... def start_component( self, - component: str | None = ..., - feature: Feature | None = ..., - flags: int | None = ..., - keyfile: str | None = ..., - uuid: str | None = ..., + component: str | None = None, + feature: Feature | None = None, + flags: int | None = None, + keyfile: str | None = None, + uuid: str | None = None, ) -> None: ... def make_short(self, file: str) -> str: ... - def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ... - def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ... + def add_file(self, file: str, src: str | None = None, version: str | None = None, language: str | None = None) -> str: ... + def glob(self, pattern: str, exclude: Container[str] | None = None) -> list[str]: ... def remove_pyc(self) -> None: ... class Binary: @@ -112,10 +112,10 @@ if sys.platform == "win32": title: str, desc: str, display: int, - level: int = ..., - parent: Feature | None = ..., - directory: str | None = ..., - attributes: int = ..., + level: int = 1, + parent: Feature | None = None, + directory: str | None = None, + attributes: int = 0, ) -> None: ... def set_current(self) -> None: ... @@ -124,7 +124,7 @@ if sys.platform == "win32": dlg: Dialog name: str def __init__(self, dlg: Dialog, name: str) -> None: ... - def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ... + def event(self, event: str, argument: str, condition: str = "1", ordering: int | None = None) -> None: ... def mapping(self, event: str, attribute: str) -> None: ... def condition(self, action: str, condition: str) -> None: ... @@ -133,7 +133,7 @@ if sys.platform == "win32": property: str index: int def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... - def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ... + def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = None) -> None: ... class Dialog: diff --git a/stdlib/multiprocessing/connection.pyi b/stdlib/multiprocessing/connection.pyi index ef1aad05e5a9..392e3168aaaa 100644 --- a/stdlib/multiprocessing/connection.pyi +++ b/stdlib/multiprocessing/connection.pyi @@ -26,7 +26,7 @@ class _ConnectionBase: def recv_bytes(self, maxlength: int | None = None) -> bytes: ... def recv_bytes_into(self, buf: Any, offset: int = 0) -> int: ... def recv(self) -> Any: ... - def poll(self, timeout: float | None = ...) -> bool: ... + def poll(self, timeout: float | None = 0.0) -> bool: ... def __enter__(self: Self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None @@ -66,4 +66,4 @@ if sys.platform != "win32": def Pipe(duplex: bool = True) -> tuple[Connection, Connection]: ... else: - def Pipe(duplex: bool = ...) -> tuple[PipeConnection, PipeConnection]: ... + def Pipe(duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ... diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index c462be5838f1..fa8caf6577f0 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -54,7 +54,7 @@ class BaseContext: if sys.platform != "win32": def Pipe(self, duplex: bool = True) -> tuple[Connection, Connection]: ... else: - def Pipe(self, duplex: bool = ...) -> tuple[PipeConnection, PipeConnection]: ... + def Pipe(self, duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ... def Barrier( self, parties: int, action: Callable[..., object] | None = None, timeout: float | None = None @@ -86,24 +86,24 @@ class BaseContext: @overload def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[False]) -> _CT: ... @overload - def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[_CT]: ... + def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True) -> SynchronizedBase[_CT]: ... @overload - def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[Any]: ... + def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True) -> SynchronizedBase[Any]: ... @overload - def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ...) -> Any: ... + def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ... @overload def Array(self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]) -> _CT: ... @overload def Array( - self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... + self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True ) -> SynchronizedArray[_CT]: ... @overload def Array( - self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... + self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True ) -> SynchronizedArray[Any]: ... @overload def Array( - self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = ... + self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = True ) -> Any: ... def freeze_support(self) -> None: ... def get_logger(self) -> Logger: ... @@ -124,14 +124,14 @@ class BaseContext: def get_context(self, method: str) -> BaseContext: ... else: @overload - def get_context(self, method: None = ...) -> DefaultContext: ... + def get_context(self, method: None = None) -> DefaultContext: ... @overload def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... @overload def get_context(self, method: str) -> BaseContext: ... @overload - def get_start_method(self, allow_none: Literal[False] = ...) -> str: ... + def get_start_method(self, allow_none: Literal[False] = False) -> str: ... @overload def get_start_method(self, allow_none: bool) -> str | None: ... def set_start_method(self, method: str | None, force: bool = False) -> None: ... diff --git a/stdlib/multiprocessing/dummy/connection.pyi b/stdlib/multiprocessing/dummy/connection.pyi index 690b9d258f3c..1630472b3b06 100644 --- a/stdlib/multiprocessing/dummy/connection.pyi +++ b/stdlib/multiprocessing/dummy/connection.pyi @@ -23,7 +23,7 @@ class Connection: ) -> None: ... def __init__(self, _in: Any, _out: Any) -> None: ... def close(self) -> None: ... - def poll(self, timeout: float = ...) -> bool: ... + def poll(self, timeout: float = 0.0) -> bool: ... class Listener: _backlog_queue: Queue[Any] | None diff --git a/stdlib/multiprocessing/heap.pyi b/stdlib/multiprocessing/heap.pyi index b5e2ced5e8ee..114bdf0d4e57 100644 --- a/stdlib/multiprocessing/heap.pyi +++ b/stdlib/multiprocessing/heap.pyi @@ -27,7 +27,7 @@ if sys.platform != "win32": def rebuild_arena(size: int, dupfd: _SupportsDetach) -> Arena: ... class Heap: - def __init__(self, size: int = ...) -> None: ... + def __init__(self, size: int = 4096) -> None: ... def free(self, block: _Block) -> None: ... def malloc(self, size: int) -> _Block: ... diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index efee27f91265..1696714d187b 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -137,11 +137,15 @@ class BaseManager: serializer: str = "pickle", ctx: BaseContext | None = None, *, - shutdown_timeout: float = ..., + shutdown_timeout: float = 1.0, ) -> None: ... else: def __init__( - self, address: Any | None = ..., authkey: bytes | None = ..., serializer: str = ..., ctx: BaseContext | None = ... + self, + address: Any | None = None, + authkey: bytes | None = None, + serializer: str = "pickle", + ctx: BaseContext | None = None, ) -> None: ... def get_server(self) -> Server: ... diff --git a/stdlib/multiprocessing/popen_spawn_win32.pyi b/stdlib/multiprocessing/popen_spawn_win32.pyi index f5cb0a6c4844..3dc9d5bd7332 100644 --- a/stdlib/multiprocessing/popen_spawn_win32.pyi +++ b/stdlib/multiprocessing/popen_spawn_win32.pyi @@ -21,7 +21,7 @@ if sys.platform == "win32": def __init__(self, process_obj: BaseProcess) -> None: ... def duplicate_for_child(self, handle: int) -> int: ... - def wait(self, timeout: float | None = ...) -> int | None: ... + def wait(self, timeout: float | None = None) -> int | None: ... def poll(self) -> int | None: ... def terminate(self) -> None: ... diff --git a/stdlib/multiprocessing/reduction.pyi b/stdlib/multiprocessing/reduction.pyi index 578b68d81b45..e5a8cde8f849 100644 --- a/stdlib/multiprocessing/reduction.pyi +++ b/stdlib/multiprocessing/reduction.pyi @@ -34,17 +34,17 @@ def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None) -> N if sys.platform == "win32": if sys.version_info >= (3, 8): def duplicate( - handle: int, target_process: int | None = ..., inheritable: bool = ..., *, source_process: int | None = ... + handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None ) -> int: ... else: - def duplicate(handle: int, target_process: int | None = ..., inheritable: bool = ...) -> int: ... + def duplicate(handle: int, target_process: int | None = None, inheritable: bool = False) -> int: ... def steal_handle(source_pid: int, handle: int) -> int: ... def send_handle(conn: connection.PipeConnection, handle: int, destination_pid: int) -> None: ... def recv_handle(conn: connection.PipeConnection) -> int: ... class DupHandle: - def __init__(self, handle: int, access: int, pid: int | None = ...) -> None: ... + def __init__(self, handle: int, access: int, pid: int | None = None) -> None: ... def detach(self) -> int: ... else: diff --git a/stdlib/multiprocessing/shared_memory.pyi b/stdlib/multiprocessing/shared_memory.pyi index 84fb89d8d53f..841c947360e8 100644 --- a/stdlib/multiprocessing/shared_memory.pyi +++ b/stdlib/multiprocessing/shared_memory.pyi @@ -24,9 +24,9 @@ class SharedMemory: class ShareableList(Generic[_SLT]): shm: SharedMemory @overload - def __init__(self, sequence: None = ..., *, name: str | None = ...) -> None: ... + def __init__(self, sequence: None = None, *, name: str | None = None) -> None: ... @overload - def __init__(self, sequence: Iterable[_SLT], *, name: str | None = ...) -> None: ... + def __init__(self, sequence: Iterable[_SLT], *, name: str | None = None) -> None: ... def __getitem__(self, position: int) -> _SLT: ... def __setitem__(self, position: int, value: _SLT) -> None: ... def __reduce__(self: Self) -> tuple[Self, tuple[_SLT, ...]]: ... diff --git a/stdlib/multiprocessing/sharedctypes.pyi b/stdlib/multiprocessing/sharedctypes.pyi index f0a1f500c71f..686a45d9ae41 100644 --- a/stdlib/multiprocessing/sharedctypes.pyi +++ b/stdlib/multiprocessing/sharedctypes.pyi @@ -21,56 +21,56 @@ def RawArray(typecode_or_type: type[_CT], size_or_initializer: int | Sequence[An @overload def RawArray(typecode_or_type: str, size_or_initializer: int | Sequence[Any]) -> Any: ... @overload -def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = ...) -> _CT: ... +def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = None) -> _CT: ... @overload def Value( - typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None ) -> SynchronizedBase[_CT]: ... @overload def Value( - typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None ) -> SynchronizedBase[Any]: ... @overload def Value( - typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True, ctx: BaseContext | None = None ) -> Any: ... @overload def Array( - typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = ... + typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = None ) -> _CT: ... @overload def Array( typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: Literal[True] | _LockLike = True, + ctx: BaseContext | None = None, ) -> SynchronizedArray[_CT]: ... @overload def Array( typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: Literal[True] | _LockLike = True, + ctx: BaseContext | None = None, ) -> SynchronizedArray[Any]: ... @overload def Array( typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, - lock: bool | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: bool | _LockLike = True, + ctx: BaseContext | None = None, ) -> Any: ... def copy(obj: _CT) -> _CT: ... @overload -def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = ..., ctx: Any | None = ...) -> Synchronized[_T]: ... +def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ... @overload -def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedString: ... +def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... @overload -def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedArray[_CT]: ... +def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedArray[_CT]: ... @overload -def synchronized(obj: _CT, lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedBase[_CT]: ... +def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ... class _AcquireFunc(Protocol): def __call__(self, block: bool = ..., timeout: float | None = ...) -> bool: ... diff --git a/stdlib/nntplib.pyi b/stdlib/nntplib.pyi index 12d105a68150..02e743ea9d1e 100644 --- a/stdlib/nntplib.pyi +++ b/stdlib/nntplib.pyi @@ -99,7 +99,7 @@ class NNTP: self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = None ) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... if sys.version_info < (3, 9): - def xgtitle(self, group: str, *, file: _File = ...) -> tuple[str, _list[tuple[str, str]]]: ... + def xgtitle(self, group: str, *, file: _File = None) -> tuple[str, _list[tuple[str, str]]]: ... def xpath(self, id: Any) -> tuple[str, str]: ... def date(self) -> tuple[str, datetime.datetime]: ... diff --git a/stdlib/ntpath.pyi b/stdlib/ntpath.pyi index 0cd3e446475b..f1fa137c6d88 100644 --- a/stdlib/ntpath.pyi +++ b/stdlib/ntpath.pyi @@ -101,9 +101,9 @@ def join(__path: BytesPath, *paths: BytesPath) -> bytes: ... if sys.platform == "win32": if sys.version_info >= (3, 10): @overload - def realpath(path: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ... + def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... @overload - def realpath(path: AnyStr, *, strict: bool = ...) -> AnyStr: ... + def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ... else: @overload def realpath(path: PathLike[AnyStr]) -> AnyStr: ... diff --git a/stdlib/numbers.pyi b/stdlib/numbers.pyi index eacd87c00bad..55f21041ae44 100644 --- a/stdlib/numbers.pyi +++ b/stdlib/numbers.pyi @@ -60,7 +60,7 @@ class Real(Complex, SupportsFloat): def __ceil__(self) -> int: ... @abstractmethod @overload - def __round__(self, ndigits: None = ...) -> int: ... + def __round__(self, ndigits: None = None) -> int: ... @abstractmethod @overload def __round__(self, ndigits: int) -> Any: ... diff --git a/stdlib/optparse.pyi b/stdlib/optparse.pyi index a049fdad71c7..a8c1c4cfb93e 100644 --- a/stdlib/optparse.pyi +++ b/stdlib/optparse.pyi @@ -240,9 +240,9 @@ class OptionParser(OptionContainer): def get_usage(self) -> str: ... def get_version(self) -> str: ... @overload - def parse_args(self, args: None = ..., values: Values | None = ...) -> tuple[Values, list[str]]: ... + def parse_args(self, args: None = None, values: Values | None = None) -> tuple[Values, list[str]]: ... @overload - def parse_args(self, args: Sequence[AnyStr], values: Values | None = ...) -> tuple[Values, list[AnyStr]]: ... + def parse_args(self, args: Sequence[AnyStr], values: Values | None = None) -> tuple[Values, list[AnyStr]]: ... def print_usage(self, file: IO[str] | None = None) -> None: ... def print_help(self, file: IO[str] | None = None) -> None: ... def print_version(self, file: IO[str] | None = None) -> None: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index eea6d88b5467..117a3917d0b1 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -367,7 +367,7 @@ class PathLike(Protocol[AnyStr_co]): def __fspath__(self) -> AnyStr_co: ... @overload -def listdir(path: StrPath | None = ...) -> list[str]: ... +def listdir(path: StrPath | None = None) -> list[str]: ... @overload def listdir(path: BytesPath) -> list[bytes]: ... @overload @@ -516,9 +516,9 @@ _Opener: TypeAlias = Callable[[str, int], int] @overload def fdopen( fd: int, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., + mode: OpenTextMode = "r", + buffering: int = -1, + encoding: str | None = None, errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., @@ -529,7 +529,7 @@ def fdopen( fd: int, mode: OpenBinaryMode, buffering: Literal[0], - encoding: None = ..., + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -539,8 +539,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -550,8 +550,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -561,8 +561,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -572,8 +572,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryMode, - buffering: int = ..., - encoding: None = ..., + buffering: int = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -583,8 +583,8 @@ def fdopen( def fdopen( fd: int, mode: str, - buffering: int = ..., - encoding: str | None = ..., + buffering: int = -1, + encoding: str | None = None, errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., @@ -737,7 +737,7 @@ class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_Scand def close(self) -> None: ... @overload -def scandir(path: None = ...) -> _ScandirIterator[str]: ... +def scandir(path: None = None) -> _ScandirIterator[str]: ... @overload def scandir(path: int) -> _ScandirIterator[str]: ... @overload @@ -758,11 +758,11 @@ def truncate(path: FileDescriptorOrPath, length: int) -> None: ... # Unix only def unlink(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... def utime( path: FileDescriptorOrPath, - times: tuple[int, int] | tuple[float, float] | None = ..., + times: tuple[int, int] | tuple[float, float] | None = None, *, ns: tuple[int, int] = ..., - dir_fd: int | None = ..., - follow_symlinks: bool = ..., + dir_fd: int | None = None, + follow_symlinks: bool = True, ) -> None: ... _OnError: TypeAlias = Callable[[OSError], object] @@ -886,7 +886,7 @@ def times() -> times_result: ... def waitpid(__pid: int, __options: int) -> tuple[int, int]: ... if sys.platform == "win32": - def startfile(path: StrOrBytesPath, operation: str | None = ...) -> None: ... + def startfile(path: StrOrBytesPath, operation: str | None = None) -> None: ... else: def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ... diff --git a/stdlib/pathlib.pyi b/stdlib/pathlib.pyi index fd23484009ff..dd9ecbc1ddd1 100644 --- a/stdlib/pathlib.pyi +++ b/stdlib/pathlib.pyi @@ -106,54 +106,54 @@ class Path(PurePath): @overload def open( self, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + mode: OpenTextMode = "r", + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIOWrapper: ... # Unbuffered binary mode: returns a FileIO @overload def open( - self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @overload def open( self, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedRandom: ... @overload def open( self, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedWriter: ... @overload def open( self, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @overload def open( - self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: int = -1, encoding: None = None, errors: None = None, newline: None = None ) -> BinaryIO: ... # Fallback if mode is not specified @overload def open( - self, mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ... + self, mode: str, buffering: int = -1, encoding: str | None = None, errors: str | None = None, newline: str | None = None ) -> IO[Any]: ... if sys.platform != "win32": # These methods do "exist" on Windows, but they always raise NotImplementedError, @@ -197,7 +197,7 @@ class Path(PurePath): self, data: str, encoding: str | None = None, errors: str | None = None, newline: str | None = None ) -> int: ... else: - def write_text(self, data: str, encoding: str | None = ..., errors: str | None = ...) -> int: ... + def write_text(self, data: str, encoding: str | None = None, errors: str | None = None) -> int: ... if sys.version_info >= (3, 8) and sys.version_info < (3, 12): def link_to(self, target: StrOrBytesPath) -> None: ... if sys.version_info >= (3, 12): diff --git a/stdlib/pickle.pyi b/stdlib/pickle.pyi index 7ebab5a24d1f..dc098cae97b7 100644 --- a/stdlib/pickle.pyi +++ b/stdlib/pickle.pyi @@ -133,10 +133,10 @@ if sys.version_info >= (3, 8): ) -> Any: ... else: - def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ... - def dumps(obj: Any, protocol: int | None = ..., *, fix_imports: bool = ...) -> bytes: ... - def load(file: _ReadableFileobj, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... - def loads(data: ReadableBuffer, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... + def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None, *, fix_imports: bool = True) -> None: ... + def dumps(obj: Any, protocol: int | None = None, *, fix_imports: bool = True) -> bytes: ... + def load(file: _ReadableFileobj, *, fix_imports: bool = True, encoding: str = "ASCII", errors: str = "strict") -> Any: ... + def loads(data: ReadableBuffer, *, fix_imports: bool = True, encoding: str = "ASCII", errors: str = "strict") -> Any: ... class PickleError(Exception): ... class PicklingError(PickleError): ... diff --git a/stdlib/platform.pyi b/stdlib/platform.pyi index c683ba596a25..e65739624603 100644 --- a/stdlib/platform.pyi +++ b/stdlib/platform.pyi @@ -10,18 +10,18 @@ if sys.version_info >= (3, 8): def libc_ver(executable: str | None = None, lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... else: - def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> tuple[str, str]: ... + def libc_ver(executable: str = ..., lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... if sys.version_info < (3, 8): def linux_distribution( - distname: str = ..., - version: str = ..., - id: str = ..., + distname: str = "", + version: str = "", + id: str = "", supported_dists: tuple[str, ...] = ..., full_distribution_name: bool = ..., ) -> tuple[str, str, str]: ... def dist( - distname: str = ..., version: str = ..., id: str = ..., supported_dists: tuple[str, ...] = ... + distname: str = "", version: str = "", id: str = "", supported_dists: tuple[str, ...] = ... ) -> tuple[str, str, str]: ... def win32_ver(release: str = "", version: str = "", csd: str = "", ptype: str = "") -> tuple[str, str, str, str]: ... @@ -37,7 +37,7 @@ def java_ver( release: str = "", vendor: str = "", vminfo: tuple[str, str, str] = ..., osinfo: tuple[str, str, str] = ... ) -> tuple[str, str, tuple[str, str, str], tuple[str, str, str]]: ... def system_alias(system: str, release: str, version: str) -> tuple[str, str, str]: ... -def architecture(executable: str = ..., bits: str = "", linkage: str = "") -> tuple[str, str]: ... +def architecture(executable: str = sys.executable, bits: str = "", linkage: str = "") -> tuple[str, str]: ... class uname_result(NamedTuple): system: str diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index 583c89ab4ca8..54ce3dc61abc 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -56,15 +56,15 @@ else: def load( fp: IO[bytes], *, - fmt: PlistFormat | None = ..., - use_builtin_types: bool = ..., + fmt: PlistFormat | None = None, + use_builtin_types: bool = True, dict_type: type[MutableMapping[str, Any]] = ..., ) -> Any: ... def loads( value: ReadableBuffer, *, - fmt: PlistFormat | None = ..., - use_builtin_types: bool = ..., + fmt: PlistFormat | None = None, + use_builtin_types: bool = True, dict_type: type[MutableMapping[str, Any]] = ..., ) -> Any: ... diff --git a/stdlib/posixpath.pyi b/stdlib/posixpath.pyi index ff9c2482ace5..1945190be5f8 100644 --- a/stdlib/posixpath.pyi +++ b/stdlib/posixpath.pyi @@ -118,9 +118,9 @@ def join(__a: BytesPath, *paths: BytesPath) -> bytes: ... if sys.version_info >= (3, 10): @overload - def realpath(filename: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ... + def realpath(filename: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... @overload - def realpath(filename: AnyStr, *, strict: bool = ...) -> AnyStr: ... + def realpath(filename: AnyStr, *, strict: bool = False) -> AnyStr: ... else: @overload @@ -129,11 +129,11 @@ else: def realpath(filename: AnyStr) -> AnyStr: ... @overload -def relpath(path: LiteralString, start: LiteralString | None = ...) -> LiteralString: ... +def relpath(path: LiteralString, start: LiteralString | None = None) -> LiteralString: ... @overload -def relpath(path: BytesPath, start: BytesPath | None = ...) -> bytes: ... +def relpath(path: BytesPath, start: BytesPath | None = None) -> bytes: ... @overload -def relpath(path: StrPath, start: StrPath | None = ...) -> str: ... +def relpath(path: StrPath, start: StrPath | None = None) -> str: ... @overload def split(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... @overload diff --git a/stdlib/pprint.pyi b/stdlib/pprint.pyi index c10f9a5a1662..5a909c69b077 100644 --- a/stdlib/pprint.pyi +++ b/stdlib/pprint.pyi @@ -21,16 +21,16 @@ if sys.version_info >= (3, 10): elif sys.version_info >= (3, 8): def pformat( object: object, - indent: int = ..., - width: int = ..., - depth: int | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> str: ... else: - def pformat(object: object, indent: int = ..., width: int = ..., depth: int | None = ..., *, compact: bool = ...) -> str: ... + def pformat(object: object, indent: int = 1, width: int = 80, depth: int | None = None, *, compact: bool = False) -> str: ... if sys.version_info >= (3, 10): def pp( @@ -54,7 +54,7 @@ elif sys.version_info >= (3, 8): depth: int | None = ..., *, compact: bool = ..., - sort_dicts: bool = ..., + sort_dicts: bool = False, ) -> None: ... if sys.version_info >= (3, 10): @@ -73,24 +73,24 @@ if sys.version_info >= (3, 10): elif sys.version_info >= (3, 8): def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> None: ... else: def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., + compact: bool = False, ) -> None: ... def isreadable(object: object) -> bool: ... @@ -113,23 +113,23 @@ class PrettyPrinter: elif sys.version_info >= (3, 8): def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> None: ... else: def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., + compact: bool = False, ) -> None: ... def pformat(self, object: object) -> str: ... diff --git a/stdlib/py_compile.pyi b/stdlib/py_compile.pyi index 80222021fbc2..48f1d7dc3e70 100644 --- a/stdlib/py_compile.pyi +++ b/stdlib/py_compile.pyi @@ -32,15 +32,15 @@ if sys.version_info >= (3, 8): else: def compile( file: AnyStr, - cfile: AnyStr | None = ..., - dfile: AnyStr | None = ..., - doraise: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + cfile: AnyStr | None = None, + dfile: AnyStr | None = None, + doraise: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> AnyStr | None: ... if sys.version_info >= (3, 10): def main() -> None: ... else: - def main(args: list[str] | None = ...) -> int: ... + def main(args: list[str] | None = None) -> int: ... diff --git a/stdlib/pyclbr.pyi b/stdlib/pyclbr.pyi index 8b1d923a753f..38658a03139c 100644 --- a/stdlib/pyclbr.pyi +++ b/stdlib/pyclbr.pyi @@ -31,7 +31,7 @@ class Class: ) -> None: ... else: def __init__( - self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = ... + self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = None ) -> None: ... class Function: @@ -60,7 +60,7 @@ class Function: end_lineno: int | None = None, ) -> None: ... else: - def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = ...) -> None: ... + def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = None) -> None: ... def readmodule(module: str, path: Sequence[str] | None = None) -> dict[str, Class]: ... def readmodule_ex(module: str, path: Sequence[str] | None = None) -> dict[str, Class | Function | list[str]]: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index 904550a66223..9bcd8659fc8c 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -88,19 +88,19 @@ class HTMLDoc(Doc): ) -> str: ... def multicolumn(self, list: list[_T], format: Callable[[_T], str]) -> str: ... else: - def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = "") -> str: ... def section( self, title: str, fgcol: str, bgcol: str, contents: str, - width: int = ..., - prelude: str = ..., - marginalia: str | None = ..., - gap: str = ..., + width: int = 6, + prelude: str = "", + marginalia: str | None = None, + gap: str = " ", ) -> str: ... - def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = ...) -> str: ... + def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = 4) -> str: ... def bigsection(self, title: str, *args: Any) -> str: ... def preformat(self, text: str) -> str: ... diff --git a/stdlib/pyexpat/__init__.pyi b/stdlib/pyexpat/__init__.pyi index 7e635c58c933..c6cc7fe24cd7 100644 --- a/stdlib/pyexpat/__init__.pyi +++ b/stdlib/pyexpat/__init__.pyi @@ -76,5 +76,5 @@ def ErrorString(__code: int) -> str: ... # intern is undocumented def ParserCreate( - encoding: str | None = ..., namespace_separator: str | None = ..., intern: dict[str, Any] | None = ... + encoding: str | None = None, namespace_separator: str | None = None, intern: dict[str, Any] | None = None ) -> XMLParserType: ... diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 18a9e1813dae..4849878691f5 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -46,7 +46,7 @@ class Random(_random.Random): if sys.version_info >= (3, 9): def seed(self, a: int | float | str | bytes | bytearray | None = None, version: int = 2) -> None: ... # type: ignore[override] # noqa: Y041 else: - def seed(self, a: Any = ..., version: int = ...) -> None: ... + def seed(self, a: Any = None, version: int = 2) -> None: ... def getstate(self) -> tuple[Any, ...]: ... def setstate(self, state: tuple[Any, ...]) -> None: ... @@ -67,24 +67,24 @@ class Random(_random.Random): if sys.version_info >= (3, 11): def shuffle(self, x: MutableSequence[Any]) -> None: ... else: - def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ... + def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = None) -> None: ... if sys.version_info >= (3, 11): def sample(self, population: Sequence[_T], k: int, *, counts: Iterable[int] | None = None) -> list[_T]: ... elif sys.version_info >= (3, 9): def sample( - self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = ... + self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = None ) -> list[_T]: ... else: def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... def uniform(self, a: float, b: float) -> float: ... - def triangular(self, low: float = ..., high: float = ..., mode: float | None = None) -> float: ... + def triangular(self, low: float = 0.0, high: float = 1.0, mode: float | None = None) -> float: ... def betavariate(self, alpha: float, beta: float) -> float: ... def expovariate(self, lambd: float) -> float: ... def gammavariate(self, alpha: float, beta: float) -> float: ... if sys.version_info >= (3, 11): - def gauss(self, mu: float = ..., sigma: float = ...) -> float: ... - def normalvariate(self, mu: float = ..., sigma: float = ...) -> float: ... + def gauss(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... + def normalvariate(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... else: def gauss(self, mu: float, sigma: float) -> float: ... def normalvariate(self, mu: float, sigma: float) -> float: ... diff --git a/stdlib/re.pyi b/stdlib/re.pyi index 4962ab8edad9..59cd8c8e323f 100644 --- a/stdlib/re.pyi +++ b/stdlib/re.pyi @@ -67,7 +67,9 @@ class Match(Generic[AnyStr]): @overload def expand(self: Match[str], template: str) -> str: ... @overload - def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... + def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... # type: ignore[misc] + @overload + def expand(self, template: AnyStr) -> AnyStr: ... # group() returns "AnyStr" or "AnyStr | None", depending on the pattern. @overload def group(self, __group: Literal[0] = ...) -> AnyStr: ... @@ -113,48 +115,64 @@ class Pattern(Generic[AnyStr]): @property def pattern(self) -> AnyStr: ... @overload - def search(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... + @overload + def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] + @overload + def search(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... + @overload + def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... + @overload + def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... + def match(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload - def match(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... + def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def fullmatch(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload - def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... + def split(self: Pattern[str], string: str, maxsplit: int = 0) -> list[str | Any]: ... @overload - def split(self: Pattern[str], string: str, maxsplit: int = ...) -> list[str | Any]: ... + def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0) -> list[bytes | Any]: ... @overload - def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = ...) -> list[bytes | Any]: ... + def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr | Any]: ... # return type depends on the number of groups in the pattern @overload - def findall(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... @overload - def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... @overload - def finditer(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Iterator[Match[str]]: ... + def findall(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> list[AnyStr]: ... @overload - def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Iterator[Match[bytes]]: ... + def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[str]]: ... @overload - def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ...) -> str: ... + def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[bytes]]: ... # type: ignore[misc] @overload - def sub( + def finditer(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[AnyStr]]: ... + @overload + def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ... + @overload + def sub( # type: ignore[misc] self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., + count: int = 0, ) -> bytes: ... @overload - def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ...) -> tuple[str, int]: ... + def sub(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> AnyStr: ... @overload - def subn( + def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> tuple[str, int]: ... + @overload + def subn( # type: ignore[misc] self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., + count: int = 0, ) -> tuple[bytes, int]: ... + @overload + def subn(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> tuple[AnyStr, int]: ... def __copy__(self) -> Pattern[AnyStr]: ... def __deepcopy__(self, __memo: Any) -> Pattern[AnyStr]: ... if sys.version_info >= (3, 9): @@ -212,58 +230,58 @@ _FlagsType: TypeAlias = int | RegexFlag # pattern arguments do *not* accept arbitrary buffers such as bytearray, # because the pattern must be hashable. @overload -def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def compile(pattern: AnyStr, flags: _FlagsType = 0) -> Pattern[AnyStr]: ... @overload -def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def compile(pattern: Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ... @overload -def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def split(pattern: str | Pattern[str], string: str, maxsplit: int = ..., flags: _FlagsType = ...) -> list[str | Any]: ... +def split(pattern: str | Pattern[str], string: str, maxsplit: int = 0, flags: _FlagsType = 0) -> list[str | Any]: ... @overload def split( - pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = ..., flags: _FlagsType = ... + pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0, flags: _FlagsType = 0 ) -> list[bytes | Any]: ... @overload -def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> list[Any]: ... +def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[Any]: ... @overload -def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> list[Any]: ... +def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[Any]: ... @overload -def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Iterator[Match[str]]: ... +def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Iterator[Match[str]]: ... @overload -def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Iterator[Match[bytes]]: ... +def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Iterator[Match[bytes]]: ... @overload def sub( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: _FlagsType = ... + pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 ) -> str: ... @overload def sub( pattern: bytes | Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., - flags: _FlagsType = ..., + count: int = 0, + flags: _FlagsType = 0, ) -> bytes: ... @overload def subn( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: _FlagsType = ... + pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 ) -> tuple[str, int]: ... @overload def subn( pattern: bytes | Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., - flags: _FlagsType = ..., + count: int = 0, + flags: _FlagsType = 0, ) -> tuple[bytes, int]: ... def escape(pattern: AnyStr) -> AnyStr: ... def purge() -> None: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 0f088268e95f..b0714690e8fd 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -47,18 +47,18 @@ class ExecError(OSError): ... class ReadError(OSError): ... class RegistryError(Exception): ... -def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = 0) -> None: ... +def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = ...) -> None: ... def copyfile(src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: bool = True) -> _StrOrBytesPathT: ... def copymode(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... @overload -def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy2(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy2(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = True) -> _PathReturn: ... def ignore_patterns(*patterns: StrPath) -> Callable[[Any, list[str]], set[str]]: ... if sys.version_info >= (3, 8): @@ -76,10 +76,10 @@ else: def copytree( src: StrPath, dst: StrPath, - symlinks: bool = ..., - ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., + symlinks: bool = False, + ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = None, copy_function: Callable[[str, str], object] = ..., - ignore_dangling_symlinks: bool = ..., + ignore_dangling_symlinks: bool = False, ) -> _PathReturn: ... _OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], object] @@ -124,9 +124,9 @@ def disk_usage(path: FileDescriptorOrPath) -> _ntuple_diskusage: ... # see https://bugs.python.org/issue33140. We keep it here because it's # in __all__. @overload -def chown(path: StrOrBytesPath, user: str | int, group: None = ...) -> None: ... +def chown(path: StrOrBytesPath, user: str | int, group: None = None) -> None: ... @overload -def chown(path: StrOrBytesPath, user: None = ..., *, group: str | int) -> None: ... +def chown(path: StrOrBytesPath, user: None = None, *, group: str | int) -> None: ... @overload def chown(path: StrOrBytesPath, user: None, group: str | int) -> None: ... @overload @@ -134,12 +134,12 @@ def chown(path: StrOrBytesPath, user: str | int, group: str | int) -> None: ... if sys.version_info >= (3, 8): @overload - def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... + def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ... @overload - def which(cmd: bytes, mode: int = ..., path: StrPath | None = ...) -> bytes | None: ... + def which(cmd: bytes, mode: int = 1, path: StrPath | None = None) -> bytes | None: ... else: - def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... + def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ... def make_archive( base_name: str, @@ -155,11 +155,11 @@ def make_archive( def get_archive_formats() -> list[tuple[str, str]]: ... @overload def register_archive_format( - name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... + name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = "" ) -> None: ... @overload def register_archive_format( - name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_archive_format(name: str) -> None: ... def unpack_archive(filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None) -> None: ... @@ -169,11 +169,11 @@ def register_unpack_format( extensions: list[str], function: Callable[..., object], extra_args: Sequence[tuple[str, Any]], - description: str = ..., + description: str = "", ) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... diff --git a/stdlib/smtpd.pyi b/stdlib/smtpd.pyi index 7392bd51627d..a83e827bfc76 100644 --- a/stdlib/smtpd.pyi +++ b/stdlib/smtpd.pyi @@ -41,7 +41,7 @@ class SMTPChannel(asynchat.async_chat): server: SMTPServer, conn: socket.socket, addr: Any, - data_size_limit: int = 33554432, + data_size_limit: int = ..., map: asyncore._MapType | None = None, enable_SMTPUTF8: bool = False, decode_data: bool = False, @@ -71,7 +71,7 @@ class SMTPServer(asyncore.dispatcher): self, localaddr: _Address, remoteaddr: _Address, - data_size_limit: int = 33554432, + data_size_limit: int = ..., map: asyncore._MapType | None = None, enable_SMTPUTF8: bool = False, decode_data: bool = False, diff --git a/stdlib/smtplib.pyi b/stdlib/smtplib.pyi index 8325a4c79677..d0d674242bf8 100644 --- a/stdlib/smtplib.pyi +++ b/stdlib/smtplib.pyi @@ -122,7 +122,7 @@ class SMTP: password: str def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = True) -> _Reply: ... @overload - def auth_cram_md5(self, challenge: None = ...) -> None: ... + def auth_cram_md5(self, challenge: None = None) -> None: ... @overload def auth_cram_md5(self, challenge: ReadableBuffer) -> str: ... def auth_plain(self, challenge: ReadableBuffer | None = None) -> str: ... @@ -178,5 +178,9 @@ class LMTP(SMTP): ) -> None: ... else: def __init__( - self, host: str = ..., port: int = ..., local_hostname: str | None = ..., source_address: _SourceAddress | None = ... + self, + host: str = "", + port: int = 2003, + local_hostname: str | None = None, + source_address: _SourceAddress | None = None, ) -> None: ... diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index 41f3e7d3da9b..4481f398867c 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -669,39 +669,39 @@ class socket(_socket.socket): mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], buffering: Literal[0], *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> SocketIO: ... @overload def makefile( self, mode: Literal["rwb", "rbw", "wrb", "wbr", "brw", "bwr"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedRWPair: ... @overload def makefile( self, mode: Literal["rb", "br"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedReader: ... @overload def makefile( self, mode: Literal["wb", "bw"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedWriter: ... @overload def makefile( @@ -709,19 +709,19 @@ class socket(_socket.socket): mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], buffering: int, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> IOBase: ... @overload def makefile( self, - mode: Literal["r", "w", "rw", "wr", ""] = ..., - buffering: int | None = ..., + mode: Literal["r", "w", "rw", "wr", ""] = "r", + buffering: int | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIOWrapper: ... def sendfile(self, file: _SendableFile, offset: int = 0, count: int | None = None) -> int: ... @property @@ -744,11 +744,11 @@ if sys.platform == "win32": def fromshare(info: bytes) -> socket: ... if sys.platform == "win32": - def socketpair(family: int = ..., type: int = ..., proto: int = ...) -> tuple[socket, socket]: ... + def socketpair(family: int = ..., type: int = ..., proto: int = 0) -> tuple[socket, socket]: ... else: def socketpair( - family: int | AddressFamily | None = None, type: SocketType | int = 1, proto: int = 0 + family: int | AddressFamily | None = None, type: SocketType | int = ..., proto: int = 0 ) -> tuple[socket, socket]: ... class SocketIO(RawIOBase): @@ -773,7 +773,7 @@ if sys.version_info >= (3, 11): else: def create_connection( - address: tuple[str | None, int], timeout: float | None = ..., source_address: _Address | None = ... # noqa: F811 + address: tuple[str | None, int], timeout: float | None = ..., source_address: _Address | None = None # noqa: F811 ) -> socket: ... if sys.version_info >= (3, 8): diff --git a/stdlib/socketserver.pyi b/stdlib/socketserver.pyi index b593e77c5f23..b35f1553fb44 100644 --- a/stdlib/socketserver.pyi +++ b/stdlib/socketserver.pyi @@ -52,7 +52,7 @@ class BaseServer: def RequestHandlerClass(self: Self, val: Callable[[Any, _RetAddress, Self], BaseRequestHandler]) -> None: ... def fileno(self) -> int: ... def handle_request(self) -> None: ... - def serve_forever(self, poll_interval: float = ...) -> None: ... + def serve_forever(self, poll_interval: float = 0.5) -> None: ... def shutdown(self) -> None: ... def server_close(self) -> None: ... def finish_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index d018c2dd5532..ac72c69ba97d 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -349,7 +349,7 @@ class Connection: pages: int = -1, progress: Callable[[int, int, int], object] | None = None, name: str = "main", - sleep: float = ..., + sleep: float = 0.25, ) -> None: ... if sys.version_info >= (3, 11): def setlimit(self, __category: int, __limit: int) -> int: ... diff --git a/stdlib/sre_constants.pyi b/stdlib/sre_constants.pyi index 2ca12f7e6e0d..fe25eaf9728e 100644 --- a/stdlib/sre_constants.pyi +++ b/stdlib/sre_constants.pyi @@ -79,6 +79,10 @@ REPEAT: _NamedIntConstant REPEAT_ONE: _NamedIntConstant SUBPATTERN: _NamedIntConstant MIN_REPEAT_ONE: _NamedIntConstant +if sys.version_info >= (3, 11): + ATOMIC_GROUP: _NamedIntConstant + POSSESSIVE_REPEAT: _NamedIntConstant + POSSESSIVE_REPEAT_ONE: _NamedIntConstant RANGE_UNI_IGNORE: _NamedIntConstant GROUPREF_LOC_IGNORE: _NamedIntConstant GROUPREF_UNI_IGNORE: _NamedIntConstant diff --git a/stdlib/sre_parse.pyi b/stdlib/sre_parse.pyi index e137e191c08d..56f10bb41d57 100644 --- a/stdlib/sre_parse.pyi +++ b/stdlib/sre_parse.pyi @@ -55,7 +55,7 @@ class SubPattern: def __init__(self, state: State, data: list[_CodeType] | None = None) -> None: ... else: pattern: Pattern - def __init__(self, pattern: Pattern, data: list[_CodeType] | None = ...) -> None: ... + def __init__(self, pattern: Pattern, data: list[_CodeType] | None = None) -> None: ... def dump(self, level: int = 0) -> None: ... def __len__(self) -> int: ... @@ -102,7 +102,7 @@ if sys.version_info >= (3, 8): def parse_template(source: bytes, state: _Pattern[Any]) -> _TemplateByteType: ... else: - def parse(str: str, flags: int = ..., pattern: Pattern | None = ...) -> SubPattern: ... + def parse(str: str, flags: int = 0, pattern: Pattern | None = None) -> SubPattern: ... @overload def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ... @overload diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index 6fd967ae5b9d..3b68d107246a 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -324,7 +324,7 @@ class SSLSocket(socket.socket): def send(self, data: ReadableBuffer, flags: int = 0) -> int: ... def sendall(self, data: ReadableBuffer, flags: int = 0) -> None: ... @overload - def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address, addr: None = ...) -> int: ... + def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address, addr: None = None) -> int: ... @overload def sendto(self, data: ReadableBuffer, flags_or_addr: int, addr: socket._Address) -> int: ... def shutdown(self, how: int) -> None: ... @@ -332,7 +332,7 @@ class SSLSocket(socket.socket): def write(self, data: ReadableBuffer) -> int: ... def do_handshake(self, block: bool = False) -> None: ... # block is undocumented @overload - def getpeercert(self, binary_form: Literal[False] = ...) -> _PeerCertRetDictType | None: ... + def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... @overload def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... @overload @@ -393,11 +393,11 @@ class SSLContext: cadata: str | ReadableBuffer | None = None, ) -> None: ... @overload - def get_ca_certs(self, binary_form: Literal[False] = ...) -> list[_PeerCertRetDictType]: ... + def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]: ... @overload def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]: ... @overload - def get_ca_certs(self, binary_form: bool = ...) -> Any: ... + def get_ca_certs(self, binary_form: bool = False) -> Any: ... def get_ciphers(self) -> list[_Cipher]: ... def set_default_verify_paths(self) -> None: ... def set_ciphers(self, __cipherlist: str) -> None: ... @@ -438,7 +438,7 @@ class SSLObject: def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... def write(self, data: ReadableBuffer) -> int: ... @overload - def getpeercert(self, binary_form: Literal[False] = ...) -> _PeerCertRetDictType | None: ... + def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... @overload def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... @overload diff --git a/stdlib/statistics.pyi b/stdlib/statistics.pyi index 99dba9a58217..5fa519edf858 100644 --- a/stdlib/statistics.pyi +++ b/stdlib/statistics.pyi @@ -58,7 +58,7 @@ def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichCompariso def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... if sys.version_info >= (3, 11): - def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = ...) -> float: ... + def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = 1.0) -> float: ... else: def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT | float: ... @@ -81,7 +81,7 @@ def variance(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT if sys.version_info >= (3, 8): class NormalDist: - def __init__(self, mu: float = ..., sigma: float = ...) -> None: ... + def __init__(self, mu: float = 0.0, sigma: float = 1.0) -> None: ... @property def mean(self) -> float: ... @property diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index a417f34b074e..35a7b7e34f6b 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -118,13 +118,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -152,13 +152,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -186,13 +186,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -221,13 +221,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -255,13 +255,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -289,13 +289,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -326,13 +326,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -359,13 +359,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -392,13 +392,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -426,13 +426,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -459,13 +459,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -492,13 +492,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -528,13 +528,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -560,13 +560,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -592,13 +592,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -625,13 +625,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -657,13 +657,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -689,13 +689,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -723,13 +723,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -751,13 +751,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -779,13 +779,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -808,13 +808,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -836,13 +836,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[bytes]: ... @overload def run( @@ -864,13 +864,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[Any]: ... # Same args as Popen.__init__ @@ -926,7 +926,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, text: bool | None = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -956,7 +956,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, text: bool | None = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -984,7 +984,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, text: bool | None = ..., ) -> int: ... @@ -1124,7 +1124,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1155,7 +1155,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1186,7 +1186,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1218,7 +1218,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1249,7 +1249,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1280,7 +1280,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1314,7 +1314,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1344,7 +1344,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1374,7 +1374,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1405,7 +1405,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1435,7 +1435,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1465,7 +1465,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1498,7 +1498,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1527,7 +1527,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1556,7 +1556,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1586,7 +1586,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1615,7 +1615,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1644,7 +1644,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1675,7 +1675,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1700,7 +1700,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1725,7 +1725,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1751,7 +1751,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1776,7 +1776,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1801,7 +1801,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1855,188 +1855,188 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... elif sys.version_info >= (3, 10): # pipesize is added in 3.10 @@ -2044,182 +2044,182 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... elif sys.version_info >= (3, 9): # user, group, extra_groups, umask were added in 3.9 @@ -2227,328 +2227,328 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... else: @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... def poll(self) -> int | None: ... @@ -2587,12 +2587,12 @@ if sys.platform == "win32": def __init__( self, *, - dwFlags: int = ..., - hStdInput: Any | None = ..., - hStdOutput: Any | None = ..., - hStdError: Any | None = ..., - wShowWindow: int = ..., - lpAttributeList: Mapping[str, Any] | None = ..., + dwFlags: int = 0, + hStdInput: Any | None = None, + hStdOutput: Any | None = None, + hStdError: Any | None = None, + wShowWindow: int = 0, + lpAttributeList: Mapping[str, Any] | None = None, ) -> None: ... dwFlags: int hStdInput: Any | None diff --git a/stdlib/sunau.pyi b/stdlib/sunau.pyi index bae55f645854..7702443b0c1c 100644 --- a/stdlib/sunau.pyi +++ b/stdlib/sunau.pyi @@ -78,7 +78,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Au_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Au_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): openfp = open diff --git a/stdlib/symtable.pyi b/stdlib/symtable.pyi index 84d3110f9342..304ae8bf8126 100644 --- a/stdlib/symtable.pyi +++ b/stdlib/symtable.pyi @@ -42,7 +42,7 @@ class Symbol: ) -> None: ... def is_nonlocal(self) -> bool: ... else: - def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = ...) -> None: ... + def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = None) -> None: ... def get_name(self) -> str: ... def is_referenced(self) -> bool: ... diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index 656d024761c0..873a2b635b7e 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -186,9 +186,9 @@ class TarFile: def gzopen( cls: type[Self], name: StrOrBytesPath | None, - mode: Literal["r"] = ..., - fileobj: _GzipReadableFileobj | None = ..., - compresslevel: int = ..., + mode: Literal["r"] = "r", + fileobj: _GzipReadableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -205,8 +205,8 @@ class TarFile: cls: type[Self], name: StrOrBytesPath | None, mode: Literal["w", "x"], - fileobj: _GzipWritableFileobj | None = ..., - compresslevel: int = ..., + fileobj: _GzipWritableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -223,8 +223,8 @@ class TarFile: cls: type[Self], name: StrOrBytesPath | None, mode: Literal["w", "x"], - fileobj: _Bz2WritableFileobj | None = ..., - compresslevel: int = ..., + fileobj: _Bz2WritableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -240,9 +240,9 @@ class TarFile: def bz2open( cls: type[Self], name: StrOrBytesPath | None, - mode: Literal["r"] = ..., - fileobj: _Bz2ReadableFileobj | None = ..., - compresslevel: int = ..., + mode: Literal["r"] = "r", + fileobj: _Bz2ReadableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -354,7 +354,7 @@ class TarInfo: @linkpath.setter def linkpath(self, linkname: str) -> None: ... def get_info(self) -> Mapping[str, str | int | bytes | Mapping[str, str]]: ... - def tobuf(self, format: int | None = 2, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... + def tobuf(self, format: int | None = ..., encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... def create_ustar_header( self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str, errors: str ) -> bytes: ... diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 49162c444c78..301ba4efd5ba 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -37,76 +37,76 @@ if sys.version_info >= (3, 8): @overload def NamedTemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[Any]: ... else: @overload def NamedTemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[Any]: ... if sys.platform == "win32": @@ -235,44 +235,44 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): @overload def __init__( self: SpooledTemporaryFile[bytes], - max_size: int = ..., - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self: SpooledTemporaryFile[str], - max_size: int = ..., + max_size: int = 0, mode: _StrMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self, - max_size: int = ..., - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @property def errors(self) -> str | None: ... @@ -280,38 +280,38 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): @overload def __init__( self: SpooledTemporaryFile[bytes], - max_size: int = ..., - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _BytesMode = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... @overload def __init__( self: SpooledTemporaryFile[str], - max_size: int = ..., + max_size: int = 0, mode: _StrMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... @overload def __init__( self, - max_size: int = ..., - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: str = "w+b", + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... def rollover(self) -> None: ... @@ -355,27 +355,30 @@ class TemporaryDirectory(Generic[AnyStr]): @overload def __init__( self: TemporaryDirectory[str], - suffix: str | None = ..., - prefix: str | None = ..., - dir: StrPath | None = ..., - ignore_cleanup_errors: bool = ..., + suffix: str | None = None, + prefix: str | None = None, + dir: StrPath | None = None, + ignore_cleanup_errors: bool = False, ) -> None: ... @overload def __init__( self: TemporaryDirectory[bytes], - suffix: bytes | None = ..., - prefix: bytes | None = ..., - dir: BytesPath | None = ..., - ignore_cleanup_errors: bool = ..., + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: BytesPath | None = None, + ignore_cleanup_errors: bool = False, ) -> None: ... else: @overload def __init__( - self: TemporaryDirectory[str], suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ... + self: TemporaryDirectory[str], suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None ) -> None: ... @overload def __init__( - self: TemporaryDirectory[bytes], suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ... + self: TemporaryDirectory[bytes], + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: BytesPath | None = None, ) -> None: ... def cleanup(self) -> None: ... @@ -387,18 +390,18 @@ class TemporaryDirectory(Generic[AnyStr]): # The overloads overlap, but they should still work fine. @overload def mkstemp( # type: ignore[misc] - suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ..., text: bool = ... + suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None, text: bool = False ) -> tuple[int, str]: ... @overload def mkstemp( - suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ..., text: bool = ... + suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None, text: bool = False ) -> tuple[int, bytes]: ... # The overloads overlap, but they should still work fine. @overload -def mkdtemp(suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ...) -> str: ... # type: ignore[misc] +def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... # type: ignore[misc] @overload -def mkdtemp(suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ...) -> bytes: ... +def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ... def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ... def gettempdirb() -> bytes: ... def gettempprefixb() -> bytes: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 699dfd2a408a..f4ffaa6b159f 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -269,7 +269,7 @@ def NoDefaultRoot() -> None: ... _TraceMode: TypeAlias = Literal["array", "read", "write", "unset"] class Variable: - def __init__(self, master: Misc | None = ..., value: Incomplete | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: Incomplete | None = None, name: str | None = None) -> None: ... def set(self, value) -> None: ... initialize = set def get(self): ... @@ -283,30 +283,30 @@ class Variable: def __eq__(self, other: object) -> bool: ... class StringVar(Variable): - def __init__(self, master: Misc | None = ..., value: str | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: str | None = None, name: str | None = None) -> None: ... def set(self, value: str) -> None: ... initialize = set def get(self) -> str: ... class IntVar(Variable): - def __init__(self, master: Misc | None = ..., value: int | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: int | None = None, name: str | None = None) -> None: ... def set(self, value: int) -> None: ... initialize = set def get(self) -> int: ... class DoubleVar(Variable): - def __init__(self, master: Misc | None = ..., value: float | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: float | None = None, name: str | None = None) -> None: ... def set(self, value: float) -> None: ... initialize = set def get(self) -> float: ... class BooleanVar(Variable): - def __init__(self, master: Misc | None = ..., value: bool | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: bool | None = None, name: str | None = None) -> None: ... def set(self, value: bool) -> None: ... initialize = set def get(self) -> bool: ... -def mainloop(n: int = ...) -> None: ... +def mainloop(n: int = 0) -> None: ... getint: Incomplete getdouble: Incomplete @@ -325,15 +325,15 @@ class Misc: children: dict[str, Widget] def destroy(self) -> None: ... def deletecommand(self, name: str) -> None: ... - def tk_strictMotif(self, boolean: Incomplete | None = ...): ... + def tk_strictMotif(self, boolean: Incomplete | None = None): ... def tk_bisque(self) -> None: ... def tk_setPalette(self, *args, **kw) -> None: ... - def wait_variable(self, name: str | Variable = ...) -> None: ... + def wait_variable(self, name: str | Variable = "PY_VAR") -> None: ... waitvar = wait_variable - def wait_window(self, window: Misc | None = ...) -> None: ... - def wait_visibility(self, window: Misc | None = ...) -> None: ... - def setvar(self, name: str = ..., value: str = ...) -> None: ... - def getvar(self, name: str = ...): ... + def wait_window(self, window: Misc | None = None) -> None: ... + def wait_visibility(self, window: Misc | None = None) -> None: ... + def setvar(self, name: str = "PY_VAR", value: str = "1") -> None: ... + def getvar(self, name: str = "PY_VAR"): ... def getint(self, s): ... def getdouble(self, s): ... def getboolean(self, s): ... @@ -347,13 +347,13 @@ class Misc: def tk_focusNext(self) -> Misc | None: ... def tk_focusPrev(self) -> Misc | None: ... @overload - def after(self, ms: int, func: None = ...) -> None: ... + def after(self, ms: int, func: None = None) -> None: ... @overload def after(self, ms: int | Literal["idle"], func: Callable[..., object], *args: Any) -> str: ... # after_idle is essentially partialmethod(after, "idle") def after_idle(self, func: Callable[..., object], *args: Any) -> str: ... def after_cancel(self, id: str) -> None: ... - def bell(self, displayof: Literal[0] | Misc | None = ...) -> None: ... + def bell(self, displayof: Literal[0] | Misc | None = 0) -> None: ... def clipboard_get(self, *, displayof: Misc = ..., type: str = ...) -> str: ... def clipboard_clear(self, *, displayof: Misc = ...) -> None: ... def clipboard_append(self, string: str, *, displayof: Misc = ..., format: str = ..., type: str = ...) -> None: ... @@ -363,42 +363,42 @@ class Misc: def grab_set_global(self) -> None: ... def grab_status(self) -> Literal["local", "global"] | None: ... def option_add( - self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = ... + self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = None ) -> None: ... def option_clear(self) -> None: ... def option_get(self, name, className): ... - def option_readfile(self, fileName, priority: Incomplete | None = ...) -> None: ... + def option_readfile(self, fileName, priority: Incomplete | None = None) -> None: ... def selection_clear(self, **kw) -> None: ... def selection_get(self, **kw): ... def selection_handle(self, command, **kw) -> None: ... def selection_own(self, **kw) -> None: ... def selection_own_get(self, **kw): ... def send(self, interp, cmd, *args): ... - def lower(self, belowThis: Incomplete | None = ...) -> None: ... - def tkraise(self, aboveThis: Incomplete | None = ...) -> None: ... + def lower(self, belowThis: Incomplete | None = None) -> None: ... + def tkraise(self, aboveThis: Incomplete | None = None) -> None: ... lift = tkraise if sys.version_info >= (3, 11): def info_patchlevel(self) -> _VersionInfoType: ... - def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...) -> int: ... - def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...) -> str: ... + def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = 0) -> int: ... + def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = 0) -> str: ... def winfo_cells(self) -> int: ... def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk def winfo_class(self) -> str: ... def winfo_colormapfull(self) -> bool: ... - def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = ...) -> Misc | None: ... + def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = 0) -> Misc | None: ... def winfo_depth(self) -> int: ... def winfo_exists(self) -> bool: ... def winfo_fpixels(self, number: _ScreenUnits) -> float: ... def winfo_geometry(self) -> str: ... def winfo_height(self) -> int: ... def winfo_id(self) -> int: ... - def winfo_interps(self, displayof: Literal[0] | Misc | None = ...) -> tuple[str, ...]: ... + def winfo_interps(self, displayof: Literal[0] | Misc | None = 0) -> tuple[str, ...]: ... def winfo_ismapped(self) -> bool: ... def winfo_manager(self) -> str: ... def winfo_name(self) -> str: ... def winfo_parent(self) -> str: ... # return value needs nametowidget() - def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = ...): ... + def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = 0): ... def winfo_pixels(self, number: _ScreenUnits) -> int: ... def winfo_pointerx(self) -> int: ... def winfo_pointerxy(self) -> tuple[int, int]: ... @@ -421,7 +421,7 @@ class Misc: def winfo_viewable(self) -> bool: ... def winfo_visual(self) -> str: ... def winfo_visualid(self) -> str: ... - def winfo_visualsavailable(self, includeids: int = ...) -> list[tuple[str, int]]: ... + def winfo_visualsavailable(self, includeids: int = False) -> list[tuple[str, int]]: ... def winfo_vrootheight(self) -> int: ... def winfo_vrootwidth(self) -> int: ... def winfo_vrootx(self) -> int: ... @@ -432,7 +432,7 @@ class Misc: def update(self) -> None: ... def update_idletasks(self) -> None: ... @overload - def bindtags(self, tagList: None = ...) -> tuple[str, ...]: ... + def bindtags(self, tagList: None = None) -> tuple[str, ...]: ... @overload def bindtags(self, tagList: list[str] | tuple[str, ...]) -> None: ... # bind with isinstance(func, str) doesn't return anything, but all other @@ -440,49 +440,49 @@ class Misc: @overload def bind( self, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... # There's no way to know what type of widget bind_all and bind_class # callbacks will get, so those are Misc. @overload def bind_all( self, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload def bind_class( self, className: str, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def unbind(self, sequence: str, funcid: str | None = ...) -> None: ... + def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def unbind(self, sequence: str, funcid: str | None = None) -> None: ... def unbind_all(self, sequence: str) -> None: ... def unbind_class(self, className: str, sequence: str) -> None: ... - def mainloop(self, n: int = ...) -> None: ... + def mainloop(self, n: int = 0) -> None: ... def quit(self) -> None: ... @property def _windowingsystem(self) -> Literal["win32", "aqua", "x11"]: ... def nametowidget(self, name: str | Misc | _tkinter.Tcl_Obj) -> Any: ... def register( - self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = ..., needcleanup: int = ... + self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = None, needcleanup: int = 1 ) -> str: ... def keys(self) -> list[str]: ... @overload @@ -490,14 +490,14 @@ class Misc: @overload def pack_propagate(self) -> None: ... propagate = pack_propagate - def grid_anchor(self, anchor: _Anchor | None = ...) -> None: ... + def grid_anchor(self, anchor: _Anchor | None = None) -> None: ... anchor = grid_anchor @overload def grid_bbox( - self, column: None = ..., row: None = ..., col2: None = ..., row2: None = ... + self, column: None = None, row: None = None, col2: None = None, row2: None = None ) -> tuple[int, int, int, int] | None: ... @overload - def grid_bbox(self, column: int, row: int, col2: None = ..., row2: None = ...) -> tuple[int, int, int, int] | None: ... + def grid_bbox(self, column: int, row: int, col2: None = None, row2: None = None) -> tuple[int, int, int, int] | None: ... @overload def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> tuple[int, int, int, int] | None: ... bbox = grid_bbox @@ -532,7 +532,7 @@ class Misc: size = grid_size # Widget because Toplevel or Tk is never a slave def pack_slaves(self) -> list[Widget]: ... - def grid_slaves(self, row: int | None = ..., column: int | None = ...) -> list[Widget]: ... + def grid_slaves(self, row: int | None = None, column: int | None = None) -> list[Widget]: ... def place_slaves(self) -> list[Widget]: ... slaves = pack_slaves def event_add(self, virtual: str, *sequences: str) -> None: ... @@ -569,14 +569,14 @@ class Misc: x: _ScreenUnits = ..., y: _ScreenUnits = ..., ) -> None: ... - def event_info(self, virtual: str | None = ...) -> tuple[str, ...]: ... + def event_info(self, virtual: str | None = None) -> tuple[str, ...]: ... def image_names(self) -> tuple[str, ...]: ... def image_types(self) -> tuple[str, ...]: ... # See #4363 and #4891 def __setitem__(self, key: str, value: Any) -> None: ... def __getitem__(self, key: str) -> Any: ... def cget(self, key: str) -> Any: ... - def configure(self, cnf: Any = ...) -> Any: ... + def configure(self, cnf: Any = None) -> Any: ... # TODO: config is an alias of configure, but adding that here creates lots of mypy errors class CallWrapper: @@ -613,7 +613,7 @@ class Wm: def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ... @overload def wm_aspect( - self, minNumer: None = ..., minDenom: None = ..., maxNumer: None = ..., maxDenom: None = ... + self, minNumer: None = None, minDenom: None = None, maxNumer: None = None, maxDenom: None = None ) -> tuple[int, int, int, int] | None: ... aspect = wm_aspect @overload @@ -623,7 +623,7 @@ class Wm: @overload def wm_attributes(self, __option: str, __value, *__other_option_value_pairs: Any) -> None: ... attributes = wm_attributes - def wm_client(self, name: str | None = ...) -> str: ... + def wm_client(self, name: str | None = None) -> str: ... client = wm_client @overload def wm_colormapwindows(self) -> list[Misc]: ... @@ -632,91 +632,91 @@ class Wm: @overload def wm_colormapwindows(self, __first_wlist_item: Misc, *other_wlist_items: Misc) -> None: ... colormapwindows = wm_colormapwindows - def wm_command(self, value: str | None = ...) -> str: ... + def wm_command(self, value: str | None = None) -> str: ... command = wm_command # Some of these always return empty string, but return type is set to None to prevent accidentally using it def wm_deiconify(self) -> None: ... deiconify = wm_deiconify - def wm_focusmodel(self, model: Literal["active", "passive"] | None = ...) -> Literal["active", "passive", ""]: ... + def wm_focusmodel(self, model: Literal["active", "passive"] | None = None) -> Literal["active", "passive", ""]: ... focusmodel = wm_focusmodel def wm_forget(self, window: Wm) -> None: ... forget = wm_forget def wm_frame(self) -> str: ... frame = wm_frame @overload - def wm_geometry(self, newGeometry: None = ...) -> str: ... + def wm_geometry(self, newGeometry: None = None) -> str: ... @overload def wm_geometry(self, newGeometry: str) -> None: ... geometry = wm_geometry def wm_grid( self, - baseWidth: Incomplete | None = ..., - baseHeight: Incomplete | None = ..., - widthInc: Incomplete | None = ..., - heightInc: Incomplete | None = ..., + baseWidth: Incomplete | None = None, + baseHeight: Incomplete | None = None, + widthInc: Incomplete | None = None, + heightInc: Incomplete | None = None, ): ... grid = wm_grid - def wm_group(self, pathName: Incomplete | None = ...): ... + def wm_group(self, pathName: Incomplete | None = None): ... group = wm_group - def wm_iconbitmap(self, bitmap: Incomplete | None = ..., default: Incomplete | None = ...): ... + def wm_iconbitmap(self, bitmap: Incomplete | None = None, default: Incomplete | None = None): ... iconbitmap = wm_iconbitmap def wm_iconify(self) -> None: ... iconify = wm_iconify - def wm_iconmask(self, bitmap: Incomplete | None = ...): ... + def wm_iconmask(self, bitmap: Incomplete | None = None): ... iconmask = wm_iconmask - def wm_iconname(self, newName: Incomplete | None = ...) -> str: ... + def wm_iconname(self, newName: Incomplete | None = None) -> str: ... iconname = wm_iconname def wm_iconphoto(self, default: bool, __image1: Image, *args: Image) -> None: ... iconphoto = wm_iconphoto - def wm_iconposition(self, x: int | None = ..., y: int | None = ...) -> tuple[int, int] | None: ... + def wm_iconposition(self, x: int | None = None, y: int | None = None) -> tuple[int, int] | None: ... iconposition = wm_iconposition - def wm_iconwindow(self, pathName: Incomplete | None = ...): ... + def wm_iconwindow(self, pathName: Incomplete | None = None): ... iconwindow = wm_iconwindow def wm_manage(self, widget) -> None: ... manage = wm_manage @overload - def wm_maxsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ... + def wm_maxsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... @overload def wm_maxsize(self, width: int, height: int) -> None: ... maxsize = wm_maxsize @overload - def wm_minsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ... + def wm_minsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... @overload def wm_minsize(self, width: int, height: int) -> None: ... minsize = wm_minsize @overload - def wm_overrideredirect(self, boolean: None = ...) -> bool | None: ... # returns True or None + def wm_overrideredirect(self, boolean: None = None) -> bool | None: ... # returns True or None @overload def wm_overrideredirect(self, boolean: bool) -> None: ... overrideredirect = wm_overrideredirect - def wm_positionfrom(self, who: Literal["program", "user"] | None = ...) -> Literal["", "program", "user"]: ... + def wm_positionfrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... positionfrom = wm_positionfrom @overload def wm_protocol(self, name: str, func: Callable[[], object] | str) -> None: ... @overload - def wm_protocol(self, name: str, func: None = ...) -> str: ... + def wm_protocol(self, name: str, func: None = None) -> str: ... @overload - def wm_protocol(self, name: None = ..., func: None = ...) -> tuple[str, ...]: ... + def wm_protocol(self, name: None = None, func: None = None) -> tuple[str, ...]: ... protocol = wm_protocol @overload - def wm_resizable(self, width: None = ..., height: None = ...) -> tuple[bool, bool]: ... + def wm_resizable(self, width: None = None, height: None = None) -> tuple[bool, bool]: ... @overload def wm_resizable(self, width: bool, height: bool) -> None: ... resizable = wm_resizable - def wm_sizefrom(self, who: Literal["program", "user"] | None = ...) -> Literal["", "program", "user"]: ... + def wm_sizefrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... sizefrom = wm_sizefrom @overload - def wm_state(self, newstate: None = ...) -> str: ... + def wm_state(self, newstate: None = None) -> str: ... @overload def wm_state(self, newstate: str) -> None: ... state = wm_state @overload - def wm_title(self, string: None = ...) -> str: ... + def wm_title(self, string: None = None) -> str: ... @overload def wm_title(self, string: str) -> None: ... title = wm_title @overload - def wm_transient(self, master: None = ...) -> _tkinter.Tcl_Obj: ... + def wm_transient(self, master: None = None) -> _tkinter.Tcl_Obj: ... @overload def wm_transient(self, master: Wm | _tkinter.Tcl_Obj) -> None: ... transient = wm_transient @@ -733,17 +733,17 @@ class Tk(Misc, Wm): # args. # use `git grep screenName` to find them self, - screenName: str | None = ..., - baseName: str | None = ..., - className: str = ..., + screenName: str | None = None, + baseName: str | None = None, + className: str = "Tk", useTk: bool = ..., sync: bool = ..., - use: str | None = ..., + use: str | None = None, ) -> None: ... @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -800,7 +800,7 @@ class Tk(Misc, Wm): def wantobjects(self, *args, **kwargs): ... def willdispatch(self): ... -def Tcl(screenName: str | None = ..., baseName: str | None = ..., className: str = ..., useTk: bool = ...) -> Tk: ... +def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = "Tk", useTk: bool = ...) -> Tk: ... _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) @@ -931,14 +931,14 @@ class Widget(BaseWidget, Pack, Place, Grid): @overload def bind( self: _W, - sequence: str | None = ..., - func: Callable[[Event[_W]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[_W]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... class Toplevel(BaseWidget, Wm): # Toplevel and Tk have the same options because they correspond to the same @@ -946,7 +946,7 @@ class Toplevel(BaseWidget, Wm): # copy/pasted here instead of aliasing as 'config = Tk.config'. def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -976,7 +976,7 @@ class Toplevel(BaseWidget, Wm): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1002,7 +1002,7 @@ class Toplevel(BaseWidget, Wm): class Button(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -1051,7 +1051,7 @@ class Button(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -1099,7 +1099,7 @@ class Button(Widget): class Canvas(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -1142,7 +1142,7 @@ class Canvas(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1187,8 +1187,8 @@ class Canvas(Widget, XView, YView): newtag: str, x: _ScreenUnits, y: _ScreenUnits, - halo: _ScreenUnits | None = ..., - start: str | _CanvasItemId | None = ..., + halo: _ScreenUnits | None = None, + start: str | _CanvasItemId | None = None, ) -> None: ... def addtag_enclosed(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... def addtag_overlapping(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... @@ -1198,7 +1198,7 @@ class Canvas(Widget, XView, YView): def find_all(self) -> tuple[_CanvasItemId, ...]: ... def find_below(self, tagOrId: str | _CanvasItemId) -> tuple[_CanvasItemId, ...]: ... def find_closest( - self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = ..., start: str | _CanvasItemId | None = ... + self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | _CanvasItemId | None = None ) -> tuple[_CanvasItemId, ...]: ... def find_enclosed( self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits @@ -1211,19 +1211,19 @@ class Canvas(Widget, XView, YView): def tag_bind( self, tagOrId: str | _CanvasItemId, - sequence: str | None = ..., - func: Callable[[Event[Canvas]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Canvas]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload def tag_bind( - self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ... + self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None ) -> None: ... @overload - def tag_bind(self, tagOrId: str | _CanvasItemId, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def tag_unbind(self, tagOrId: str | _CanvasItemId, sequence: str, funcid: str | None = ...) -> None: ... - def canvasx(self, screenx, gridspacing: Incomplete | None = ...): ... - def canvasy(self, screeny, gridspacing: Incomplete | None = ...): ... + def tag_bind(self, tagOrId: str | _CanvasItemId, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def tag_unbind(self, tagOrId: str | _CanvasItemId, sequence: str, funcid: str | None = None) -> None: ... + def canvasx(self, screenx, gridspacing: Incomplete | None = None): ... + def canvasy(self, screeny, gridspacing: Incomplete | None = None): ... @overload def coords(self, __tagOrId: str | _CanvasItemId) -> list[float]: ... @overload @@ -1714,12 +1714,12 @@ class Canvas(Widget, XView, YView): def itemcget(self, tagOrId, option): ... # itemconfigure kwargs depend on item type, which is not known when type checking def itemconfigure( - self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = ..., **kw: Any + self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = None, **kw: Any ) -> dict[str, tuple[str, str, str, str, str]] | None: ... itemconfig = itemconfigure def move(self, *args) -> None: ... if sys.version_info >= (3, 8): - def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = ..., y: Literal[""] | float = ...) -> None: ... + def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = "", y: Literal[""] | float = "") -> None: ... def postscript(self, cnf=..., **kw): ... # tkinter does: @@ -1734,7 +1734,7 @@ class Canvas(Widget, XView, YView): def lift(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore[override] def scale(self, *args) -> None: ... def scan_mark(self, x, y) -> None: ... - def scan_dragto(self, x, y, gain: int = ...) -> None: ... + def scan_dragto(self, x, y, gain: int = 10) -> None: ... def select_adjust(self, tagOrId, index) -> None: ... def select_clear(self) -> None: ... def select_from(self, tagOrId, index) -> None: ... @@ -1745,7 +1745,7 @@ class Canvas(Widget, XView, YView): class Checkbutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -1805,7 +1805,7 @@ class Checkbutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -1864,7 +1864,7 @@ _EntryIndex: TypeAlias = str | int # "INDICES" in manual page class Entry(Widget, XView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -1909,7 +1909,7 @@ class Entry(Widget, XView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1952,7 +1952,7 @@ class Entry(Widget, XView): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def delete(self, first: _EntryIndex, last: _EntryIndex | None = ...) -> None: ... + def delete(self, first: _EntryIndex, last: _EntryIndex | None = None) -> None: ... def get(self) -> str: ... def icursor(self, index: _EntryIndex) -> None: ... def index(self, index: _EntryIndex) -> int: ... @@ -1975,7 +1975,7 @@ class Entry(Widget, XView): class Frame(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -2002,7 +2002,7 @@ class Frame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -2027,7 +2027,7 @@ class Frame(Widget): class Label(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2066,7 +2066,7 @@ class Label(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2107,7 +2107,7 @@ class Label(Widget): class Listbox(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activestyle: Literal["dotbox", "none", "underline"] = ..., @@ -2158,7 +2158,7 @@ class Listbox(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activestyle: Literal["dotbox", "none", "underline"] = ..., background: _Color = ..., @@ -2196,8 +2196,8 @@ class Listbox(Widget, XView, YView): def activate(self, index: str | int) -> None: ... def bbox(self, index: str | int) -> tuple[int, int, int, int] | None: ... # type: ignore[override] def curselection(self): ... - def delete(self, first: str | int, last: str | int | None = ...) -> None: ... - def get(self, first: str | int, last: str | int | None = ...): ... + def delete(self, first: str | int, last: str | int | None = None) -> None: ... + def get(self, first: str | int, last: str | int | None = None): ... def index(self, index: str | int) -> int: ... def insert(self, index: str | int, *elements: str | float) -> None: ... def nearest(self, y): ... @@ -2206,21 +2206,21 @@ class Listbox(Widget, XView, YView): def see(self, index: str | int) -> None: ... def selection_anchor(self, index: str | int) -> None: ... select_anchor = selection_anchor - def selection_clear(self, first: str | int, last: str | int | None = ...) -> None: ... # type: ignore[override] + def selection_clear(self, first: str | int, last: str | int | None = None) -> None: ... # type: ignore[override] select_clear = selection_clear def selection_includes(self, index: str | int): ... select_includes = selection_includes - def selection_set(self, first: str | int, last: str | int | None = ...) -> None: ... + def selection_set(self, first: str | int, last: str | int | None = None) -> None: ... select_set = selection_set def size(self) -> int: ... # type: ignore[override] def itemcget(self, index: str | int, option): ... - def itemconfigure(self, index: str | int, cnf: Incomplete | None = ..., **kw): ... + def itemconfigure(self, index: str | int, cnf: Incomplete | None = None, **kw): ... itemconfig = itemconfigure class Menu(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2252,7 +2252,7 @@ class Menu(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeborderwidth: _ScreenUnits = ..., @@ -2279,7 +2279,7 @@ class Menu(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def tk_popup(self, x: int, y: int, entry: str | int = ...) -> None: ... + def tk_popup(self, x: int, y: int, entry: str | int = "") -> None: ... def activate(self, index: str | int) -> None: ... def add(self, itemType, cnf=..., **kw): ... # docstring says "Internal function." def insert(self, index, itemType, cnf=..., **kw): ... # docstring says "Internal function." @@ -2473,10 +2473,10 @@ class Menu(Widget): variable: Variable = ..., ) -> None: ... def insert_separator(self, index: str | int, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ... - def delete(self, index1: str | int, index2: str | int | None = ...) -> None: ... + def delete(self, index1: str | int, index2: str | int | None = None) -> None: ... def entrycget(self, index: str | int, option: str) -> Any: ... def entryconfigure( - self, index: str | int, cnf: dict[str, Any] | None = ..., **kw: Any + self, index: str | int, cnf: dict[str, Any] | None = None, **kw: Any ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... entryconfig = entryconfigure def index(self, index: str | int) -> int | None: ... @@ -2490,7 +2490,7 @@ class Menu(Widget): class Menubutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2532,7 +2532,7 @@ class Menubutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2576,7 +2576,7 @@ class Menubutton(Widget): class Message(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, anchor: _Anchor = ..., @@ -2607,7 +2607,7 @@ class Message(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, anchor: _Anchor = ..., aspect: int = ..., @@ -2639,7 +2639,7 @@ class Message(Widget): class Radiobutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2688,7 +2688,7 @@ class Radiobutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2743,7 +2743,7 @@ class Radiobutton(Widget): class Scale(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2786,7 +2786,7 @@ class Scale(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., background: _Color = ..., @@ -2828,13 +2828,13 @@ class Scale(Widget): config = configure def get(self) -> float: ... def set(self, value) -> None: ... - def coords(self, value: float | None = ...) -> tuple[int, int]: ... + def coords(self, value: float | None = None) -> tuple[int, int]: ... def identify(self, x, y) -> Literal["", "slider", "trough1", "trough2"]: ... class Scrollbar(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2867,7 +2867,7 @@ class Scrollbar(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activerelief: _Relief = ..., @@ -2894,7 +2894,7 @@ class Scrollbar(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def activate(self, index: Incomplete | None = ...): ... + def activate(self, index: Incomplete | None = None): ... def delta(self, deltax: int, deltay: int) -> float: ... def fraction(self, x: int, y: int) -> float: ... def identify(self, x: int, y: int) -> Literal["arrow1", "arrow2", "slider", "trough1", "trough2", ""]: ... @@ -2906,7 +2906,7 @@ _TextIndex: TypeAlias = _tkinter.Tcl_Obj | str | float | Misc class Text(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, autoseparators: bool = ..., @@ -2963,7 +2963,7 @@ class Text(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, autoseparators: bool = ..., background: _Color = ..., @@ -3018,17 +3018,17 @@ class Text(Widget, XView, YView): def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ... def count(self, index1, index2, *args): ... # TODO @overload - def debug(self, boolean: None = ...) -> bool: ... + def debug(self, boolean: None = None) -> bool: ... @overload def debug(self, boolean: bool) -> None: ... - def delete(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ... + def delete(self, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ... @overload def dump( self, index1: _TextIndex, - index2: _TextIndex | None = ..., - command: None = ..., + index2: _TextIndex | None = None, + command: None = None, *, all: bool = ..., image: bool = ..., @@ -3055,7 +3055,7 @@ class Text(Widget, XView, YView): def dump( self, index1: _TextIndex, - index2: _TextIndex | None = ..., + index2: _TextIndex | None = None, *, command: Callable[[str, str, str], object] | str, all: bool = ..., @@ -3067,23 +3067,23 @@ class Text(Widget, XView, YView): ) -> None: ... def edit(self, *args): ... # docstring says "Internal method" @overload - def edit_modified(self, arg: None = ...) -> bool: ... # actually returns Literal[0, 1] + def edit_modified(self, arg: None = None) -> bool: ... # actually returns Literal[0, 1] @overload def edit_modified(self, arg: bool) -> None: ... # actually returns empty string def edit_redo(self) -> None: ... # actually returns empty string def edit_reset(self) -> None: ... # actually returns empty string def edit_separator(self) -> None: ... # actually returns empty string def edit_undo(self) -> None: ... # actually returns empty string - def get(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> str: ... + def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ... # TODO: image_* methods def image_cget(self, index, option): ... - def image_configure(self, index, cnf: Incomplete | None = ..., **kw): ... + def image_configure(self, index, cnf: Incomplete | None = None, **kw): ... def image_create(self, index, cnf=..., **kw): ... def image_names(self): ... def index(self, index: _TextIndex) -> str: ... def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ... @overload - def mark_gravity(self, markName: str, direction: None = ...) -> Literal["left", "right"]: ... + def mark_gravity(self, markName: str, direction: None = None) -> Literal["left", "right"]: ... @overload def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string def mark_names(self) -> tuple[str, ...]: ... @@ -3101,14 +3101,14 @@ class Text(Widget, XView, YView): self, pattern: str, index: _TextIndex, - stopindex: _TextIndex | None = ..., - forwards: bool | None = ..., - backwards: bool | None = ..., - exact: bool | None = ..., - regexp: bool | None = ..., - nocase: bool | None = ..., - count: Variable | None = ..., - elide: bool | None = ..., + stopindex: _TextIndex | None = None, + forwards: bool | None = None, + backwards: bool | None = None, + exact: bool | None = None, + regexp: bool | None = None, + nocase: bool | None = None, + count: Variable | None = None, + elide: bool | None = None, ) -> str: ... # returns empty string for not found def see(self, index: _TextIndex) -> None: ... def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ... @@ -3119,18 +3119,18 @@ class Text(Widget, XView, YView): tagName: str, sequence: str | None, func: Callable[[Event[Text]], object] | None, - add: Literal["", "+"] | bool | None = ..., + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = ...) -> None: ... + def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = None) -> None: ... # allowing any string for cget instead of just Literals because there's no other way to look up tag options def tag_cget(self, tagName: str, option: str): ... @overload def tag_configure( self, tagName: str, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bgstipple: _Bitmap = ..., @@ -3165,24 +3165,28 @@ class Text(Widget, XView, YView): def tag_configure(self, tagName: str, cnf: str) -> tuple[str, str, str, Any, Any]: ... tag_config = tag_configure def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given - def tag_lower(self, tagName: str, belowThis: str | None = ...) -> None: ... - def tag_names(self, index: _TextIndex | None = ...) -> tuple[str, ...]: ... - def tag_nextrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ... - def tag_prevrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ... - def tag_raise(self, tagName: str, aboveThis: str | None = ...) -> None: ... + def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ... + def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ... + def tag_nextrange( + self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None + ) -> tuple[str, str] | tuple[()]: ... + def tag_prevrange( + self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None + ) -> tuple[str, str] | tuple[()]: ... + def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ... def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ... # tag_remove and tag_delete are different - def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ... + def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... # TODO: window_* methods def window_cget(self, index, option): ... - def window_configure(self, index, cnf: Incomplete | None = ..., **kw): ... + def window_configure(self, index, cnf: Incomplete | None = None, **kw): ... window_config = window_configure def window_create(self, index, cnf=..., **kw) -> None: ... def window_names(self): ... def yview_pickplace(self, *what): ... # deprecated class _setit: - def __init__(self, var, value, callback: Incomplete | None = ...) -> None: ... + def __init__(self, var, value, callback: Incomplete | None = None) -> None: ... def __call__(self, *args) -> None: ... # manual page: tk_optionMenu @@ -3211,7 +3215,7 @@ class Image: name: Incomplete tk: _tkinter.TkappType def __init__( - self, imgtype, name: Incomplete | None = ..., cnf=..., master: Misc | _tkinter.TkappType | None = ..., **kw + self, imgtype, name: Incomplete | None = None, cnf=..., master: Misc | _tkinter.TkappType | None = None, **kw ) -> None: ... def __del__(self) -> None: ... def __setitem__(self, key, value) -> None: ... @@ -3225,9 +3229,9 @@ class Image: class PhotoImage(Image): def __init__( self, - name: str | None = ..., + name: str | None = None, cnf: dict[str, Any] = ..., - master: Misc | _tkinter.TkappType | None = ..., + master: Misc | _tkinter.TkappType | None = None, *, data: str | bytes = ..., # not same as data argument of put() format: str = ..., @@ -3253,8 +3257,8 @@ class PhotoImage(Image): def cget(self, option: str) -> str: ... def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0' def copy(self) -> PhotoImage: ... - def zoom(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ... - def subsample(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ... + def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... + def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... def get(self, x: int, y: int) -> tuple[int, int, int]: ... def put( self, @@ -3267,9 +3271,9 @@ class PhotoImage(Image): | tuple[list[_Color], ...] | tuple[tuple[_Color, ...], ...] ), - to: tuple[int, int] | None = ..., + to: tuple[int, int] | None = None, ) -> None: ... - def write(self, filename: StrOrBytesPath, format: str | None = ..., from_coords: tuple[int, int] | None = ...) -> None: ... + def write(self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None) -> None: ... if sys.version_info >= (3, 8): def transparency_get(self, x: int, y: int) -> bool: ... def transparency_set(self, x: int, y: int, boolean: bool) -> None: ... @@ -3277,9 +3281,9 @@ class PhotoImage(Image): class BitmapImage(Image): def __init__( self, - name: Incomplete | None = ..., + name: Incomplete | None = None, cnf: dict[str, Any] = ..., - master: Misc | _tkinter.TkappType | None = ..., + master: Misc | _tkinter.TkappType | None = None, *, background: _Color = ..., data: str | bytes = ..., @@ -3295,7 +3299,7 @@ def image_types() -> tuple[str, ...]: ... class Spinbox(Widget, XView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -3354,7 +3358,7 @@ class Spinbox(Widget, XView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., background: _Color = ..., @@ -3411,7 +3415,7 @@ class Spinbox(Widget, XView): def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure def bbox(self, index) -> tuple[int, int, int, int] | None: ... # type: ignore[override] - def delete(self, first, last: Incomplete | None = ...) -> Literal[""]: ... + def delete(self, first, last: Incomplete | None = None) -> Literal[""]: ... def get(self) -> str: ... def icursor(self, index): ... def identify(self, x: int, y: int) -> Literal["", "buttondown", "buttonup", "entry"]: ... @@ -3425,7 +3429,7 @@ class Spinbox(Widget, XView): def selection(self, *args) -> tuple[int, ...]: ... def selection_adjust(self, index): ... def selection_clear(self): ... - def selection_element(self, element: Incomplete | None = ...): ... + def selection_element(self, element: Incomplete | None = None): ... if sys.version_info >= (3, 8): def selection_from(self, index: int) -> None: ... def selection_present(self) -> None: ... @@ -3435,7 +3439,7 @@ class Spinbox(Widget, XView): class LabelFrame(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -3469,7 +3473,7 @@ class LabelFrame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -3500,7 +3504,7 @@ class LabelFrame(Widget): class PanedWindow(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -3529,7 +3533,7 @@ class PanedWindow(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -3569,7 +3573,7 @@ class PanedWindow(Widget): def sash_mark(self, index): ... def sash_place(self, index, x, y): ... def panecget(self, child, option): ... - def paneconfigure(self, tagOrId, cnf: Incomplete | None = ..., **kw): ... + def paneconfigure(self, tagOrId, cnf: Incomplete | None = None, **kw): ... paneconfig: Incomplete def panes(self): ... diff --git a/stdlib/tkinter/colorchooser.pyi b/stdlib/tkinter/colorchooser.pyi index 47eb222590c6..4300d94f58e8 100644 --- a/stdlib/tkinter/colorchooser.pyi +++ b/stdlib/tkinter/colorchooser.pyi @@ -11,10 +11,10 @@ class Chooser(Dialog): if sys.version_info >= (3, 9): def askcolor( - color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... + color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... ) -> tuple[None, None] | tuple[tuple[int, int, int], str]: ... else: def askcolor( - color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... + color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... ) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ... diff --git a/stdlib/tkinter/commondialog.pyi b/stdlib/tkinter/commondialog.pyi index edae62582237..eba3ab5be3bd 100644 --- a/stdlib/tkinter/commondialog.pyi +++ b/stdlib/tkinter/commondialog.pyi @@ -10,5 +10,5 @@ class Dialog: command: ClassVar[str | None] master: Incomplete | None options: Mapping[str, Incomplete] - def __init__(self, master: Incomplete | None = ..., **options: Incomplete) -> None: ... + def __init__(self, master: Incomplete | None = None, **options: Incomplete) -> None: ... def show(self, **options: Incomplete) -> Incomplete: ... diff --git a/stdlib/tkinter/dialog.pyi b/stdlib/tkinter/dialog.pyi index 032dac2c15a2..8825188c767e 100644 --- a/stdlib/tkinter/dialog.pyi +++ b/stdlib/tkinter/dialog.pyi @@ -12,5 +12,5 @@ DIALOG_ICON: str class Dialog(Widget): widgetName: str num: int - def __init__(self, master: Incomplete | None = ..., cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ... + def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ... def destroy(self) -> None: ... diff --git a/stdlib/tkinter/dnd.pyi b/stdlib/tkinter/dnd.pyi index ad7972968f81..4a6ab42b3e33 100644 --- a/stdlib/tkinter/dnd.pyi +++ b/stdlib/tkinter/dnd.pyi @@ -11,8 +11,8 @@ class _DndSource(Protocol): class DndHandler: root: ClassVar[Tk | None] def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ... - def cancel(self, event: Event[Misc] | None = ...) -> None: ... - def finish(self, event: Event[Misc] | None, commit: int = ...) -> None: ... + def cancel(self, event: Event[Misc] | None = None) -> None: ... + def finish(self, event: Event[Misc] | None, commit: int = 0) -> None: ... def on_motion(self, event: Event[Misc]) -> None: ... def on_release(self, event: Event[Misc]) -> None: ... diff --git a/stdlib/tkinter/filedialog.pyi b/stdlib/tkinter/filedialog.pyi index d0b7e451f72c..10b36e4d3c06 100644 --- a/stdlib/tkinter/filedialog.pyi +++ b/stdlib/tkinter/filedialog.pyi @@ -41,21 +41,21 @@ class FileDialog: filter_button: Button cancel_button: Button def __init__( - self, master, title: Incomplete | None = ... + self, master, title: Incomplete | None = None ) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either how: Incomplete | None - def go(self, dir_or_file=..., pattern: str = ..., default: str = ..., key: Incomplete | None = ...): ... - def quit(self, how: Incomplete | None = ...) -> None: ... + def go(self, dir_or_file=".", pattern: str = "*", default: str = "", key: Incomplete | None = None): ... + def quit(self, how: Incomplete | None = None) -> None: ... def dirs_double_event(self, event) -> None: ... def dirs_select_event(self, event) -> None: ... def files_double_event(self, event) -> None: ... def files_select_event(self, event) -> None: ... def ok_event(self, event) -> None: ... def ok_command(self) -> None: ... - def filter_command(self, event: Incomplete | None = ...) -> None: ... + def filter_command(self, event: Incomplete | None = None) -> None: ... def get_filter(self): ... def get_selection(self): ... - def cancel_command(self, event: Incomplete | None = ...) -> None: ... + def cancel_command(self, event: Incomplete | None = None) -> None: ... def set_filter(self, dir, pat) -> None: ... def set_selection(self, file) -> None: ... @@ -116,7 +116,7 @@ def askdirectory( # TODO: If someone actually uses these, overload to have the actual return type of open(..., mode) def asksaveasfile( - mode: str = ..., + mode: str = "w", *, confirmoverwrite: bool | None = ..., defaultextension: str | None = ..., @@ -128,7 +128,7 @@ def asksaveasfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfile( - mode: str = ..., + mode: str = "r", *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., @@ -139,7 +139,7 @@ def askopenfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfiles( - mode: str = ..., + mode: str = "r", *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., diff --git a/stdlib/tkinter/font.pyi b/stdlib/tkinter/font.pyi index dff84e9fac78..0a557e921914 100644 --- a/stdlib/tkinter/font.pyi +++ b/stdlib/tkinter/font.pyi @@ -41,10 +41,10 @@ class Font: self, # In tkinter, 'root' refers to tkinter.Tk by convention, but the code # actually works with any tkinter widget so we use tkinter.Misc. - root: tkinter.Misc | None = ..., - font: _FontDescription | None = ..., - name: str | None = ..., - exists: bool = ..., + root: tkinter.Misc | None = None, + font: _FontDescription | None = None, + name: str | None = None, + exists: bool = False, *, family: str = ..., size: int = ..., @@ -68,19 +68,19 @@ class Font: def cget(self, option: str) -> Any: ... __getitem__ = cget @overload - def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = ...) -> str: ... + def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = None) -> str: ... @overload - def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = ...) -> int: ... + def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = None) -> int: ... @overload - def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = ...) -> Literal["normal", "bold"]: ... + def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = None) -> Literal["normal", "bold"]: ... @overload - def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = ...) -> Literal["roman", "italic"]: ... + def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = None) -> Literal["roman", "italic"]: ... @overload - def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = ...) -> bool: ... + def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = None) -> bool: ... @overload - def actual(self, option: None, displayof: tkinter.Misc | None = ...) -> _FontDict: ... + def actual(self, option: None, displayof: tkinter.Misc | None = None) -> _FontDict: ... @overload - def actual(self, *, displayof: tkinter.Misc | None = ...) -> _FontDict: ... + def actual(self, *, displayof: tkinter.Misc | None = None) -> _FontDict: ... def config( self, *, @@ -99,14 +99,14 @@ class Font: def metrics(self, __option: Literal["fixed"], *, displayof: tkinter.Misc | None = ...) -> bool: ... @overload def metrics(self, *, displayof: tkinter.Misc | None = ...) -> _MetricsDict: ... - def measure(self, text: str, displayof: tkinter.Misc | None = ...) -> int: ... + def measure(self, text: str, displayof: tkinter.Misc | None = None) -> int: ... def __eq__(self, other: object) -> bool: ... -def families(root: tkinter.Misc | None = ..., displayof: tkinter.Misc | None = ...) -> tuple[str, ...]: ... -def names(root: tkinter.Misc | None = ...) -> tuple[str, ...]: ... +def families(root: tkinter.Misc | None = None, displayof: tkinter.Misc | None = None) -> tuple[str, ...]: ... +def names(root: tkinter.Misc | None = None) -> tuple[str, ...]: ... if sys.version_info >= (3, 10): - def nametofont(name: str, root: tkinter.Misc | None = ...) -> Font: ... + def nametofont(name: str, root: tkinter.Misc | None = None) -> Font: ... else: def nametofont(name: str) -> Font: ... diff --git a/stdlib/tkinter/messagebox.pyi b/stdlib/tkinter/messagebox.pyi index d99c588e3cd3..5a04b66d7866 100644 --- a/stdlib/tkinter/messagebox.pyi +++ b/stdlib/tkinter/messagebox.pyi @@ -34,11 +34,11 @@ NO: str class Message(Dialog): command: ClassVar[str] -def showinfo(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def showwarning(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def showerror(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def askquestion(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def askokcancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ... -def askyesno(title: str | None = ..., message: str | None = ..., **options) -> bool: ... -def askyesnocancel(title: str | None = ..., message: str | None = ..., **options) -> bool | None: ... -def askretrycancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ... +def showinfo(title: str | None = None, message: str | None = None, **options) -> str: ... +def showwarning(title: str | None = None, message: str | None = None, **options) -> str: ... +def showerror(title: str | None = None, message: str | None = None, **options) -> str: ... +def askquestion(title: str | None = None, message: str | None = None, **options) -> str: ... +def askokcancel(title: str | None = None, message: str | None = None, **options) -> bool: ... +def askyesno(title: str | None = None, message: str | None = None, **options) -> bool: ... +def askyesnocancel(title: str | None = None, message: str | None = None, **options) -> bool | None: ... +def askretrycancel(title: str | None = None, message: str | None = None, **options) -> bool: ... diff --git a/stdlib/tkinter/scrolledtext.pyi b/stdlib/tkinter/scrolledtext.pyi index 4d8a7004c6b9..114f8c3de3ea 100644 --- a/stdlib/tkinter/scrolledtext.pyi +++ b/stdlib/tkinter/scrolledtext.pyi @@ -7,4 +7,4 @@ __all__ = ["ScrolledText"] class ScrolledText(Text): frame: Frame vbar: Scrollbar - def __init__(self, master: Misc | None = ..., **kwargs: Incomplete) -> None: ... + def __init__(self, master: Misc | None = None, **kwargs: Incomplete) -> None: ... diff --git a/stdlib/tkinter/simpledialog.pyi b/stdlib/tkinter/simpledialog.pyi index 8ae8b6d286d0..2c57cce7371c 100644 --- a/stdlib/tkinter/simpledialog.pyi +++ b/stdlib/tkinter/simpledialog.pyi @@ -1,11 +1,11 @@ from tkinter import Event, Frame, Misc, Toplevel class Dialog(Toplevel): - def __init__(self, parent: Misc | None, title: str | None = ...) -> None: ... + def __init__(self, parent: Misc | None, title: str | None = None) -> None: ... def body(self, master: Frame) -> Misc | None: ... def buttonbox(self) -> None: ... - def ok(self, event: Event[Misc] | None = ...) -> None: ... - def cancel(self, event: Event[Misc] | None = ...) -> None: ... + def ok(self, event: Event[Misc] | None = None) -> None: ... + def cancel(self, event: Event[Misc] | None = None) -> None: ... def validate(self) -> bool: ... def apply(self) -> None: ... @@ -13,12 +13,12 @@ class SimpleDialog: def __init__( self, master: Misc | None, - text: str = ..., + text: str = "", buttons: list[str] = ..., - default: int | None = ..., - cancel: int | None = ..., - title: str | None = ..., - class_: str | None = ..., + default: int | None = None, + cancel: int | None = None, + title: str | None = None, + class_: str | None = None, ) -> None: ... def go(self) -> int | None: ... def return_event(self, event: Event[Misc]) -> None: ... diff --git a/stdlib/tkinter/tix.pyi b/stdlib/tkinter/tix.pyi index db568bc4abef..5dd6f040fab7 100644 --- a/stdlib/tkinter/tix.pyi +++ b/stdlib/tkinter/tix.pyi @@ -38,22 +38,22 @@ TCL_ALL_EVENTS: Literal[0] class tixCommand: def tix_addbitmapdir(self, directory: str) -> None: ... def tix_cget(self, option: str) -> Any: ... - def tix_configure(self, cnf: dict[str, Any] | None = ..., **kw: Any) -> Any: ... - def tix_filedialog(self, dlgclass: str | None = ...) -> str: ... + def tix_configure(self, cnf: dict[str, Any] | None = None, **kw: Any) -> Any: ... + def tix_filedialog(self, dlgclass: str | None = None) -> str: ... def tix_getbitmap(self, name: str) -> str: ... def tix_getimage(self, name: str) -> str: ... def tix_option_get(self, name: str) -> Any: ... - def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = ...) -> None: ... + def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = None) -> None: ... class Tk(tkinter.Tk, tixCommand): - def __init__(self, screenName: str | None = ..., baseName: str | None = ..., className: str = ...) -> None: ... + def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = "Tix") -> None: ... class TixWidget(tkinter.Widget): def __init__( self, - master: tkinter.Misc | None = ..., - widgetName: str | None = ..., - static_options: list[str] | None = ..., + master: tkinter.Misc | None = None, + widgetName: str | None = None, + static_options: list[str] | None = None, cnf: dict[str, Any] = ..., kw: dict[str, Any] = ..., ) -> None: ... @@ -62,52 +62,50 @@ class TixWidget(tkinter.Widget): def subwidget(self, name: str) -> tkinter.Widget: ... def subwidgets_all(self) -> list[tkinter.Widget]: ... def config_all(self, option: Any, value: Any) -> None: ... - def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = ..., **kw) -> None: ... + def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = None, **kw) -> None: ... def image_delete(self, imgname: str) -> None: ... class TixSubWidget(TixWidget): - def __init__( - self, master: tkinter.Widget, name: str, destroy_physically: int = ..., check_intermediate: int = ... - ) -> None: ... + def __init__(self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1) -> None: ... class DisplayStyle: - def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = ..., **kw) -> None: ... + def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = None, **kw) -> None: ... def __getitem__(self, key: str): ... def __setitem__(self, key: str, value: Any) -> None: ... def delete(self) -> None: ... def config(self, cnf: dict[str, Any] = ..., **kw): ... class Balloon(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def bind_widget(self, widget: tkinter.Widget, cnf: dict[str, Any] = ..., **kw) -> None: ... def unbind_widget(self, widget: tkinter.Widget) -> None: ... class ButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... def invoke(self, name: str) -> None: ... class ComboBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add_history(self, str: str) -> None: ... def append_history(self, str: str) -> None: ... def insert(self, index: int, str: str) -> None: ... def pick(self, index: int) -> None: ... class Control(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def decrement(self) -> None: ... def increment(self) -> None: ... def invoke(self) -> None: ... class LabelEntry(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class LabelFrame(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class Meter(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class OptionMenu(TixWidget): def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -129,7 +127,7 @@ class Select(TixWidget): def invoke(self, name: str) -> None: ... class StdButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def invoke(self, name: str) -> None: ... class DirList(TixWidget): @@ -164,13 +162,13 @@ class FileEntry(TixWidget): def file_dialog(self) -> None: ... class HList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, entry: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... - def add_child(self, parent: str | None = ..., cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... + def add_child(self, parent: str | None = None, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... def anchor_set(self, entry: str) -> None: ... def anchor_clear(self) -> None: ... # FIXME: Overload, certain combos return, others don't - def column_width(self, col: int = ..., width: int | None = ..., chars: int | None = ...) -> int | None: ... + def column_width(self, col: int = 0, width: int | None = None, chars: int | None = None) -> int | None: ... def delete_all(self) -> None: ... def delete_entry(self, entry: str) -> None: ... def delete_offsprings(self, entry: str) -> None: ... @@ -195,7 +193,7 @@ class HList(TixWidget, tkinter.XView, tkinter.YView): def indicator_size(self, entry: str) -> int: ... def info_anchor(self) -> str: ... def info_bbox(self, entry: str) -> tuple[int, int, int, int]: ... - def info_children(self, entry: str | None = ...) -> tuple[str, ...]: ... + def info_children(self, entry: str | None = None) -> tuple[str, ...]: ... def info_data(self, entry: str) -> Any: ... def info_dragsite(self) -> str: ... def info_dropsite(self) -> str: ... @@ -216,34 +214,34 @@ class HList(TixWidget, tkinter.XView, tkinter.YView): def see(self, entry: str) -> None: ... def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def selection_includes(self, entry: str) -> bool: ... - def selection_set(self, first: str, last: str | None = ...) -> None: ... + def selection_set(self, first: str, last: str | None = None) -> None: ... def show_entry(self, entry: str) -> None: ... class CheckList(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def autosetmode(self) -> None: ... def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def getselection(self, mode: str = ...) -> tuple[str, ...]: ... + def getselection(self, mode: str = "on") -> tuple[str, ...]: ... def getstatus(self, entrypath: str) -> str: ... - def setstatus(self, entrypath: str, mode: str = ...) -> None: ... + def setstatus(self, entrypath: str, mode: str = "on") -> None: ... class Tree(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def autosetmode(self) -> None: ... def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def setmode(self, entrypath: str, mode: str = ...) -> None: ... + def setmode(self, entrypath: str, mode: str = "none") -> None: ... class TList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def active_set(self, index: int) -> None: ... def active_clear(self) -> None: ... def anchor_set(self, index: int) -> None: ... def anchor_clear(self) -> None: ... - def delete(self, from_: int, to: int | None = ...) -> None: ... + def delete(self, from_: int, to: int | None = None) -> None: ... def dragsite_set(self, index: int) -> None: ... def dragsite_clear(self) -> None: ... def dropsite_set(self, index: int) -> None: ... @@ -261,7 +259,7 @@ class TList(TixWidget, tkinter.XView, tkinter.YView): def see(self, index: int) -> None: ... def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def selection_includes(self, index: int) -> bool: ... - def selection_set(self, first: int, last: int | None = ...) -> None: ... + def selection_set(self, first: int, last: int | None = None) -> None: ... class PanedWindow(TixWidget): def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -280,7 +278,7 @@ class ListNoteBook(TixWidget): def raise_page(self, name: str) -> None: ... class NoteBook(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> None: ... def delete(self, name: str) -> None: ... def page(self, name: str) -> tkinter.Widget: ... @@ -289,7 +287,7 @@ class NoteBook(TixWidget): def raised(self) -> bool: ... class InputOnly(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class Form: def __setitem__(self, key: str, value: Any) -> None: ... @@ -297,6 +295,6 @@ class Form: def form(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def check(self) -> bool: ... def forget(self) -> None: ... - def grid(self, xsize: int = ..., ysize: int = ...) -> tuple[int, int] | None: ... - def info(self, option: str | None = ...): ... + def grid(self, xsize: int = 0, ysize: int = 0) -> tuple[int, int] | None: ... + def info(self, option: str | None = None): ... def slaves(self) -> list[tkinter.Widget]: ... diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 07584ed9ed87..bd477535f41f 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -36,7 +36,7 @@ __all__ = [ ] def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ... -def setup_master(master: Incomplete | None = ...): ... +def setup_master(master: Incomplete | None = None): ... _Padding: TypeAlias = Union[ tkinter._ScreenUnits, @@ -52,32 +52,32 @@ _TtkCompound: TypeAlias = Literal["text", "image", tkinter._Compound] class Style: master: Incomplete tk: _tkinter.TkappType - def __init__(self, master: tkinter.Misc | None = ...) -> None: ... - def configure(self, style, query_opt: Incomplete | None = ..., **kw): ... - def map(self, style, query_opt: Incomplete | None = ..., **kw): ... - def lookup(self, style, option, state: Incomplete | None = ..., default: Incomplete | None = ...): ... - def layout(self, style, layoutspec: Incomplete | None = ...): ... + def __init__(self, master: tkinter.Misc | None = None) -> None: ... + def configure(self, style, query_opt: Incomplete | None = None, **kw): ... + def map(self, style, query_opt: Incomplete | None = None, **kw): ... + def lookup(self, style, option, state: Incomplete | None = None, default: Incomplete | None = None): ... + def layout(self, style, layoutspec: Incomplete | None = None): ... def element_create(self, elementname, etype, *args, **kw) -> None: ... def element_names(self): ... def element_options(self, elementname): ... - def theme_create(self, themename, parent: Incomplete | None = ..., settings: Incomplete | None = ...) -> None: ... + def theme_create(self, themename, parent: Incomplete | None = None, settings: Incomplete | None = None) -> None: ... def theme_settings(self, themename, settings) -> None: ... def theme_names(self) -> tuple[str, ...]: ... @overload def theme_use(self, themename: str) -> None: ... @overload - def theme_use(self, themename: None = ...) -> str: ... + def theme_use(self, themename: None = None) -> str: ... class Widget(tkinter.Widget): - def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = ...) -> None: ... + def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = None) -> None: ... def identify(self, x: int, y: int) -> str: ... - def instate(self, statespec, callback: Incomplete | None = ..., *args, **kw): ... - def state(self, statespec: Incomplete | None = ...): ... + def instate(self, statespec, callback: Incomplete | None = None, *args, **kw): ... + def state(self, statespec: Incomplete | None = None): ... class Button(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -98,7 +98,7 @@ class Button(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -122,7 +122,7 @@ class Button(Widget): class Checkbutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -148,7 +148,7 @@ class Checkbutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -174,8 +174,8 @@ class Checkbutton(Widget): class Entry(Widget, tkinter.Entry): def __init__( self, - master: tkinter.Misc | None = ..., - widget: str | None = ..., + master: tkinter.Misc | None = None, + widget: str | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -199,7 +199,7 @@ class Entry(Widget, tkinter.Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -224,7 +224,7 @@ class Entry(Widget, tkinter.Entry): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -252,7 +252,7 @@ class Entry(Widget, tkinter.Entry): class Combobox(Entry): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -279,7 +279,7 @@ class Combobox(Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -307,7 +307,7 @@ class Combobox(Entry): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -331,13 +331,13 @@ class Combobox(Entry): ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... @overload def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def current(self, newindex: int | None = ...) -> int: ... + def current(self, newindex: int | None = None) -> int: ... def set(self, value: Any) -> None: ... class Frame(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -354,7 +354,7 @@ class Frame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -373,7 +373,7 @@ class Frame(Widget): class Label(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, anchor: tkinter._Anchor = ..., background: tkinter._Color = ..., @@ -401,7 +401,7 @@ class Label(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, anchor: tkinter._Anchor = ..., background: tkinter._Color = ..., @@ -431,7 +431,7 @@ class Label(Widget): class Labelframe(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., # undocumented @@ -452,7 +452,7 @@ class Labelframe(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -477,7 +477,7 @@ LabelFrame = Labelframe class Menubutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., compound: _TtkCompound = ..., @@ -498,7 +498,7 @@ class Menubutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, compound: _TtkCompound = ..., cursor: tkinter._Cursor = ..., @@ -521,7 +521,7 @@ class Menubutton(Widget): class Notebook(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -535,7 +535,7 @@ class Notebook(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -564,15 +564,15 @@ class Notebook(Widget): def identify(self, x: int, y: int) -> str: ... def index(self, tab_id): ... def insert(self, pos, child, **kw) -> None: ... - def select(self, tab_id: Incomplete | None = ...): ... - def tab(self, tab_id, option: Incomplete | None = ..., **kw): ... + def select(self, tab_id: Incomplete | None = None): ... + def tab(self, tab_id, option: Incomplete | None = None, **kw): ... def tabs(self): ... def enable_traversal(self) -> None: ... class Panedwindow(Widget, tkinter.PanedWindow): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -588,7 +588,7 @@ class Panedwindow(Widget, tkinter.PanedWindow): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -602,7 +602,7 @@ class Panedwindow(Widget, tkinter.PanedWindow): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -614,15 +614,15 @@ class Panedwindow(Widget, tkinter.PanedWindow): def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... forget: Incomplete def insert(self, pos, child, **kw) -> None: ... - def pane(self, pane, option: Incomplete | None = ..., **kw): ... - def sashpos(self, index, newpos: Incomplete | None = ...): ... + def pane(self, pane, option: Incomplete | None = None, **kw): ... + def sashpos(self, index, newpos: Incomplete | None = None): ... PanedWindow = Panedwindow class Progressbar(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -640,7 +640,7 @@ class Progressbar(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., length: tkinter._ScreenUnits = ..., @@ -656,14 +656,14 @@ class Progressbar(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def start(self, interval: Literal["idle"] | int | None = ...) -> None: ... - def step(self, amount: float | None = ...) -> None: ... + def start(self, interval: Literal["idle"] | int | None = None) -> None: ... + def step(self, amount: float | None = None) -> None: ... def stop(self) -> None: ... class Radiobutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -685,7 +685,7 @@ class Radiobutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -711,7 +711,7 @@ class Radiobutton(Widget): class Scale(Widget, tkinter.Scale): # type: ignore[misc] def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: str | Callable[[str], object] = ..., @@ -730,7 +730,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: str | Callable[[str], object] = ..., cursor: tkinter._Cursor = ..., @@ -750,7 +750,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: str | Callable[[str], object] = ..., cursor: tkinter._Cursor = ..., @@ -766,13 +766,13 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... @overload def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def get(self, x: int | None = ..., y: int | None = ...) -> float: ... + def get(self, x: int | None = None, y: int | None = None) -> float: ... # type ignore, because identify() methods of Widget and tkinter.Scale are incompatible class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: Callable[..., tuple[float, float] | None] | str = ..., @@ -785,7 +785,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: Callable[..., tuple[float, float] | None] | str = ..., cursor: tkinter._Cursor = ..., @@ -799,7 +799,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: Callable[..., tuple[float, float] | None] | str = ..., cursor: tkinter._Cursor = ..., @@ -813,7 +813,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] class Separator(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -825,7 +825,7 @@ class Separator(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., orient: Literal["horizontal", "vertical"] = ..., @@ -839,7 +839,7 @@ class Separator(Widget): class Sizegrip(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -850,7 +850,7 @@ class Sizegrip(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., style: str = ..., @@ -863,7 +863,7 @@ class Sizegrip(Widget): class Spinbox(Entry): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -894,7 +894,7 @@ class Spinbox(Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., command: Callable[[], object] | str | list[str] | tuple[str, ...] = ..., @@ -958,7 +958,7 @@ _TreeviewColumnId: TypeAlias = int | str # manual page: "COLUMN IDENTIFIERS" class Treeview(Widget, tkinter.XView, tkinter.YView): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., columns: str | list[str] | tuple[str, ...] = ..., @@ -981,7 +981,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, columns: str | list[str] | tuple[str, ...] = ..., cursor: tkinter._Cursor = ..., @@ -998,8 +998,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] - def get_children(self, item: str | None = ...) -> tuple[str, ...]: ... + def bbox(self, item, column: _TreeviewColumnId | None = None) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] + def get_children(self, item: str | None = None) -> tuple[str, ...]: ... def set_children(self, item: str, *newchildren: str) -> None: ... @overload def column(self, column: _TreeviewColumnId, option: Literal["width", "minwidth"]) -> int: ... @@ -1015,7 +1015,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def column( self, column: _TreeviewColumnId, - option: None = ..., + option: None = None, *, width: int = ..., minwidth: int = ..., @@ -1027,7 +1027,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def detach(self, *items: str) -> None: ... def exists(self, item: str) -> bool: ... @overload # type: ignore[override] - def focus(self, item: None = ...) -> str: ... # can return empty string + def focus(self, item: None = None) -> str: ... # can return empty string @overload def focus(self, item: str) -> Literal[""]: ... @overload @@ -1041,12 +1041,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def heading(self, column: _TreeviewColumnId, option: str) -> Any: ... @overload - def heading(self, column: _TreeviewColumnId, option: None = ...) -> _TreeviewHeaderDict: ... # type: ignore[misc] + def heading(self, column: _TreeviewColumnId, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[misc] @overload def heading( self, column: _TreeviewColumnId, - option: None = ..., + option: None = None, *, text: str = ..., image: tkinter._ImageSpec = ..., @@ -1063,7 +1063,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): self, parent: str, index: int | Literal["end"], - iid: str | None = ..., + iid: str | None = None, *, id: str = ..., # same as iid text: str = ..., @@ -1085,12 +1085,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def item(self, item: str, option: str) -> Any: ... @overload - def item(self, item: str, option: None = ...) -> _TreeviewItemDict: ... # type: ignore[misc] + def item(self, item: str, option: None = None) -> _TreeviewItemDict: ... # type: ignore[misc] @overload def item( self, item: str, - option: None = ..., + option: None = None, *, text: str = ..., image: tkinter._ImageSpec = ..., @@ -1107,23 +1107,23 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): if sys.version_info >= (3, 8): def selection(self) -> tuple[str, ...]: ... else: - def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = ...) -> tuple[str, ...]: ... + def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = None) -> tuple[str, ...]: ... def selection_set(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_add(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_remove(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_toggle(self, items: str | list[str] | tuple[str, ...]) -> None: ... @overload - def set(self, item: str, column: None = ..., value: None = ...) -> dict[str, Any]: ... + def set(self, item: str, column: None = None, value: None = None) -> dict[str, Any]: ... @overload - def set(self, item: str, column: _TreeviewColumnId, value: None = ...) -> Any: ... + def set(self, item: str, column: _TreeviewColumnId, value: None = None) -> Any: ... @overload def set(self, item: str, column: _TreeviewColumnId, value: Any) -> Literal[""]: ... # There's no tag_unbind() or 'add' argument for whatever reason. # Also, it's 'callback' instead of 'func' here. @overload def tag_bind( - self, tagname: str, sequence: str | None = ..., callback: Callable[[tkinter.Event[Treeview]], object] | None = ... + self, tagname: str, sequence: str | None = None, callback: Callable[[tkinter.Event[Treeview]], object] | None = None ) -> str: ... @overload def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ... @@ -1139,7 +1139,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def tag_configure( self, tagname: str, - option: None = ..., + option: None = None, *, # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug foreground: tkinter._Color = ..., @@ -1148,7 +1148,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): image: tkinter._ImageSpec = ..., ) -> _TreeviewTagDict | Any: ... # can be None but annoying to check @overload - def tag_has(self, tagname: str, item: None = ...) -> tuple[str, ...]: ... + def tag_has(self, tagname: str, item: None = None) -> tuple[str, ...]: ... @overload def tag_has(self, tagname: str, item: str) -> bool: ... @@ -1158,10 +1158,10 @@ class LabeledScale(Frame): # TODO: don't any-type **kw. That goes to Frame.__init__. def __init__( self, - master: tkinter.Misc | None = ..., - variable: tkinter.IntVar | tkinter.DoubleVar | None = ..., - from_: float = ..., - to: float = ..., + master: tkinter.Misc | None = None, + variable: tkinter.IntVar | tkinter.DoubleVar | None = None, + from_: float = 0, + to: float = 10, *, compound: Literal["top", "bottom"] = ..., **kw, @@ -1174,7 +1174,7 @@ class OptionMenu(Menubutton): self, master, variable, - default: str | None = ..., + default: str | None = None, *values: str, # rest of these are keyword-only because *args syntax used above style: str = ..., @@ -1183,4 +1183,4 @@ class OptionMenu(Menubutton): ) -> None: ... # configure, config, cget, destroy are inherited from Menubutton # destroy and __setitem__ are overridden, signature does not change - def set_menu(self, default: Incomplete | None = ..., *values) -> None: ... + def set_menu(self, default: Incomplete | None = None, *values) -> None: ... diff --git a/stdlib/traceback.pyi b/stdlib/traceback.pyi index d289cf690992..cdda50c0a1b3 100644 --- a/stdlib/traceback.pyi +++ b/stdlib/traceback.pyi @@ -37,40 +37,40 @@ if sys.version_info >= (3, 10): __exc: type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., - limit: int | None = ..., - file: SupportsWrite[str] | None = ..., - chain: bool = ..., + limit: int | None = None, + file: SupportsWrite[str] | None = None, + chain: bool = True, ) -> None: ... @overload def print_exception( - __exc: BaseException, *, limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ... + __exc: BaseException, *, limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True ) -> None: ... @overload def format_exception( __exc: type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., - limit: int | None = ..., - chain: bool = ..., + limit: int | None = None, + chain: bool = True, ) -> list[str]: ... @overload - def format_exception(__exc: BaseException, *, limit: int | None = ..., chain: bool = ...) -> list[str]: ... + def format_exception(__exc: BaseException, *, limit: int | None = None, chain: bool = True) -> list[str]: ... else: def print_exception( etype: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, - limit: int | None = ..., - file: SupportsWrite[str] | None = ..., - chain: bool = ..., + limit: int | None = None, + file: SupportsWrite[str] | None = None, + chain: bool = True, ) -> None: ... def format_exception( etype: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, - limit: int | None = ..., - chain: bool = ..., + limit: int | None = None, + chain: bool = True, ) -> list[str]: ... def print_exc(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... @@ -146,11 +146,11 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - compact: bool = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + compact: bool = False, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( @@ -169,10 +169,10 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( @@ -183,7 +183,7 @@ class TracebackException: if sys.version_info >= (3, 11): def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ... else: - def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... + def format(self, *, chain: bool = True) -> Generator[str, None, None]: ... def format_exception_only(self) -> Generator[str, None, None]: ... @@ -215,9 +215,9 @@ class FrameSummary(Iterable[Any]): lineno: int | None, name: str, *, - lookup_line: bool = ..., - locals: Mapping[str, str] | None = ..., - line: str | None = ..., + lookup_line: bool = True, + locals: Mapping[str, str] | None = None, + line: str | None = None, ) -> None: ... filename: str lineno: int | None diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index 13197c336e5e..1259ca6fb4cc 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -161,11 +161,11 @@ class ScrolledCanvas(Canvas, Frame): # type: ignore[misc] hscroll: Scrollbar vscroll: Scrollbar def __init__( - self, master: Misc | None, width: int = ..., height: int = ..., canvwidth: int = ..., canvheight: int = ... + self, master: Misc | None, width: int = 500, height: int = 350, canvwidth: int = 600, canvheight: int = 500 ) -> None: ... canvwidth: int canvheight: int - def reset(self, canvwidth: int | None = ..., canvheight: int | None = ..., bg: str | None = ...) -> None: ... + def reset(self, canvwidth: int | None = None, canvheight: int | None = None, bg: str | None = None) -> None: ... class TurtleScreenBase: cv: Canvas @@ -177,27 +177,27 @@ class TurtleScreenBase: def mainloop(self) -> None: ... def textinput(self, title: str, prompt: str) -> str | None: ... def numinput( - self, title: str, prompt: str, default: float | None = ..., minval: float | None = ..., maxval: float | None = ... + self, title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None ) -> float | None: ... class Terminator(Exception): ... class TurtleGraphicsError(Exception): ... class Shape: - def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = ...) -> None: ... - def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = ...) -> None: ... + def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = None) -> None: ... + def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = None) -> None: ... class TurtleScreen(TurtleScreenBase): - def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... + def __init__(self, cv: Canvas, mode: str = "standard", colormode: float = 1.0, delay: int = 10) -> None: ... def clear(self) -> None: ... @overload - def mode(self, mode: None = ...) -> str: ... + def mode(self, mode: None = None) -> str: ... @overload def mode(self, mode: str) -> None: ... def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... - def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = ...) -> None: ... + def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... @overload - def colormode(self, cmode: None = ...) -> float: ... + def colormode(self, cmode: None = None) -> float: ... @overload def colormode(self, cmode: float) -> None: ... def reset(self) -> None: ... @@ -209,11 +209,11 @@ class TurtleScreen(TurtleScreenBase): @overload def bgcolor(self, r: float, g: float, b: float) -> None: ... @overload - def tracer(self, n: None = ...) -> int: ... + def tracer(self, n: None = None) -> int: ... @overload - def tracer(self, n: int, delay: int | None = ...) -> None: ... + def tracer(self, n: int, delay: int | None = None) -> None: ... @overload - def delay(self, delay: None = ...) -> int: ... + def delay(self, delay: None = None) -> int: ... @overload def delay(self, delay: int) -> None: ... def update(self) -> None: ... @@ -221,24 +221,24 @@ class TurtleScreen(TurtleScreenBase): def window_height(self) -> int: ... def getcanvas(self) -> Canvas: ... def getshapes(self) -> list[str]: ... - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def onkey(self, fun: Callable[[], object], key: str) -> None: ... - def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... - def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ... + def listen(self, xdummy: float | None = None, ydummy: float | None = None) -> None: ... + def ontimer(self, fun: Callable[[], object], t: int = 0) -> None: ... @overload - def bgpic(self, picname: None = ...) -> str: ... + def bgpic(self, picname: None = None) -> str: ... @overload def bgpic(self, picname: str) -> None: ... @overload - def screensize(self, canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> tuple[int, int]: ... + def screensize(self, canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... # Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well @overload - def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = ...) -> None: ... + def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... onscreenclick = onclick resetscreen = reset clearscreen = clear addshape = register_shape - def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ... + def onkeypress(self, fun: Callable[[], object], key: str | None = None) -> None: ... onkeyrelease = onkey class TNavigator: @@ -246,9 +246,9 @@ class TNavigator: DEFAULT_MODE: str DEFAULT_ANGLEOFFSET: int DEFAULT_ANGLEORIENT: int - def __init__(self, mode: str = ...) -> None: ... + def __init__(self, mode: str = "standard") -> None: ... def reset(self) -> None: ... - def degrees(self, fullcircle: float = ...) -> None: ... + def degrees(self, fullcircle: float = 360.0) -> None: ... def radians(self) -> None: ... def forward(self, distance: float) -> None: ... def back(self, distance: float) -> None: ... @@ -258,23 +258,23 @@ class TNavigator: def xcor(self) -> float: ... def ycor(self) -> float: ... @overload - def goto(self, x: tuple[float, float], y: None = ...) -> None: ... + def goto(self, x: tuple[float, float], y: None = None) -> None: ... @overload def goto(self, x: float, y: float) -> None: ... def home(self) -> None: ... def setx(self, x: float) -> None: ... def sety(self, y: float) -> None: ... @overload - def distance(self, x: TNavigator | tuple[float, float], y: None = ...) -> float: ... + def distance(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def distance(self, x: float, y: float) -> float: ... @overload - def towards(self, x: TNavigator | tuple[float, float], y: None = ...) -> float: ... + def towards(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def towards(self, x: float, y: float) -> float: ... def heading(self) -> float: ... def setheading(self, to_angle: float) -> None: ... - def circle(self, radius: float, extent: float | None = ..., steps: int | None = ...) -> None: ... + def circle(self, radius: float, extent: float | None = None, steps: int | None = None) -> None: ... fd = forward bk = back backward = back @@ -286,20 +286,20 @@ class TNavigator: seth = setheading class TPen: - def __init__(self, resizemode: str = ...) -> None: ... + def __init__(self, resizemode: str = "noresize") -> None: ... @overload - def resizemode(self, rmode: None = ...) -> str: ... + def resizemode(self, rmode: None = None) -> str: ... @overload def resizemode(self, rmode: str) -> None: ... @overload - def pensize(self, width: None = ...) -> int: ... + def pensize(self, width: None = None) -> int: ... @overload def pensize(self, width: int) -> None: ... def penup(self) -> None: ... def pendown(self) -> None: ... def isdown(self) -> bool: ... @overload - def speed(self, speed: None = ...) -> int: ... + def speed(self, speed: None = None) -> int: ... @overload def speed(self, speed: _Speed) -> None: ... @overload @@ -331,7 +331,7 @@ class TPen: @overload def pen( self, - pen: _PenState | None = ..., + pen: _PenState | None = None, *, shown: bool = ..., pendown: bool = ..., @@ -356,7 +356,11 @@ class RawTurtle(TPen, TNavigator): screen: TurtleScreen screens: ClassVar[list[TurtleScreen]] def __init__( - self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ... + self, + canvas: Canvas | TurtleScreen | None = None, + shape: str = "classic", + undobuffersize: int = 1000, + visible: bool = True, ) -> None: ... def reset(self) -> None: ... def setundobuffer(self, size: int | None) -> None: ... @@ -364,7 +368,7 @@ class RawTurtle(TPen, TNavigator): def clear(self) -> None: ... def clone(self: Self) -> Self: ... @overload - def shape(self, name: None = ...) -> str: ... + def shape(self, name: None = None) -> str: ... @overload def shape(self, name: str) -> None: ... # Unsafely overlaps when no arguments are provided @@ -372,10 +376,10 @@ class RawTurtle(TPen, TNavigator): def shapesize(self) -> tuple[float, float, float]: ... # type: ignore[misc] @overload def shapesize( - self, stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ... + self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None ) -> None: ... @overload - def shearfactor(self, shear: None = ...) -> float: ... + def shearfactor(self, shear: None = None) -> float: ... @overload def shearfactor(self, shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @@ -383,12 +387,12 @@ class RawTurtle(TPen, TNavigator): def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[misc] @overload def shapetransform( - self, t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ... + self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None ) -> None: ... def get_shapepoly(self) -> _PolygonCoords | None: ... def settiltangle(self, angle: float) -> None: ... @overload - def tiltangle(self, angle: None = ...) -> float: ... + def tiltangle(self, angle: None = None) -> float: ... @overload def tiltangle(self, angle: float) -> None: ... def tilt(self, angle: float) -> None: ... @@ -397,21 +401,21 @@ class RawTurtle(TPen, TNavigator): # we return Any. def stamp(self) -> Any: ... def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ... - def clearstamps(self, n: int | None = ...) -> None: ... + def clearstamps(self, n: int | None = None) -> None: ... def filling(self) -> bool: ... def begin_fill(self) -> None: ... def end_fill(self) -> None: ... - def dot(self, size: int | None = ..., *color: _Color) -> None: ... - def write(self, arg: object, move: bool = ..., align: str = ..., font: tuple[str, int, str] = ...) -> None: ... + def dot(self, size: int | None = None, *color: _Color) -> None: ... + def write(self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ...) -> None: ... def begin_poly(self) -> None: ... def end_poly(self) -> None: ... def get_poly(self) -> _PolygonCoords | None: ... def getscreen(self) -> TurtleScreen: ... def getturtle(self: Self) -> Self: ... getpen = getturtle - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... + def onrelease(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... + def ondrag(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... def undo(self) -> None: ... turtlesize = shapesize @@ -420,22 +424,22 @@ class _Screen(TurtleScreen): # Note int and float are interpreted differently, hence the Union instead of just float def setup( self, - width: int | float = ..., # noqa: Y041 - height: int | float = ..., # noqa: Y041 - startx: int | None = ..., - starty: int | None = ..., + width: int | float = 0.5, # noqa: Y041 + height: int | float = 0.75, # noqa: Y041 + startx: int | None = None, + starty: int | None = None, ) -> None: ... def title(self, titlestring: str) -> None: ... def bye(self) -> None: ... def exitonclick(self) -> None: ... class Turtle(RawTurtle): - def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def __init__(self, shape: str = "classic", undobuffersize: int = 1000, visible: bool = True) -> None: ... RawPen = RawTurtle Pen = Turtle -def write_docstringdict(filename: str = ...) -> None: ... +def write_docstringdict(filename: str = "turtle_docstringdict") -> None: ... # Note: it's somewhat unfortunate that we have to copy the function signatures. # It would be nice if we could partially reduce the redundancy by doing something @@ -453,20 +457,20 @@ def write_docstringdict(filename: str = ...) -> None: ... def mainloop() -> None: ... def textinput(title: str, prompt: str) -> str | None: ... def numinput( - title: str, prompt: str, default: float | None = ..., minval: float | None = ..., maxval: float | None = ... + title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None ) -> float | None: ... # Functions copied from TurtleScreen: def clear() -> None: ... @overload -def mode(mode: None = ...) -> str: ... +def mode(mode: None = None) -> str: ... @overload def mode(mode: str) -> None: ... def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... -def register_shape(name: str, shape: _PolygonCoords | Shape | None = ...) -> None: ... +def register_shape(name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... @overload -def colormode(cmode: None = ...) -> float: ... +def colormode(cmode: None = None) -> float: ... @overload def colormode(cmode: float) -> None: ... def reset() -> None: ... @@ -478,11 +482,11 @@ def bgcolor(color: _Color) -> None: ... @overload def bgcolor(r: float, g: float, b: float) -> None: ... @overload -def tracer(n: None = ...) -> int: ... +def tracer(n: None = None) -> int: ... @overload -def tracer(n: int, delay: int | None = ...) -> None: ... +def tracer(n: int, delay: int | None = None) -> None: ... @overload -def delay(delay: None = ...) -> int: ... +def delay(delay: None = None) -> int: ... @overload def delay(delay: int) -> None: ... def update() -> None: ... @@ -490,31 +494,31 @@ def window_width() -> int: ... def window_height() -> int: ... def getcanvas() -> Canvas: ... def getshapes() -> list[str]: ... -def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onclick(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def onkey(fun: Callable[[], object], key: str) -> None: ... -def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... -def ontimer(fun: Callable[[], object], t: int = ...) -> None: ... +def listen(xdummy: float | None = None, ydummy: float | None = None) -> None: ... +def ontimer(fun: Callable[[], object], t: int = 0) -> None: ... @overload -def bgpic(picname: None = ...) -> str: ... +def bgpic(picname: None = None) -> str: ... @overload def bgpic(picname: str) -> None: ... @overload -def screensize(canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> tuple[int, int]: ... +def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... @overload -def screensize(canvwidth: int, canvheight: int, bg: _Color | None = ...) -> None: ... +def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... onscreenclick = onclick resetscreen = reset clearscreen = clear addshape = register_shape -def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ... +def onkeypress(fun: Callable[[], object], key: str | None = None) -> None: ... onkeyrelease = onkey # Functions copied from _Screen: -def setup(width: float = ..., height: float = ..., startx: int | None = ..., starty: int | None = ...) -> None: ... +def setup(width: float = 0.5, height: float = 0.75, startx: int | None = None, starty: int | None = None) -> None: ... def title(titlestring: str) -> None: ... def bye() -> None: ... def exitonclick() -> None: ... @@ -522,7 +526,7 @@ def Screen() -> _Screen: ... # Functions copied from TNavigator: -def degrees(fullcircle: float = ...) -> None: ... +def degrees(fullcircle: float = 360.0) -> None: ... def radians() -> None: ... def forward(distance: float) -> None: ... def back(distance: float) -> None: ... @@ -532,23 +536,23 @@ def pos() -> Vec2D: ... def xcor() -> float: ... def ycor() -> float: ... @overload -def goto(x: tuple[float, float], y: None = ...) -> None: ... +def goto(x: tuple[float, float], y: None = None) -> None: ... @overload def goto(x: float, y: float) -> None: ... def home() -> None: ... def setx(x: float) -> None: ... def sety(y: float) -> None: ... @overload -def distance(x: TNavigator | tuple[float, float], y: None = ...) -> float: ... +def distance(x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def distance(x: float, y: float) -> float: ... @overload -def towards(x: TNavigator | tuple[float, float], y: None = ...) -> float: ... +def towards(x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def towards(x: float, y: float) -> float: ... def heading() -> float: ... def setheading(to_angle: float) -> None: ... -def circle(radius: float, extent: float | None = ..., steps: int | None = ...) -> None: ... +def circle(radius: float, extent: float | None = None, steps: int | None = None) -> None: ... fd = forward bk = back @@ -562,18 +566,18 @@ seth = setheading # Functions copied from TPen: @overload -def resizemode(rmode: None = ...) -> str: ... +def resizemode(rmode: None = None) -> str: ... @overload def resizemode(rmode: str) -> None: ... @overload -def pensize(width: None = ...) -> int: ... +def pensize(width: None = None) -> int: ... @overload def pensize(width: int) -> None: ... def penup() -> None: ... def pendown() -> None: ... def isdown() -> bool: ... @overload -def speed(speed: None = ...) -> int: ... +def speed(speed: None = None) -> int: ... @overload def speed(speed: _Speed) -> None: ... @overload @@ -605,7 +609,7 @@ def isvisible() -> bool: ... def pen() -> _PenState: ... # type: ignore[misc] @overload def pen( - pen: _PenState | None = ..., + pen: _PenState | None = None, *, shown: bool = ..., pendown: bool = ..., @@ -632,7 +636,7 @@ ht = hideturtle def setundobuffer(size: int | None) -> None: ... def undobufferentries() -> int: ... @overload -def shape(name: None = ...) -> str: ... +def shape(name: None = None) -> str: ... @overload def shape(name: str) -> None: ... @@ -640,9 +644,9 @@ def shape(name: str) -> None: ... @overload def shapesize() -> tuple[float, float, float]: ... # type: ignore[misc] @overload -def shapesize(stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ...) -> None: ... +def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ... @overload -def shearfactor(shear: None = ...) -> float: ... +def shearfactor(shear: None = None) -> float: ... @overload def shearfactor(shear: float) -> None: ... @@ -651,12 +655,12 @@ def shearfactor(shear: float) -> None: ... def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[misc] @overload def shapetransform( - t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ... + t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None ) -> None: ... def get_shapepoly() -> _PolygonCoords | None: ... def settiltangle(angle: float) -> None: ... @overload -def tiltangle(angle: None = ...) -> float: ... +def tiltangle(angle: None = None) -> float: ... @overload def tiltangle(angle: float) -> None: ... def tilt(angle: float) -> None: ... @@ -666,12 +670,12 @@ def tilt(angle: float) -> None: ... # we return Any. def stamp() -> Any: ... def clearstamp(stampid: int | tuple[int, ...]) -> None: ... -def clearstamps(n: int | None = ...) -> None: ... +def clearstamps(n: int | None = None) -> None: ... def filling() -> bool: ... def begin_fill() -> None: ... def end_fill() -> None: ... -def dot(size: int | None = ..., *color: _Color) -> None: ... -def write(arg: object, move: bool = ..., align: str = ..., font: tuple[str, int, str] = ...) -> None: ... +def dot(size: int | None = None, *color: _Color) -> None: ... +def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ...) -> None: ... def begin_poly() -> None: ... def end_poly() -> None: ... def get_poly() -> _PolygonCoords | None: ... @@ -680,8 +684,8 @@ def getturtle() -> Turtle: ... getpen = getturtle -def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... -def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onrelease(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... +def ondrag(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def undo() -> None: ... turtlesize = shapesize diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 5ce103b24269..5fb24106685e 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -264,13 +264,13 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, co_code: bytes = ..., co_consts: tuple[object, ...] = ..., co_names: tuple[str, ...] = ..., @@ -285,13 +285,13 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, co_code: bytes = ..., co_consts: tuple[object, ...] = ..., co_names: tuple[str, ...] = ..., diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 8d3531941d56..62a91779ac81 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -737,7 +737,7 @@ if sys.version_info >= (3, 9): else: def get_type_hints( - obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = ..., localns: dict[str, Any] | None = ... + obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None ) -> dict[str, Any]: ... if sys.version_info >= (3, 8): @@ -825,7 +825,7 @@ class ForwardRef: # The module and is_class arguments were added in later Python 3.9 versions. def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ... else: - def __init__(self, arg: str, is_argument: bool = ...) -> None: ... + def __init__(self, arg: str, is_argument: bool = True) -> None: ... if sys.version_info >= (3, 9): def _evaluate( diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index a635785b3009..73a41f16600d 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -224,9 +224,9 @@ else: def dataclass_transform( *, - eq_default: bool = ..., - order_default: bool = ..., - kw_only_default: bool = ..., + eq_default: bool = True, + order_default: bool = False, + kw_only_default: bool = False, field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = ..., **kwargs: object, ) -> IdentityFunction: ... @@ -268,11 +268,11 @@ class TypeVar: self, name: str, *constraints: Any, - bound: Any | None = ..., - covariant: bool = ..., - contravariant: bool = ..., - default: Any | None = ..., - infer_variance: bool = ..., + bound: Any | None = None, + covariant: bool = False, + contravariant: bool = False, + default: Any | None = None, + infer_variance: bool = False, ) -> None: ... if sys.version_info >= (3, 10): def __or__(self, right: Any) -> _SpecialForm: ... @@ -294,7 +294,7 @@ class ParamSpec: bound: None | type[Any] | str = None, contravariant: bool = False, covariant: bool = False, - default: type[Any] | str | None = ..., + default: type[Any] | str | None = None, ) -> None: ... @property def args(self) -> ParamSpecArgs: ... @@ -305,7 +305,7 @@ class ParamSpec: class TypeVarTuple: __name__: str __default__: Any | None - def __init__(self, name: str, *, default: Any | None = ...) -> None: ... + def __init__(self, name: str, *, default: Any | None = None) -> None: ... def __iter__(self) -> Any: ... # Unpack[Self] def override(__arg: _F) -> _F: ... diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 84bda6873710..5b1bd9288659 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -123,21 +123,21 @@ class TestCase: def assertIsInstance(self, obj: object, cls: _IsInstanceClassInfo, msg: Any = None) -> None: ... def assertNotIsInstance(self, obj: object, cls: _IsInstanceClassInfo, msg: Any = None) -> None: ... @overload - def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = ...) -> None: ... + def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = ...) -> None: ... + def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = None) -> None: ... @overload - def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = None) -> None: ... @overload - def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = ...) -> None: ... + def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = ...) -> None: ... + def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... @overload - def assertLessEqual(self, a: SupportsDunderLT[_T], b: _T, msg: Any = ...) -> None: ... + def assertLessEqual(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertLessEqual(self, a: _T, b: SupportsDunderGT[_T], msg: Any = ...) -> None: ... + def assertLessEqual(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... # `assertRaises`, `assertRaisesRegex`, and `assertRaisesRegexp` # are not using `ParamSpec` intentionally, # because they might be used with explicitly wrong arg types to raise some error in tests. @@ -203,49 +203,49 @@ class TestCase: def assertAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... @overload def assertAlmostEqual( - self, first: _S, second: _S, places: None = ..., msg: Any = ..., *, delta: _SupportsAbsAndDunderGE + self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE ) -> None: ... @overload def assertAlmostEqual( self, first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], second: _T, - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertAlmostEqual( self, first: _T, second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertNotAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... @overload def assertNotAlmostEqual( - self, first: _S, second: _S, places: None = ..., msg: Any = ..., *, delta: _SupportsAbsAndDunderGE + self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE ) -> None: ... @overload def assertNotAlmostEqual( self, first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], second: _T, - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertNotAlmostEqual( self, first: _T, second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... def assertRegex(self, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... def assertNotRegex(self, text: AnyStr, unexpected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 67fcc41ade71..54c79fd433d2 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -408,7 +408,12 @@ if sys.version_info >= (3, 10): else: def create_autospec( - spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Any | None = ..., _name: Any | None = ..., **kwargs: Any + spec: Any, + spec_set: Any = False, + instance: Any = False, + _parent: Any | None = None, + _name: Any | None = None, + **kwargs: Any, ) -> Any: ... class _SpecState: diff --git a/stdlib/unittest/signals.pyi b/stdlib/unittest/signals.pyi index 89e108d926a6..a60133ada9d9 100644 --- a/stdlib/unittest/signals.pyi +++ b/stdlib/unittest/signals.pyi @@ -10,6 +10,6 @@ def installHandler() -> None: ... def registerResult(result: unittest.result.TestResult) -> None: ... def removeResult(result: unittest.result.TestResult) -> bool: ... @overload -def removeHandler(method: None = ...) -> None: ... +def removeHandler(method: None = None) -> None: ... @overload def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index 4d5c69937808..17b6a9eb11ef 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -132,20 +132,20 @@ def parse_qsl( separator: str = "&", ) -> list[tuple[AnyStr, AnyStr]]: ... @overload -def quote(string: str, safe: str | Iterable[int] = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ... +def quote(string: str, safe: str | Iterable[int] = "/", encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote(string: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ... +def quote(string: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... @overload -def quote_plus(string: str, safe: str | Iterable[int] = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ... +def quote_plus(string: str, safe: str | Iterable[int] = "", encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ... +def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = "") -> str: ... if sys.version_info >= (3, 9): def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ... else: - def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... + def unquote(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... def unquote_to_bytes(string: str | bytes | bytearray) -> bytes: ... def unquote_plus(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... @@ -166,22 +166,22 @@ def urlencode( ) -> str: ... def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> AnyStr: ... @overload -def urlparse(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> ParseResult: ... +def urlparse(url: str, scheme: str | None = "", allow_fragments: bool = True) -> ParseResult: ... @overload def urlparse( - url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = ... + url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = True ) -> ParseResultBytes: ... @overload -def urlsplit(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> SplitResult: ... +def urlsplit(url: str, scheme: str | None = "", allow_fragments: bool = True) -> SplitResult: ... if sys.version_info >= (3, 11): @overload - def urlsplit(url: bytes | None, scheme: bytes | None = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... + def urlsplit(url: bytes | None, scheme: bytes | None = ..., allow_fragments: bool = True) -> SplitResultBytes: ... else: @overload def urlsplit( - url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = ... + url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = True ) -> SplitResultBytes: ... @overload diff --git a/stdlib/uuid.pyi b/stdlib/uuid.pyi index 1fed902c9f6b..249257783626 100644 --- a/stdlib/uuid.pyi +++ b/stdlib/uuid.pyi @@ -70,7 +70,7 @@ if sys.version_info >= (3, 9): def getnode() -> int: ... else: - def getnode(*, getters: Unused = ...) -> int: ... # undocumented + def getnode(*, getters: Unused = None) -> int: ... # undocumented def uuid1(node: _Int | None = None, clock_seq: _Int | None = None) -> UUID: ... def uuid3(namespace: UUID, name: str) -> UUID: ... diff --git a/stdlib/venv/__init__.pyi b/stdlib/venv/__init__.pyi index 4d67a53ee602..f184649f10f0 100644 --- a/stdlib/venv/__init__.pyi +++ b/stdlib/venv/__init__.pyi @@ -31,12 +31,12 @@ class EnvBuilder: else: def __init__( self, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - upgrade: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + upgrade: bool = False, + with_pip: bool = False, + prompt: str | None = None, ) -> None: ... def create(self, env_dir: StrOrBytesPath) -> None: ... @@ -69,11 +69,11 @@ if sys.version_info >= (3, 9): else: def create( env_dir: StrOrBytesPath, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + with_pip: bool = False, + prompt: str | None = None, ) -> None: ... def main(args: Sequence[str] | None = None) -> None: ... diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index a1717bc252a4..6222eb65918a 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -65,45 +65,45 @@ class catch_warnings(Generic[_W]): def __init__( self: catch_warnings[None], *, - record: Literal[False] = ..., - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + record: Literal[False] = False, + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... @overload def __init__( self: catch_warnings[list[WarningMessage]], *, record: Literal[True], - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... @overload def __init__( self: catch_warnings[list[WarningMessage] | None], *, record: bool, - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... else: @overload - def __init__(self: catch_warnings[None], *, record: Literal[False] = ..., module: ModuleType | None = ...) -> None: ... + def __init__(self: catch_warnings[None], *, record: Literal[False] = False, module: ModuleType | None = None) -> None: ... @overload def __init__( - self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = ... + self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = None ) -> None: ... @overload def __init__( - self: catch_warnings[list[WarningMessage] | None], *, record: bool, module: ModuleType | None = ... + self: catch_warnings[list[WarningMessage] | None], *, record: bool, module: ModuleType | None = None ) -> None: ... def __enter__(self) -> _W: ... diff --git a/stdlib/wave.pyi b/stdlib/wave.pyi index 69d583a85ad8..3817ae09307f 100644 --- a/stdlib/wave.pyi +++ b/stdlib/wave.pyi @@ -72,7 +72,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Wave_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Wave_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): openfp = open diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 583dfdb69d6b..94dcd7918cea 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -92,7 +92,7 @@ class KeyedRef(ref[_T], Generic[_KT, _T]): class WeakKeyDictionary(MutableMapping[_KT, _VT]): @overload - def __init__(self, dict: None = ...) -> None: ... + def __init__(self, dict: None = None) -> None: ... @overload def __init__(self, dict: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]]) -> None: ... def __len__(self) -> int: ... diff --git a/stdlib/webbrowser.pyi b/stdlib/webbrowser.pyi index 9f4eea3bd651..d15ae49fd1e8 100644 --- a/stdlib/webbrowser.pyi +++ b/stdlib/webbrowser.pyi @@ -58,7 +58,7 @@ class Grail(BaseBrowser): if sys.platform == "win32": class WindowsDefault(BaseBrowser): - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... if sys.platform == "darwin": class MacOSX(BaseBrowser): diff --git a/stdlib/winreg.pyi b/stdlib/winreg.pyi index 2cc42318f1a4..6377492babc7 100644 --- a/stdlib/winreg.pyi +++ b/stdlib/winreg.pyi @@ -9,17 +9,17 @@ if sys.platform == "win32": def CloseKey(__hkey: _KeyType) -> None: ... def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ... def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ... - def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ... + def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131078) -> HKEYType: ... def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... - def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... + def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = 256, reserved: int = 0) -> None: ... def DeleteValue(__key: _KeyType, __value: str) -> None: ... def EnumKey(__key: _KeyType, __index: int) -> str: ... def EnumValue(__key: _KeyType, __index: int) -> tuple[str, Any, int]: ... def ExpandEnvironmentStrings(__str: str) -> str: ... def FlushKey(__key: _KeyType) -> None: ... def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ... - def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... - def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... + def OpenKey(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... + def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... def QueryInfoKey(__key: _KeyType) -> tuple[int, int, int]: ... def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ... def QueryValueEx(__key: _KeyType, __name: str) -> tuple[Any, int]: ... diff --git a/stdlib/winsound.pyi b/stdlib/winsound.pyi index fd5a552cf9c1..9b2b57a38986 100644 --- a/stdlib/winsound.pyi +++ b/stdlib/winsound.pyi @@ -25,4 +25,4 @@ if sys.platform == "win32": def PlaySound(sound: ReadableBuffer | None, flags: Literal[4]) -> None: ... @overload def PlaySound(sound: str | ReadableBuffer | None, flags: int) -> None: ... - def MessageBeep(type: int = ...) -> None: ... + def MessageBeep(type: int = 0) -> None: ... diff --git a/stdlib/wsgiref/headers.pyi b/stdlib/wsgiref/headers.pyi index 664ed947fc72..2654d79bf4e5 100644 --- a/stdlib/wsgiref/headers.pyi +++ b/stdlib/wsgiref/headers.pyi @@ -17,7 +17,7 @@ class Headers: @overload def get(self, name: str, default: str) -> str: ... @overload - def get(self, name: str, default: str | None = ...) -> str | None: ... + def get(self, name: str, default: str | None = None) -> str | None: ... def keys(self) -> list[str]: ... def values(self) -> list[str]: ... def items(self) -> _HeaderList: ... diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index 7b008f30144f..d996f66984f9 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -29,8 +29,8 @@ class Node(xml.dom.Node): self, indent: str = "\t", newl: str = "\n", encoding: str | None = None, standalone: bool | None = None ): ... else: - def toxml(self, encoding: str | None = ...): ... - def toprettyxml(self, indent: str = ..., newl: str = ..., encoding: str | None = ...): ... + def toxml(self, encoding: str | None = None): ... + def toprettyxml(self, indent: str = "\t", newl: str = "\n", encoding: str | None = None): ... def hasChildNodes(self) -> bool: ... def insertBefore(self, newChild, refChild): ... @@ -333,10 +333,10 @@ class Document(Node, DocumentLS): def writexml( self, writer: SupportsWrite[str], - indent: str = ..., - addindent: str = ..., - newl: str = ..., - encoding: Incomplete | None = ..., + indent: str = "", + addindent: str = "", + newl: str = "", + encoding: Incomplete | None = None, ) -> None: ... def renameNode(self, n, namespaceURI: str, name): ... diff --git a/stdlib/xml/etree/ElementInclude.pyi b/stdlib/xml/etree/ElementInclude.pyi index e04cef122ad2..cbba15dd3ebe 100644 --- a/stdlib/xml/etree/ElementInclude.pyi +++ b/stdlib/xml/etree/ElementInclude.pyi @@ -25,4 +25,4 @@ if sys.version_info >= (3, 9): class LimitedRecursiveIncludeError(FatalIncludeError): ... else: - def include(elem: Element, loader: Callable[..., str | Element] | None = ...) -> None: ... + def include(elem: Element, loader: Callable[..., str | Element] | None = None) -> None: ... diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 38a4ea07d12b..cfc8504dde9f 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -54,10 +54,10 @@ def iselement(element: object) -> TypeGuard[Element]: ... if sys.version_info >= (3, 8): @overload def canonicalize( - xml_data: str | ReadableBuffer | None = ..., + xml_data: str | ReadableBuffer | None = None, *, - out: None = ..., - from_file: _FileRead | None = ..., + out: None = None, + from_file: _FileRead | None = None, with_comments: bool = ..., strip_text: bool = ..., rewrite_prefixes: bool = ..., @@ -68,10 +68,10 @@ if sys.version_info >= (3, 8): ) -> str: ... @overload def canonicalize( - xml_data: str | ReadableBuffer | None = ..., + xml_data: str | ReadableBuffer | None = None, *, out: SupportsWrite[str], - from_file: _FileRead | None = ..., + from_file: _FileRead | None = None, with_comments: bool = ..., strip_text: bool = ..., rewrite_prefixes: bool = ..., @@ -93,11 +93,11 @@ class Element: def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... @overload - def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... + def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = ...) -> _T | str: ... + def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... @overload - def get(self, key: str, default: None = ...) -> str | None: ... + def get(self, key: str, default: None = None) -> str | None: ... @overload def get(self, key: str, default: _T) -> str | _T: ... def insert(self, __index: int, __subelement: Element) -> None: ... @@ -126,7 +126,7 @@ class Element: def __setitem__(self, __s: slice, __o: Iterable[Element]) -> None: ... if sys.version_info < (3, 9): def getchildren(self) -> list[Element]: ... - def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def getiterator(self, tag: str | None = None) -> list[Element]: ... def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ... def Comment(text: str | None = None) -> Element: ... @@ -149,13 +149,13 @@ class ElementTree: def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ... def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... if sys.version_info < (3, 9): - def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def getiterator(self, tag: str | None = None) -> list[Element]: ... def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... @overload - def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... + def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = ...) -> _T | str: ... + def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... def write( @@ -176,86 +176,86 @@ if sys.version_info >= (3, 8): @overload def tostring( element: Element, - encoding: None = ..., - method: str | None = ..., + encoding: None = None, + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> bytes: ... @overload def tostring( element: Element, encoding: Literal["unicode"], - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> str: ... @overload def tostring( element: Element, encoding: str, - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> Any: ... @overload def tostringlist( element: Element, - encoding: None = ..., - method: str | None = ..., + encoding: None = None, + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[bytes]: ... @overload def tostringlist( element: Element, encoding: Literal["unicode"], - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[str]: ... @overload def tostringlist( element: Element, encoding: str, - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[Any]: ... else: @overload def tostring( - element: Element, encoding: None = ..., method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: None = None, method: str | None = None, *, short_empty_elements: bool = True ) -> bytes: ... @overload def tostring( - element: Element, encoding: Literal["unicode"], method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: Literal["unicode"], method: str | None = None, *, short_empty_elements: bool = True ) -> str: ... @overload - def tostring(element: Element, encoding: str, method: str | None = ..., *, short_empty_elements: bool = ...) -> Any: ... + def tostring(element: Element, encoding: str, method: str | None = None, *, short_empty_elements: bool = True) -> Any: ... @overload def tostringlist( - element: Element, encoding: None = ..., method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: None = None, method: str | None = None, *, short_empty_elements: bool = True ) -> list[bytes]: ... @overload def tostringlist( - element: Element, encoding: Literal["unicode"], method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: Literal["unicode"], method: str | None = None, *, short_empty_elements: bool = True ) -> list[str]: ... @overload def tostringlist( - element: Element, encoding: str, method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: str, method: str | None = None, *, short_empty_elements: bool = True ) -> list[Any]: ... def dump(elem: Element) -> None: ... diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index bd4cf62a0d40..81fc694a88b1 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -212,7 +212,7 @@ def loads( data: str, use_datetime: bool = False, use_builtin_types: bool = False ) -> tuple[tuple[_Marshallable, ...], str | None]: ... def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented -def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented +def gzip_decode(data: ReadableBuffer, max_decode: int = ...) -> bytes: ... # undocumented class GzipDecodedResponse(gzip.GzipFile): # undocumented @@ -244,7 +244,7 @@ class Transport: self, use_datetime: bool = False, use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = ... ) -> None: ... else: - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False) -> None: ... def request( self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = False @@ -275,7 +275,9 @@ class SafeTransport(Transport): context: Any | None = None, ) -> None: ... else: - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, context: Any | None = ...) -> None: ... + def __init__( + self, use_datetime: bool = False, use_builtin_types: bool = False, *, context: Any | None = None + ) -> None: ... def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... @@ -306,14 +308,14 @@ class ServerProxy: def __init__( self, uri: str, - transport: Transport | None = ..., - encoding: str | None = ..., - verbose: bool = ..., - allow_none: bool = ..., - use_datetime: bool = ..., - use_builtin_types: bool = ..., + transport: Transport | None = None, + encoding: str | None = None, + verbose: bool = False, + allow_none: bool = False, + use_datetime: bool = False, + use_builtin_types: bool = False, *, - context: Any | None = ..., + context: Any | None = None, ) -> None: ... def __getattr__(self, name: str) -> _Method: ... diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index c4c33d5d2876..ccf9df417d56 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -70,7 +70,7 @@ class ZipExtFile(io.BufferedIOBase): fileobj: _ClosableZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, - pwd: bytes | None = ..., + pwd: bytes | None = None, *, close_fileobj: Literal[True], ) -> None: ... @@ -80,8 +80,8 @@ class ZipExtFile(io.BufferedIOBase): fileobj: _ZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, - pwd: bytes | None = ..., - close_fileobj: Literal[False] = ..., + pwd: bytes | None = None, + close_fileobj: Literal[False] = False, ) -> None: ... def read(self, n: int | None = -1) -> bytes: ... def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override] @@ -109,45 +109,45 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: Literal["r"] = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: Literal["r"] = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., + strict_timestamps: bool = True, metadata_encoding: str | None, ) -> None: ... @overload def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., - metadata_encoding: None = ..., + strict_timestamps: bool = True, + metadata_encoding: None = None, ) -> None: ... elif sys.version_info >= (3, 8): def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., + strict_timestamps: bool = True, ) -> None: ... else: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = "r", + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, ) -> None: ... def __enter__(self: Self) -> Self: ... @@ -219,7 +219,7 @@ class ZipInfo: ) -> Self: ... else: @classmethod - def from_file(cls: type[Self], filename: StrPath, arcname: StrPath | None = ...) -> Self: ... + def from_file(cls: type[Self], filename: StrPath, arcname: StrPath | None = None) -> Self: ... def is_dir(self) -> bool: ... def FileHeader(self, zip64: bool | None = None) -> bytes: ... diff --git a/stdlib/zlib.pyi b/stdlib/zlib.pyi index 3f77dd958021..4f719b3a54fc 100644 --- a/stdlib/zlib.pyi +++ b/stdlib/zlib.pyi @@ -46,7 +46,7 @@ if sys.version_info >= (3, 11): def compress(__data: ReadableBuffer, level: int = -1, wbits: int = 15) -> bytes: ... else: - def compress(__data: ReadableBuffer, level: int = ...) -> bytes: ... + def compress(__data: ReadableBuffer, level: int = -1) -> bytes: ... def compressobj( level: int = -1, method: int = 8, wbits: int = 15, memLevel: int = 8, strategy: int = 0, zdict: ReadableBuffer | None = None diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 21c09df701a7..d2716d1ab5eb 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -1,114 +1,23 @@ -# wrong argument name in implementation ("self" instead of "cls") -sqlalchemy.engine.URL.__new__ -sqlalchemy.engine.url.URL.__new__ -sqlalchemy.util.langhelpers._symbol.__new__ - -# unnecessary re-exports -sqlalchemy.util._collections.* -sqlalchemy.util.compat.* - -# forwards arguments to another function +# Expanding keyword arguments in stubs sqlalchemy.ext.declarative.as_declarative -# stdlib re-exports with stubtest issues -sqlalchemy.orm.collections.InstrumentedList.* -sqlalchemy.orm.collections.InstrumentedSet.* -sqlalchemy.orm.collections.MappedCollection.* -sqlalchemy.util.StringIO.* - -# method arguments starting with double underscores in the implementation -sqlalchemy.testing.resolve_lambda -sqlalchemy.testing.util.resolve_lambda -sqlalchemy.util.WeakSequence.__init__ - # not always present sqlalchemy.engine.Engine.logging_name # initialized if not None sqlalchemy.engine.base.Engine.logging_name # initialized if not None sqlalchemy.sql.lambdas.PyWrapper.__clause_element__ sqlalchemy.testing.util.non_refcount_gc_collect -# replaced at runtime -sqlalchemy.orm.strategy_options.contains_eager -sqlalchemy.orm.strategy_options.load_only -sqlalchemy.orm.strategy_options.joinedload -sqlalchemy.orm.strategy_options.subqueryload -sqlalchemy.orm.strategy_options.selectinload -sqlalchemy.orm.strategy_options.lazyload -sqlalchemy.orm.strategy_options.immediateload -sqlalchemy.orm.strategy_options.noload -sqlalchemy.orm.strategy_options.raiseload -sqlalchemy.orm.strategy_options.defaultload -sqlalchemy.orm.strategy_options.defer -sqlalchemy.orm.strategy_options.undefer -sqlalchemy.orm.strategy_options.undefer_group -sqlalchemy.orm.strategy_options.with_expression -sqlalchemy.orm.strategy_options.selectin_polymorphic -sqlalchemy.testing.provision.configure_follower -sqlalchemy.testing.provision.create_db -sqlalchemy.testing.provision.drop_all_schema_objects_post_tables -sqlalchemy.testing.provision.drop_all_schema_objects_pre_tables -sqlalchemy.testing.provision.drop_db -sqlalchemy.testing.provision.follower_url_from_main -sqlalchemy.testing.provision.generate_driver_url -sqlalchemy.testing.provision.get_temp_table_name -sqlalchemy.testing.provision.post_configure_engine -sqlalchemy.testing.provision.prepare_for_drop_tables -sqlalchemy.testing.provision.run_reap_dbs -sqlalchemy.testing.provision.set_default_schema_on_connection -sqlalchemy.testing.provision.stop_test_class_outside_fixtures -sqlalchemy.testing.provision.temp_table_keyword_args -sqlalchemy.testing.provision.update_db_opts - -# KeyError/AttributeError on import due to dynamic initialization from a different module -sqlalchemy.testing.fixtures -sqlalchemy.testing.pickleable -sqlalchemy.testing.plugin.bootstrap - -# Initialized to bool during __init__() -sqlalchemy.orm.Mapper.single -sqlalchemy.orm.mapper.Mapper.single - -# Dynamically added methods where the first argument is not named "self" -sqlalchemy.orm.Load.contains_eager -sqlalchemy.orm.Load.defaultload -sqlalchemy.orm.Load.defer -sqlalchemy.orm.Load.immediateload -sqlalchemy.orm.Load.joinedload -sqlalchemy.orm.Load.lazyload -sqlalchemy.orm.Load.load_only -sqlalchemy.orm.Load.noload -sqlalchemy.orm.Load.raiseload -sqlalchemy.orm.Load.selectin_polymorphic -sqlalchemy.orm.Load.selectinload -sqlalchemy.orm.Load.subqueryload -sqlalchemy.orm.Load.undefer -sqlalchemy.orm.Load.undefer_group -sqlalchemy.orm.Load.with_expression -sqlalchemy.orm.strategy_options.Load.contains_eager -sqlalchemy.orm.strategy_options.Load.defaultload -sqlalchemy.orm.strategy_options.Load.defer -sqlalchemy.orm.strategy_options.Load.immediateload -sqlalchemy.orm.strategy_options.Load.joinedload -sqlalchemy.orm.strategy_options.Load.lazyload -sqlalchemy.orm.strategy_options.Load.load_only -sqlalchemy.orm.strategy_options.Load.noload -sqlalchemy.orm.strategy_options.Load.raiseload -sqlalchemy.orm.strategy_options.Load.selectin_polymorphic -sqlalchemy.orm.strategy_options.Load.selectinload -sqlalchemy.orm.strategy_options.Load.subqueryload -sqlalchemy.orm.strategy_options.Load.undefer -sqlalchemy.orm.strategy_options.Load.undefer_group -sqlalchemy.orm.strategy_options.Load.with_expression - # abstract fields not present at runtime sqlalchemy.engine.Transaction.connection sqlalchemy.engine.Transaction.is_active sqlalchemy.engine.base.Transaction.connection sqlalchemy.engine.base.Transaction.is_active -# initialized to None during class construction, but overridden during __init__() -sqlalchemy.engine.Connection.engine +# initialized to None during class construction, but overridden during __init__() or __new__() sqlalchemy.engine.base.Connection.engine +sqlalchemy.engine.Connection.engine +sqlalchemy.orm.Mapper.single +sqlalchemy.orm.mapper.Mapper.single # uses @memoized_property at runtime, but we use @property for compatibility sqlalchemy.engine.URL.normalized_query @@ -126,1067 +35,29 @@ sqlalchemy.sql.annotation.Annotated.__new__ # as having conflicting __new__/__init__ methods sqlalchemy.orm.unitofwork.PostSortRec.__new__ -# unclear problems +# KeyError/AttributeError on import due to dynamic initialization from a different module +sqlalchemy.testing.fixtures +sqlalchemy.testing.pickleable +sqlalchemy.testing.plugin.bootstrap + +# method arguments starting with double underscores in the implementation trips up stubtest +sqlalchemy.testing.resolve_lambda +sqlalchemy.testing.util.resolve_lambda +sqlalchemy.orm.collections.MappedCollection.update + +# stubtest thinks __slots__ are always members +# https://github.com/python/mypy/issues/13906 sqlalchemy.sql.elements.quoted_name.lower sqlalchemy.sql.elements.quoted_name.upper sqlalchemy.sql.expression.quoted_name.lower sqlalchemy.sql.expression.quoted_name.upper sqlalchemy.sql.quoted_name.lower sqlalchemy.sql.quoted_name.upper -sqlalchemy.util.callable - -sqlalchemy.dialects.mssql.base.MSExecutionContext.get_result_cursor_strategy -sqlalchemy.dialects.postgresql.base.PGDDLCompiler.visit_foreign_key_constraint -sqlalchemy.engine.ExecutionContext.get_result_cursor_strategy -sqlalchemy.engine.interfaces.ExecutionContext.get_result_cursor_strategy sqlalchemy.orm.ColumnProperty.Comparator.__clause_element__ sqlalchemy.orm.properties.ColumnProperty.Comparator.__clause_element__ -# Metaclass differs: -sqlalchemy.ARRAY -sqlalchemy.BIGINT -sqlalchemy.BINARY -sqlalchemy.BLOB -sqlalchemy.BOOLEAN -sqlalchemy.BigInteger -sqlalchemy.Boolean -sqlalchemy.CHAR -sqlalchemy.CLOB -sqlalchemy.CheckConstraint -sqlalchemy.Column -sqlalchemy.ColumnDefault -sqlalchemy.Computed -sqlalchemy.Constraint -sqlalchemy.DATE -sqlalchemy.DATETIME -sqlalchemy.DDL -sqlalchemy.DECIMAL -sqlalchemy.Date -sqlalchemy.DateTime -sqlalchemy.Enum -sqlalchemy.FLOAT -sqlalchemy.Float -sqlalchemy.ForeignKey -sqlalchemy.ForeignKeyConstraint -sqlalchemy.INTEGER -sqlalchemy.Identity -sqlalchemy.Index -sqlalchemy.Integer -sqlalchemy.Interval -sqlalchemy.JSON -sqlalchemy.JSON.JSONElementType -sqlalchemy.JSON.JSONIndexType -sqlalchemy.JSON.JSONIntIndexType -sqlalchemy.JSON.JSONPathType -sqlalchemy.JSON.JSONStrIndexType -sqlalchemy.LargeBinary -sqlalchemy.MetaData -sqlalchemy.NCHAR -sqlalchemy.NUMERIC -sqlalchemy.NVARCHAR -sqlalchemy.Numeric -sqlalchemy.PickleType -sqlalchemy.PrimaryKeyConstraint -sqlalchemy.REAL -sqlalchemy.SMALLINT -sqlalchemy.Sequence -sqlalchemy.SmallInteger -sqlalchemy.String -sqlalchemy.TEXT -sqlalchemy.TIME -sqlalchemy.TIMESTAMP -sqlalchemy.Table -sqlalchemy.Text -sqlalchemy.ThreadLocalMetaData -sqlalchemy.Time -sqlalchemy.TupleType -sqlalchemy.TypeDecorator -sqlalchemy.Unicode -sqlalchemy.UnicodeText -sqlalchemy.UniqueConstraint -sqlalchemy.VARBINARY -sqlalchemy.VARCHAR -sqlalchemy.dialects.firebird.BIGINT -sqlalchemy.dialects.firebird.BLOB -sqlalchemy.dialects.firebird.CHAR -sqlalchemy.dialects.firebird.DATE -sqlalchemy.dialects.firebird.FLOAT -sqlalchemy.dialects.firebird.NUMERIC -sqlalchemy.dialects.firebird.SMALLINT -sqlalchemy.dialects.firebird.TEXT -sqlalchemy.dialects.firebird.TIME -sqlalchemy.dialects.firebird.TIMESTAMP -sqlalchemy.dialects.firebird.VARCHAR -sqlalchemy.dialects.firebird.base.BIGINT -sqlalchemy.dialects.firebird.base.BLOB -sqlalchemy.dialects.firebird.base.CHAR -sqlalchemy.dialects.firebird.base.DATE -sqlalchemy.dialects.firebird.base.FBTypeCompiler -sqlalchemy.dialects.firebird.base.FLOAT -sqlalchemy.dialects.firebird.base.INTEGER -sqlalchemy.dialects.firebird.base.Integer -sqlalchemy.dialects.firebird.base.NUMERIC -sqlalchemy.dialects.firebird.base.SMALLINT -sqlalchemy.dialects.firebird.base.TEXT -sqlalchemy.dialects.firebird.base.TIME -sqlalchemy.dialects.firebird.base.TIMESTAMP -sqlalchemy.dialects.firebird.base.VARCHAR -sqlalchemy.dialects.firebird.base._FBDateTime -sqlalchemy.dialects.firebird.base._StringType -sqlalchemy.dialects.firebird.kinterbasdb._FBFloat_kinterbasdb -sqlalchemy.dialects.firebird.kinterbasdb._FBNumeric_kinterbasdb -sqlalchemy.dialects.mssql.BIGINT -sqlalchemy.dialects.mssql.BINARY -sqlalchemy.dialects.mssql.BIT -sqlalchemy.dialects.mssql.CHAR -sqlalchemy.dialects.mssql.DATE -sqlalchemy.dialects.mssql.DATETIME -sqlalchemy.dialects.mssql.DATETIME2 -sqlalchemy.dialects.mssql.DATETIMEOFFSET -sqlalchemy.dialects.mssql.DECIMAL -sqlalchemy.dialects.mssql.FLOAT -sqlalchemy.dialects.mssql.IMAGE -sqlalchemy.dialects.mssql.INTEGER -sqlalchemy.dialects.mssql.JSON -sqlalchemy.dialects.mssql.MONEY -sqlalchemy.dialects.mssql.NCHAR -sqlalchemy.dialects.mssql.NTEXT -sqlalchemy.dialects.mssql.NUMERIC -sqlalchemy.dialects.mssql.NVARCHAR -sqlalchemy.dialects.mssql.REAL -sqlalchemy.dialects.mssql.ROWVERSION -sqlalchemy.dialects.mssql.SMALLDATETIME -sqlalchemy.dialects.mssql.SMALLINT -sqlalchemy.dialects.mssql.SMALLMONEY -sqlalchemy.dialects.mssql.SQL_VARIANT -sqlalchemy.dialects.mssql.TEXT -sqlalchemy.dialects.mssql.TIME -sqlalchemy.dialects.mssql.TIMESTAMP -sqlalchemy.dialects.mssql.TINYINT -sqlalchemy.dialects.mssql.UNIQUEIDENTIFIER -sqlalchemy.dialects.mssql.VARBINARY -sqlalchemy.dialects.mssql.VARCHAR -sqlalchemy.dialects.mssql.XML -sqlalchemy.dialects.mssql.base.BIGINT -sqlalchemy.dialects.mssql.base.BINARY -sqlalchemy.dialects.mssql.base.BIT -sqlalchemy.dialects.mssql.base.CHAR -sqlalchemy.dialects.mssql.base.DATE -sqlalchemy.dialects.mssql.base.DATETIME -sqlalchemy.dialects.mssql.base.DATETIME2 -sqlalchemy.dialects.mssql.base.DATETIMEOFFSET -sqlalchemy.dialects.mssql.base.DECIMAL -sqlalchemy.dialects.mssql.base.FLOAT -sqlalchemy.dialects.mssql.base.IMAGE -sqlalchemy.dialects.mssql.base.INTEGER -sqlalchemy.dialects.mssql.base.JSON -sqlalchemy.dialects.mssql.base.MONEY -sqlalchemy.dialects.mssql.base.MSTypeCompiler -sqlalchemy.dialects.mssql.base.NCHAR -sqlalchemy.dialects.mssql.base.NTEXT -sqlalchemy.dialects.mssql.base.NUMERIC -sqlalchemy.dialects.mssql.base.NVARCHAR -sqlalchemy.dialects.mssql.base.REAL -sqlalchemy.dialects.mssql.base.ROWVERSION -sqlalchemy.dialects.mssql.base.SMALLDATETIME -sqlalchemy.dialects.mssql.base.SMALLINT -sqlalchemy.dialects.mssql.base.SMALLMONEY -sqlalchemy.dialects.mssql.base.SQL_VARIANT -sqlalchemy.dialects.mssql.base.TEXT -sqlalchemy.dialects.mssql.base.TIME -sqlalchemy.dialects.mssql.base.TIMESTAMP -sqlalchemy.dialects.mssql.base.TINYINT -sqlalchemy.dialects.mssql.base.TryCast -sqlalchemy.dialects.mssql.base.UNIQUEIDENTIFIER -sqlalchemy.dialects.mssql.base.VARBINARY -sqlalchemy.dialects.mssql.base.VARCHAR -sqlalchemy.dialects.mssql.base.XML -sqlalchemy.dialects.mssql.base._BASETIMEIMPL -sqlalchemy.dialects.mssql.base._MSDate -sqlalchemy.dialects.mssql.base._MSDateTime -sqlalchemy.dialects.mssql.base._MSUnicode -sqlalchemy.dialects.mssql.base._MSUnicodeText -sqlalchemy.dialects.mssql.information_schema.CoerceUnicode -sqlalchemy.dialects.mssql.information_schema.IdentitySqlVariant -sqlalchemy.dialects.mssql.information_schema._cast_on_2005 -sqlalchemy.dialects.mssql.json.JSON -sqlalchemy.dialects.mssql.json.JSONIndexType -sqlalchemy.dialects.mssql.json.JSONPathType -sqlalchemy.dialects.mssql.mxodbc._MSDate_mxodbc -sqlalchemy.dialects.mssql.mxodbc._MSNumeric_mxodbc -sqlalchemy.dialects.mssql.mxodbc._MSTime_mxodbc -sqlalchemy.dialects.mssql.mxodbc._VARBINARY_mxodbc -sqlalchemy.dialects.mssql.pymssql._MSNumeric_pymssql -sqlalchemy.dialects.mssql.pyodbc._BINARY_pyodbc -sqlalchemy.dialects.mssql.pyodbc._MSFloat_pyodbc -sqlalchemy.dialects.mssql.pyodbc._MSNumeric_pyodbc -sqlalchemy.dialects.mssql.pyodbc._ODBCDATETIMEOFFSET -sqlalchemy.dialects.mssql.pyodbc._ODBCDateTime -sqlalchemy.dialects.mssql.pyodbc._VARBINARY_pyodbc -sqlalchemy.dialects.mysql.BIGINT -sqlalchemy.dialects.mysql.BINARY -sqlalchemy.dialects.mysql.BIT -sqlalchemy.dialects.mysql.BLOB -sqlalchemy.dialects.mysql.BOOLEAN -sqlalchemy.dialects.mysql.CHAR -sqlalchemy.dialects.mysql.DATE -sqlalchemy.dialects.mysql.DATETIME -sqlalchemy.dialects.mysql.DECIMAL -sqlalchemy.dialects.mysql.DOUBLE -sqlalchemy.dialects.mysql.ENUM -sqlalchemy.dialects.mysql.FLOAT -sqlalchemy.dialects.mysql.INTEGER -sqlalchemy.dialects.mysql.Insert -sqlalchemy.dialects.mysql.JSON -sqlalchemy.dialects.mysql.LONGBLOB -sqlalchemy.dialects.mysql.LONGTEXT -sqlalchemy.dialects.mysql.MEDIUMBLOB -sqlalchemy.dialects.mysql.MEDIUMINT -sqlalchemy.dialects.mysql.MEDIUMTEXT -sqlalchemy.dialects.mysql.NCHAR -sqlalchemy.dialects.mysql.NUMERIC -sqlalchemy.dialects.mysql.NVARCHAR -sqlalchemy.dialects.mysql.REAL -sqlalchemy.dialects.mysql.SET -sqlalchemy.dialects.mysql.SMALLINT -sqlalchemy.dialects.mysql.TEXT -sqlalchemy.dialects.mysql.TIME -sqlalchemy.dialects.mysql.TIMESTAMP -sqlalchemy.dialects.mysql.TINYBLOB -sqlalchemy.dialects.mysql.TINYINT -sqlalchemy.dialects.mysql.TINYTEXT -sqlalchemy.dialects.mysql.VARBINARY -sqlalchemy.dialects.mysql.VARCHAR -sqlalchemy.dialects.mysql.YEAR -sqlalchemy.dialects.mysql.base.BIGINT -sqlalchemy.dialects.mysql.base.BINARY -sqlalchemy.dialects.mysql.base.BIT -sqlalchemy.dialects.mysql.base.BLOB -sqlalchemy.dialects.mysql.base.BOOLEAN -sqlalchemy.dialects.mysql.base.CHAR -sqlalchemy.dialects.mysql.base.DATE -sqlalchemy.dialects.mysql.base.DATETIME -sqlalchemy.dialects.mysql.base.DECIMAL -sqlalchemy.dialects.mysql.base.DOUBLE -sqlalchemy.dialects.mysql.base.ENUM -sqlalchemy.dialects.mysql.base.FLOAT -sqlalchemy.dialects.mysql.base.INTEGER -sqlalchemy.dialects.mysql.base.JSON -sqlalchemy.dialects.mysql.base.LONGBLOB -sqlalchemy.dialects.mysql.base.LONGTEXT -sqlalchemy.dialects.mysql.base.MEDIUMBLOB -sqlalchemy.dialects.mysql.base.MEDIUMINT -sqlalchemy.dialects.mysql.base.MEDIUMTEXT -sqlalchemy.dialects.mysql.base.MySQLTypeCompiler -sqlalchemy.dialects.mysql.base.NCHAR -sqlalchemy.dialects.mysql.base.NUMERIC -sqlalchemy.dialects.mysql.base.NVARCHAR -sqlalchemy.dialects.mysql.base.REAL -sqlalchemy.dialects.mysql.base.SET -sqlalchemy.dialects.mysql.base.SMALLINT -sqlalchemy.dialects.mysql.base.TEXT -sqlalchemy.dialects.mysql.base.TIME -sqlalchemy.dialects.mysql.base.TIMESTAMP -sqlalchemy.dialects.mysql.base.TINYBLOB -sqlalchemy.dialects.mysql.base.TINYINT -sqlalchemy.dialects.mysql.base.TINYTEXT -sqlalchemy.dialects.mysql.base.VARBINARY -sqlalchemy.dialects.mysql.base.VARCHAR -sqlalchemy.dialects.mysql.base.YEAR -sqlalchemy.dialects.mysql.cymysql._cymysqlBIT -sqlalchemy.dialects.mysql.dml.Insert -sqlalchemy.dialects.mysql.dml.OnDuplicateClause -sqlalchemy.dialects.mysql.enumerated.ENUM -sqlalchemy.dialects.mysql.enumerated.SET -sqlalchemy.dialects.mysql.expression.match -sqlalchemy.dialects.mysql.json.JSON -sqlalchemy.dialects.mysql.json.JSONIndexType -sqlalchemy.dialects.mysql.json.JSONPathType -sqlalchemy.dialects.mysql.match -sqlalchemy.dialects.mysql.mysqlconnector._myconnpyBIT -sqlalchemy.dialects.mysql.oursql._oursqlBIT -sqlalchemy.dialects.mysql.pyodbc._pyodbcTIME -sqlalchemy.dialects.mysql.types.BIGINT -sqlalchemy.dialects.mysql.types.BIT -sqlalchemy.dialects.mysql.types.CHAR -sqlalchemy.dialects.mysql.types.DATETIME -sqlalchemy.dialects.mysql.types.DECIMAL -sqlalchemy.dialects.mysql.types.DOUBLE -sqlalchemy.dialects.mysql.types.FLOAT -sqlalchemy.dialects.mysql.types.INTEGER -sqlalchemy.dialects.mysql.types.LONGBLOB -sqlalchemy.dialects.mysql.types.LONGTEXT -sqlalchemy.dialects.mysql.types.MEDIUMBLOB -sqlalchemy.dialects.mysql.types.MEDIUMINT -sqlalchemy.dialects.mysql.types.MEDIUMTEXT -sqlalchemy.dialects.mysql.types.NCHAR -sqlalchemy.dialects.mysql.types.NUMERIC -sqlalchemy.dialects.mysql.types.NVARCHAR -sqlalchemy.dialects.mysql.types.REAL -sqlalchemy.dialects.mysql.types.SMALLINT -sqlalchemy.dialects.mysql.types.TEXT -sqlalchemy.dialects.mysql.types.TIME -sqlalchemy.dialects.mysql.types.TIMESTAMP -sqlalchemy.dialects.mysql.types.TINYBLOB -sqlalchemy.dialects.mysql.types.TINYINT -sqlalchemy.dialects.mysql.types.TINYTEXT -sqlalchemy.dialects.mysql.types.VARCHAR -sqlalchemy.dialects.mysql.types.YEAR -sqlalchemy.dialects.mysql.types._FloatType -sqlalchemy.dialects.mysql.types._IntegerType -sqlalchemy.dialects.mysql.types._MatchType -sqlalchemy.dialects.mysql.types._StringType -sqlalchemy.dialects.oracle.BFILE -sqlalchemy.dialects.oracle.BINARY_DOUBLE -sqlalchemy.dialects.oracle.BINARY_FLOAT -sqlalchemy.dialects.oracle.BLOB -sqlalchemy.dialects.oracle.CHAR -sqlalchemy.dialects.oracle.CLOB -sqlalchemy.dialects.oracle.DATE -sqlalchemy.dialects.oracle.DOUBLE_PRECISION -sqlalchemy.dialects.oracle.FLOAT -sqlalchemy.dialects.oracle.INTERVAL -sqlalchemy.dialects.oracle.LONG -sqlalchemy.dialects.oracle.NCHAR -sqlalchemy.dialects.oracle.NCLOB -sqlalchemy.dialects.oracle.NUMBER -sqlalchemy.dialects.oracle.NVARCHAR -sqlalchemy.dialects.oracle.RAW -sqlalchemy.dialects.oracle.ROWID -sqlalchemy.dialects.oracle.TIMESTAMP -sqlalchemy.dialects.oracle.VARCHAR -sqlalchemy.dialects.oracle.VARCHAR2 -sqlalchemy.dialects.oracle.base.BFILE -sqlalchemy.dialects.oracle.base.BINARY_DOUBLE -sqlalchemy.dialects.oracle.base.BINARY_FLOAT -sqlalchemy.dialects.oracle.base.BLOB -sqlalchemy.dialects.oracle.base.CHAR -sqlalchemy.dialects.oracle.base.CLOB -sqlalchemy.dialects.oracle.base.DATE -sqlalchemy.dialects.oracle.base.DOUBLE_PRECISION -sqlalchemy.dialects.oracle.base.FLOAT -sqlalchemy.dialects.oracle.base.INTEGER -sqlalchemy.dialects.oracle.base.INTERVAL -sqlalchemy.dialects.oracle.base.LONG -sqlalchemy.dialects.oracle.base.NCHAR -sqlalchemy.dialects.oracle.base.NCLOB -sqlalchemy.dialects.oracle.base.NUMBER -sqlalchemy.dialects.oracle.base.NVARCHAR -sqlalchemy.dialects.oracle.base.OracleTypeCompiler -sqlalchemy.dialects.oracle.base.RAW -sqlalchemy.dialects.oracle.base.ROWID -sqlalchemy.dialects.oracle.base.TIMESTAMP -sqlalchemy.dialects.oracle.base.VARCHAR -sqlalchemy.dialects.oracle.base.VARCHAR2 -sqlalchemy.dialects.oracle.base._OracleBoolean -sqlalchemy.dialects.oracle.base._OuterJoinColumn -sqlalchemy.dialects.oracle.cx_oracle._OracleBINARY_DOUBLE -sqlalchemy.dialects.oracle.cx_oracle._OracleBINARY_FLOAT -sqlalchemy.dialects.oracle.cx_oracle._OracleBinary -sqlalchemy.dialects.oracle.cx_oracle._OracleBinaryFloat -sqlalchemy.dialects.oracle.cx_oracle._OracleChar -sqlalchemy.dialects.oracle.cx_oracle._OracleDate -sqlalchemy.dialects.oracle.cx_oracle._OracleEnum -sqlalchemy.dialects.oracle.cx_oracle._OracleInteger -sqlalchemy.dialects.oracle.cx_oracle._OracleInterval -sqlalchemy.dialects.oracle.cx_oracle._OracleLong -sqlalchemy.dialects.oracle.cx_oracle._OracleNChar -sqlalchemy.dialects.oracle.cx_oracle._OracleNUMBER -sqlalchemy.dialects.oracle.cx_oracle._OracleNumeric -sqlalchemy.dialects.oracle.cx_oracle._OracleRaw -sqlalchemy.dialects.oracle.cx_oracle._OracleRowid -sqlalchemy.dialects.oracle.cx_oracle._OracleString -sqlalchemy.dialects.oracle.cx_oracle._OracleText -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeStringCHAR -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeStringNCHAR -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeTextCLOB -sqlalchemy.dialects.oracle.cx_oracle._OracleUnicodeTextNCLOB -sqlalchemy.dialects.postgresql.ARRAY -sqlalchemy.dialects.postgresql.BIGINT -sqlalchemy.dialects.postgresql.BIT -sqlalchemy.dialects.postgresql.BOOLEAN -sqlalchemy.dialects.postgresql.BYTEA -sqlalchemy.dialects.postgresql.CHAR -sqlalchemy.dialects.postgresql.CIDR -sqlalchemy.dialects.postgresql.CreateEnumType -sqlalchemy.dialects.postgresql.DATE -sqlalchemy.dialects.postgresql.DATERANGE -sqlalchemy.dialects.postgresql.DOUBLE_PRECISION -sqlalchemy.dialects.postgresql.DropEnumType -sqlalchemy.dialects.postgresql.ENUM -sqlalchemy.dialects.postgresql.ExcludeConstraint -sqlalchemy.dialects.postgresql.FLOAT -sqlalchemy.dialects.postgresql.HSTORE -sqlalchemy.dialects.postgresql.INET -sqlalchemy.dialects.postgresql.INT4RANGE -sqlalchemy.dialects.postgresql.INT8RANGE -sqlalchemy.dialects.postgresql.INTEGER -sqlalchemy.dialects.postgresql.INTERVAL -sqlalchemy.dialects.postgresql.Insert -sqlalchemy.dialects.postgresql.JSON -sqlalchemy.dialects.postgresql.JSONB -sqlalchemy.dialects.postgresql.MACADDR -sqlalchemy.dialects.postgresql.MACADDR8 -sqlalchemy.dialects.postgresql.MONEY -sqlalchemy.dialects.postgresql.NUMERIC -sqlalchemy.dialects.postgresql.NUMRANGE -sqlalchemy.dialects.postgresql.OID -sqlalchemy.dialects.postgresql.REAL -sqlalchemy.dialects.postgresql.REGCLASS -sqlalchemy.dialects.postgresql.SMALLINT -sqlalchemy.dialects.postgresql.TEXT -sqlalchemy.dialects.postgresql.TIME -sqlalchemy.dialects.postgresql.TIMESTAMP -sqlalchemy.dialects.postgresql.TSRANGE -sqlalchemy.dialects.postgresql.TSTZRANGE -sqlalchemy.dialects.postgresql.TSVECTOR -sqlalchemy.dialects.postgresql.UUID -sqlalchemy.dialects.postgresql.VARCHAR -sqlalchemy.dialects.postgresql.aggregate_order_by -sqlalchemy.dialects.postgresql.array -sqlalchemy.dialects.postgresql.array.ARRAY -sqlalchemy.dialects.postgresql.array.array -sqlalchemy.dialects.postgresql.asyncpg.AsyncPgEnum -sqlalchemy.dialects.postgresql.asyncpg.AsyncPgInterval -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgBigInteger -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgBoolean -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgDate -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgDateTime -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgFloat -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgInteger -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSON -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONB -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONIntIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONPathType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgJSONStrIndexType -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgNumeric -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgOID -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgREGCLASS -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgTime -sqlalchemy.dialects.postgresql.asyncpg.AsyncpgUUID -sqlalchemy.dialects.postgresql.base.BIGINT -sqlalchemy.dialects.postgresql.base.BIT -sqlalchemy.dialects.postgresql.base.BOOLEAN -sqlalchemy.dialects.postgresql.base.BYTEA -sqlalchemy.dialects.postgresql.base.CHAR -sqlalchemy.dialects.postgresql.base.CIDR -sqlalchemy.dialects.postgresql.base.CreateEnumType -sqlalchemy.dialects.postgresql.base.DATE -sqlalchemy.dialects.postgresql.base.DOUBLE_PRECISION -sqlalchemy.dialects.postgresql.base.DropEnumType -sqlalchemy.dialects.postgresql.base.ENUM -sqlalchemy.dialects.postgresql.base.FLOAT -sqlalchemy.dialects.postgresql.base.INET -sqlalchemy.dialects.postgresql.base.INTEGER -sqlalchemy.dialects.postgresql.base.INTERVAL -sqlalchemy.dialects.postgresql.base.MACADDR -sqlalchemy.dialects.postgresql.base.MACADDR8 -sqlalchemy.dialects.postgresql.base.MONEY -sqlalchemy.dialects.postgresql.base.NUMERIC -sqlalchemy.dialects.postgresql.base.OID -sqlalchemy.dialects.postgresql.base.PGTypeCompiler -sqlalchemy.dialects.postgresql.base.REAL -sqlalchemy.dialects.postgresql.base.REGCLASS -sqlalchemy.dialects.postgresql.base.SMALLINT -sqlalchemy.dialects.postgresql.base.TEXT -sqlalchemy.dialects.postgresql.base.TIME -sqlalchemy.dialects.postgresql.base.TIMESTAMP -sqlalchemy.dialects.postgresql.base.TSVECTOR -sqlalchemy.dialects.postgresql.base.UUID -sqlalchemy.dialects.postgresql.base.VARCHAR -sqlalchemy.dialects.postgresql.base._ColonCast -sqlalchemy.dialects.postgresql.dml.Insert -sqlalchemy.dialects.postgresql.dml.OnConflictClause -sqlalchemy.dialects.postgresql.dml.OnConflictDoNothing -sqlalchemy.dialects.postgresql.dml.OnConflictDoUpdate -sqlalchemy.dialects.postgresql.ext.ExcludeConstraint -sqlalchemy.dialects.postgresql.ext.aggregate_order_by -sqlalchemy.dialects.postgresql.hstore -sqlalchemy.dialects.postgresql.hstore.HSTORE -sqlalchemy.dialects.postgresql.hstore._HStoreArrayFunction -sqlalchemy.dialects.postgresql.hstore._HStoreDefinedFunction -sqlalchemy.dialects.postgresql.hstore._HStoreDeleteFunction -sqlalchemy.dialects.postgresql.hstore._HStoreKeysFunction -sqlalchemy.dialects.postgresql.hstore._HStoreMatrixFunction -sqlalchemy.dialects.postgresql.hstore._HStoreSliceFunction -sqlalchemy.dialects.postgresql.hstore._HStoreValsFunction -sqlalchemy.dialects.postgresql.hstore.hstore -sqlalchemy.dialects.postgresql.json.JSON -sqlalchemy.dialects.postgresql.json.JSONB -sqlalchemy.dialects.postgresql.json.JSONPathType -sqlalchemy.dialects.postgresql.pg8000._PGARRAY -sqlalchemy.dialects.postgresql.pg8000._PGBigInteger -sqlalchemy.dialects.postgresql.pg8000._PGBoolean -sqlalchemy.dialects.postgresql.pg8000._PGEnum -sqlalchemy.dialects.postgresql.pg8000._PGInteger -sqlalchemy.dialects.postgresql.pg8000._PGInterval -sqlalchemy.dialects.postgresql.pg8000._PGJSON -sqlalchemy.dialects.postgresql.pg8000._PGJSONB -sqlalchemy.dialects.postgresql.pg8000._PGJSONIndexType -sqlalchemy.dialects.postgresql.pg8000._PGJSONIntIndexType -sqlalchemy.dialects.postgresql.pg8000._PGJSONPathType -sqlalchemy.dialects.postgresql.pg8000._PGJSONStrIndexType -sqlalchemy.dialects.postgresql.pg8000._PGNullType -sqlalchemy.dialects.postgresql.pg8000._PGNumeric -sqlalchemy.dialects.postgresql.pg8000._PGNumericNoBind -sqlalchemy.dialects.postgresql.pg8000._PGSmallInteger -sqlalchemy.dialects.postgresql.pg8000._PGTime -sqlalchemy.dialects.postgresql.pg8000._PGTimeStamp -sqlalchemy.dialects.postgresql.pg8000._PGUUID -sqlalchemy.dialects.postgresql.psycopg2._PGARRAY -sqlalchemy.dialects.postgresql.psycopg2._PGEnum -sqlalchemy.dialects.postgresql.psycopg2._PGHStore -sqlalchemy.dialects.postgresql.psycopg2._PGJSON -sqlalchemy.dialects.postgresql.psycopg2._PGJSONB -sqlalchemy.dialects.postgresql.psycopg2._PGNumeric -sqlalchemy.dialects.postgresql.psycopg2._PGUUID -sqlalchemy.dialects.postgresql.pygresql._PGHStore -sqlalchemy.dialects.postgresql.pygresql._PGJSON -sqlalchemy.dialects.postgresql.pygresql._PGJSONB -sqlalchemy.dialects.postgresql.pygresql._PGNumeric -sqlalchemy.dialects.postgresql.pygresql._PGUUID -sqlalchemy.dialects.postgresql.pypostgresql.PGNumeric -sqlalchemy.dialects.postgresql.ranges.DATERANGE -sqlalchemy.dialects.postgresql.ranges.INT4RANGE -sqlalchemy.dialects.postgresql.ranges.INT8RANGE -sqlalchemy.dialects.postgresql.ranges.NUMRANGE -sqlalchemy.dialects.postgresql.ranges.TSRANGE -sqlalchemy.dialects.postgresql.ranges.TSTZRANGE -sqlalchemy.dialects.sqlite.BLOB -sqlalchemy.dialects.sqlite.BOOLEAN -sqlalchemy.dialects.sqlite.CHAR -sqlalchemy.dialects.sqlite.DATE -sqlalchemy.dialects.sqlite.DATETIME -sqlalchemy.dialects.sqlite.DECIMAL -sqlalchemy.dialects.sqlite.FLOAT -sqlalchemy.dialects.sqlite.INTEGER -sqlalchemy.dialects.sqlite.Insert -sqlalchemy.dialects.sqlite.JSON -sqlalchemy.dialects.sqlite.NUMERIC -sqlalchemy.dialects.sqlite.REAL -sqlalchemy.dialects.sqlite.SMALLINT -sqlalchemy.dialects.sqlite.TEXT -sqlalchemy.dialects.sqlite.TIME -sqlalchemy.dialects.sqlite.TIMESTAMP -sqlalchemy.dialects.sqlite.VARCHAR -sqlalchemy.dialects.sqlite.base.BLOB -sqlalchemy.dialects.sqlite.base.BOOLEAN -sqlalchemy.dialects.sqlite.base.CHAR -sqlalchemy.dialects.sqlite.base.DATE -sqlalchemy.dialects.sqlite.base.DATETIME -sqlalchemy.dialects.sqlite.base.DECIMAL -sqlalchemy.dialects.sqlite.base.FLOAT -sqlalchemy.dialects.sqlite.base.INTEGER -sqlalchemy.dialects.sqlite.base.JSON -sqlalchemy.dialects.sqlite.base.NUMERIC -sqlalchemy.dialects.sqlite.base.REAL -sqlalchemy.dialects.sqlite.base.SMALLINT -sqlalchemy.dialects.sqlite.base.SQLiteTypeCompiler -sqlalchemy.dialects.sqlite.base.TEXT -sqlalchemy.dialects.sqlite.base.TIME -sqlalchemy.dialects.sqlite.base.TIMESTAMP -sqlalchemy.dialects.sqlite.base.VARCHAR -sqlalchemy.dialects.sqlite.base._SQliteJson -sqlalchemy.dialects.sqlite.dml.Insert -sqlalchemy.dialects.sqlite.dml.OnConflictClause -sqlalchemy.dialects.sqlite.dml.OnConflictDoNothing -sqlalchemy.dialects.sqlite.dml.OnConflictDoUpdate -sqlalchemy.dialects.sqlite.json.JSON -sqlalchemy.dialects.sqlite.json.JSONIndexType -sqlalchemy.dialects.sqlite.json.JSONPathType -sqlalchemy.dialects.sqlite.pysqlite._SQLite_pysqliteDate -sqlalchemy.dialects.sqlite.pysqlite._SQLite_pysqliteTimeStamp -sqlalchemy.dialects.sybase.BIGINT -sqlalchemy.dialects.sybase.BINARY -sqlalchemy.dialects.sybase.BIT -sqlalchemy.dialects.sybase.CHAR -sqlalchemy.dialects.sybase.DATE -sqlalchemy.dialects.sybase.DATETIME -sqlalchemy.dialects.sybase.FLOAT -sqlalchemy.dialects.sybase.IMAGE -sqlalchemy.dialects.sybase.INTEGER -sqlalchemy.dialects.sybase.MONEY -sqlalchemy.dialects.sybase.NCHAR -sqlalchemy.dialects.sybase.NUMERIC -sqlalchemy.dialects.sybase.NVARCHAR -sqlalchemy.dialects.sybase.SMALLINT -sqlalchemy.dialects.sybase.SMALLMONEY -sqlalchemy.dialects.sybase.TEXT -sqlalchemy.dialects.sybase.TIME -sqlalchemy.dialects.sybase.TINYINT -sqlalchemy.dialects.sybase.UNICHAR -sqlalchemy.dialects.sybase.UNITEXT -sqlalchemy.dialects.sybase.UNIVARCHAR -sqlalchemy.dialects.sybase.VARBINARY -sqlalchemy.dialects.sybase.VARCHAR -sqlalchemy.dialects.sybase.base.BIGINT -sqlalchemy.dialects.sybase.base.BINARY -sqlalchemy.dialects.sybase.base.BIT -sqlalchemy.dialects.sybase.base.CHAR -sqlalchemy.dialects.sybase.base.DATE -sqlalchemy.dialects.sybase.base.DATETIME -sqlalchemy.dialects.sybase.base.DECIMAL -sqlalchemy.dialects.sybase.base.FLOAT -sqlalchemy.dialects.sybase.base.IMAGE -sqlalchemy.dialects.sybase.base.INTEGER -sqlalchemy.dialects.sybase.base.MONEY -sqlalchemy.dialects.sybase.base.NCHAR -sqlalchemy.dialects.sybase.base.NUMERIC -sqlalchemy.dialects.sybase.base.NVARCHAR -sqlalchemy.dialects.sybase.base.REAL -sqlalchemy.dialects.sybase.base.SMALLINT -sqlalchemy.dialects.sybase.base.SMALLMONEY -sqlalchemy.dialects.sybase.base.SybaseTypeCompiler -sqlalchemy.dialects.sybase.base.TEXT -sqlalchemy.dialects.sybase.base.TIME -sqlalchemy.dialects.sybase.base.TIMESTAMP -sqlalchemy.dialects.sybase.base.TINYINT -sqlalchemy.dialects.sybase.base.UNICHAR -sqlalchemy.dialects.sybase.base.UNIQUEIDENTIFIER -sqlalchemy.dialects.sybase.base.UNITEXT -sqlalchemy.dialects.sybase.base.UNIVARCHAR -sqlalchemy.dialects.sybase.base.Unicode -sqlalchemy.dialects.sybase.base.VARBINARY -sqlalchemy.dialects.sybase.base.VARCHAR -sqlalchemy.dialects.sybase.pyodbc._SybNumeric_pyodbc -sqlalchemy.dialects.sybase.pysybase._SybNumeric -sqlalchemy.engine.TypeCompiler -sqlalchemy.engine.default._StrDate -sqlalchemy.engine.default._StrDateTime -sqlalchemy.engine.default._StrTime -sqlalchemy.engine.events.ConnectionEvents -sqlalchemy.engine.events.DialectEvents -sqlalchemy.engine.interfaces.TypeCompiler -sqlalchemy.event.Events -sqlalchemy.event.base.Events -sqlalchemy.events.ConnectionEvents -sqlalchemy.events.DDLEvents -sqlalchemy.events.DialectEvents -sqlalchemy.events.PoolEvents -sqlalchemy.ext.asyncio.AsyncConnectionEvents -sqlalchemy.ext.asyncio.AsyncSessionEvents -sqlalchemy.ext.asyncio.events.AsyncConnectionEvents -sqlalchemy.ext.asyncio.events.AsyncSessionEvents -sqlalchemy.orm.AttributeEvents -sqlalchemy.orm.FromStatement -sqlalchemy.orm.InstanceEvents -sqlalchemy.orm.InstrumentationEvents -sqlalchemy.orm.MapperEvents -sqlalchemy.orm.QueryContext.default_load_options -sqlalchemy.orm.QueryEvents -sqlalchemy.orm.SessionEvents -sqlalchemy.orm.context.ORMCompileState.default_compile_options -sqlalchemy.orm.context.QueryContext.default_load_options -sqlalchemy.orm.events.AttributeEvents -sqlalchemy.orm.events.InstanceEvents -sqlalchemy.orm.events.InstrumentationEvents -sqlalchemy.orm.events.MapperEvents -sqlalchemy.orm.events.QueryEvents -sqlalchemy.orm.events.SessionEvents -sqlalchemy.orm.events._InstanceEventsHold.HoldInstanceEvents -sqlalchemy.orm.events._MapperEventsHold.HoldMapperEvents -sqlalchemy.orm.persistence.BulkUDCompileState.default_update_options -sqlalchemy.orm.query.FromStatement -sqlalchemy.orm.query.QueryContext.default_load_options -sqlalchemy.orm.util._ORMJoin -sqlalchemy.pool.events.PoolEvents -sqlalchemy.schema.AddConstraint -sqlalchemy.schema.CheckConstraint -sqlalchemy.schema.Column -sqlalchemy.schema.ColumnCollectionConstraint -sqlalchemy.schema.ColumnDefault -sqlalchemy.schema.Computed -sqlalchemy.schema.Constraint -sqlalchemy.schema.CreateColumn -sqlalchemy.schema.CreateIndex -sqlalchemy.schema.CreateSchema -sqlalchemy.schema.CreateSequence -sqlalchemy.schema.CreateTable -sqlalchemy.schema.DDL -sqlalchemy.schema.DDLElement -sqlalchemy.schema.DefaultGenerator -sqlalchemy.schema.DropColumnComment -sqlalchemy.schema.DropConstraint -sqlalchemy.schema.DropIndex -sqlalchemy.schema.DropSchema -sqlalchemy.schema.DropSequence -sqlalchemy.schema.DropTable -sqlalchemy.schema.DropTableComment -sqlalchemy.schema.ForeignKey -sqlalchemy.schema.ForeignKeyConstraint -sqlalchemy.schema.Identity -sqlalchemy.schema.Index -sqlalchemy.schema.MetaData -sqlalchemy.schema.PrimaryKeyConstraint -sqlalchemy.schema.SchemaItem -sqlalchemy.schema.Sequence -sqlalchemy.schema.SetColumnComment -sqlalchemy.schema.SetTableComment -sqlalchemy.schema.Table -sqlalchemy.schema.ThreadLocalMetaData -sqlalchemy.schema.UniqueConstraint -sqlalchemy.schema._CreateDropBase -sqlalchemy.schema._DDLCompiles -sqlalchemy.schema._DropView -sqlalchemy.sql.Alias -sqlalchemy.sql.ClauseElement -sqlalchemy.sql.ColumnElement -sqlalchemy.sql.CompoundSelect -sqlalchemy.sql.Delete -sqlalchemy.sql.False_ -sqlalchemy.sql.FromClause -sqlalchemy.sql.Insert -sqlalchemy.sql.Join -sqlalchemy.sql.LambdaElement -sqlalchemy.sql.Select -sqlalchemy.sql.Selectable -sqlalchemy.sql.StatementLambdaElement -sqlalchemy.sql.Subquery -sqlalchemy.sql.TableClause -sqlalchemy.sql.TableSample -sqlalchemy.sql.True_ -sqlalchemy.sql.Update -sqlalchemy.sql.Values -sqlalchemy.sql.base.CacheableOptions -sqlalchemy.sql.base.Options -sqlalchemy.sql.compiler.GenericTypeCompiler -sqlalchemy.sql.compiler.StrSQLTypeCompiler -sqlalchemy.sql.compiler.TypeCompiler -sqlalchemy.sql.compiler._CompileLabel -sqlalchemy.sql.crud._multiparam_column -sqlalchemy.sql.ddl.AddConstraint -sqlalchemy.sql.ddl.CreateColumn -sqlalchemy.sql.ddl.CreateIndex -sqlalchemy.sql.ddl.CreateSchema -sqlalchemy.sql.ddl.CreateSequence -sqlalchemy.sql.ddl.CreateTable -sqlalchemy.sql.ddl.DDL -sqlalchemy.sql.ddl.DDLElement -sqlalchemy.sql.ddl.DropColumnComment -sqlalchemy.sql.ddl.DropConstraint -sqlalchemy.sql.ddl.DropIndex -sqlalchemy.sql.ddl.DropSchema -sqlalchemy.sql.ddl.DropSequence -sqlalchemy.sql.ddl.DropTable -sqlalchemy.sql.ddl.DropTableComment -sqlalchemy.sql.ddl.SetColumnComment -sqlalchemy.sql.ddl.SetTableComment -sqlalchemy.sql.ddl._CreateDropBase -sqlalchemy.sql.ddl._DDLCompiles -sqlalchemy.sql.ddl._DropView -sqlalchemy.sql.dml.Delete -sqlalchemy.sql.dml.Insert -sqlalchemy.sql.dml.Update -sqlalchemy.sql.dml.UpdateBase -sqlalchemy.sql.dml.ValuesBase -sqlalchemy.sql.elements.AsBoolean -sqlalchemy.sql.elements.BinaryExpression -sqlalchemy.sql.elements.BindParameter -sqlalchemy.sql.elements.BooleanClauseList -sqlalchemy.sql.elements.Case -sqlalchemy.sql.elements.Cast -sqlalchemy.sql.elements.ClauseElement -sqlalchemy.sql.elements.ClauseList -sqlalchemy.sql.elements.CollationClause -sqlalchemy.sql.elements.CollectionAggregate -sqlalchemy.sql.elements.ColumnClause -sqlalchemy.sql.elements.ColumnElement -sqlalchemy.sql.elements.Extract -sqlalchemy.sql.elements.False_ -sqlalchemy.sql.elements.FunctionFilter -sqlalchemy.sql.elements.GroupedElement -sqlalchemy.sql.elements.Grouping -sqlalchemy.sql.elements.IndexExpression -sqlalchemy.sql.elements.Label -sqlalchemy.sql.elements.NamedColumn -sqlalchemy.sql.elements.Null -sqlalchemy.sql.elements.Over -sqlalchemy.sql.elements.ReleaseSavepointClause -sqlalchemy.sql.elements.RollbackToSavepointClause -sqlalchemy.sql.elements.SavepointClause -sqlalchemy.sql.elements.Slice -sqlalchemy.sql.elements.TableValuedColumn -sqlalchemy.sql.elements.TextClause -sqlalchemy.sql.elements.True_ -sqlalchemy.sql.elements.Tuple -sqlalchemy.sql.elements.TypeClause -sqlalchemy.sql.elements.TypeCoerce -sqlalchemy.sql.elements.UnaryExpression -sqlalchemy.sql.elements.WithinGroup -sqlalchemy.sql.elements._IdentifiedClause -sqlalchemy.sql.elements._label_reference -sqlalchemy.sql.elements._textual_label_reference -sqlalchemy.sql.events.DDLEvents -sqlalchemy.sql.expression.Alias -sqlalchemy.sql.expression.AliasedReturnsRows -sqlalchemy.sql.expression.BinaryExpression -sqlalchemy.sql.expression.BindParameter -sqlalchemy.sql.expression.BooleanClauseList -sqlalchemy.sql.expression.CTE -sqlalchemy.sql.expression.Case -sqlalchemy.sql.expression.Cast -sqlalchemy.sql.expression.ClauseElement -sqlalchemy.sql.expression.ClauseList -sqlalchemy.sql.expression.CollectionAggregate -sqlalchemy.sql.expression.ColumnClause -sqlalchemy.sql.expression.ColumnElement -sqlalchemy.sql.expression.CompoundSelect -sqlalchemy.sql.expression.Delete -sqlalchemy.sql.expression.Exists -sqlalchemy.sql.expression.Extract -sqlalchemy.sql.expression.False_ -sqlalchemy.sql.expression.FromClause -sqlalchemy.sql.expression.FromGrouping -sqlalchemy.sql.expression.Function -sqlalchemy.sql.expression.FunctionElement -sqlalchemy.sql.expression.FunctionFilter -sqlalchemy.sql.expression.GenerativeSelect -sqlalchemy.sql.expression.Grouping -sqlalchemy.sql.expression.Insert -sqlalchemy.sql.expression.Join -sqlalchemy.sql.expression.Label -sqlalchemy.sql.expression.LambdaElement -sqlalchemy.sql.expression.Lateral -sqlalchemy.sql.expression.Null -sqlalchemy.sql.expression.Over -sqlalchemy.sql.expression.ReleaseSavepointClause -sqlalchemy.sql.expression.ReturnsRows -sqlalchemy.sql.expression.RollbackToSavepointClause -sqlalchemy.sql.expression.SavepointClause -sqlalchemy.sql.expression.ScalarSelect -sqlalchemy.sql.expression.Select -sqlalchemy.sql.expression.SelectBase -sqlalchemy.sql.expression.Selectable -sqlalchemy.sql.expression.StatementLambdaElement -sqlalchemy.sql.expression.Subquery -sqlalchemy.sql.expression.TableClause -sqlalchemy.sql.expression.TableSample -sqlalchemy.sql.expression.TableValuedAlias -sqlalchemy.sql.expression.TextClause -sqlalchemy.sql.expression.TextualSelect -sqlalchemy.sql.expression.True_ -sqlalchemy.sql.expression.Tuple -sqlalchemy.sql.expression.TypeClause -sqlalchemy.sql.expression.TypeCoerce -sqlalchemy.sql.expression.UnaryExpression -sqlalchemy.sql.expression.Update -sqlalchemy.sql.expression.UpdateBase -sqlalchemy.sql.expression.Values -sqlalchemy.sql.expression.ValuesBase -sqlalchemy.sql.expression.WithinGroup -sqlalchemy.sql.functions.AnsiFunction -sqlalchemy.sql.functions.Function -sqlalchemy.sql.functions.FunctionAsBinary -sqlalchemy.sql.functions.FunctionElement -sqlalchemy.sql.functions.GenericFunction -sqlalchemy.sql.functions.OrderedSetAgg -sqlalchemy.sql.functions.ReturnTypeFromArgs -sqlalchemy.sql.functions.ScalarFunctionColumn -sqlalchemy.sql.functions.array_agg -sqlalchemy.sql.functions.char_length -sqlalchemy.sql.functions.coalesce -sqlalchemy.sql.functions.concat -sqlalchemy.sql.functions.count -sqlalchemy.sql.functions.cube -sqlalchemy.sql.functions.cume_dist -sqlalchemy.sql.functions.current_date -sqlalchemy.sql.functions.current_time -sqlalchemy.sql.functions.current_timestamp -sqlalchemy.sql.functions.current_user -sqlalchemy.sql.functions.dense_rank -sqlalchemy.sql.functions.grouping_sets -sqlalchemy.sql.functions.localtime -sqlalchemy.sql.functions.localtimestamp -sqlalchemy.sql.functions.max -sqlalchemy.sql.functions.min -sqlalchemy.sql.functions.mode -sqlalchemy.sql.functions.next_value -sqlalchemy.sql.functions.now -sqlalchemy.sql.functions.percent_rank -sqlalchemy.sql.functions.percentile_cont -sqlalchemy.sql.functions.percentile_disc -sqlalchemy.sql.functions.random -sqlalchemy.sql.functions.rank -sqlalchemy.sql.functions.rollup -sqlalchemy.sql.functions.session_user -sqlalchemy.sql.functions.sum -sqlalchemy.sql.functions.sysdate -sqlalchemy.sql.functions.user -sqlalchemy.sql.lambdas.DeferredLambdaElement -sqlalchemy.sql.lambdas.LambdaElement -sqlalchemy.sql.lambdas.LambdaOptions -sqlalchemy.sql.lambdas.LinkedLambdaElement -sqlalchemy.sql.lambdas.NullLambdaStatement -sqlalchemy.sql.lambdas.StatementLambdaElement -sqlalchemy.sql.schema.CheckConstraint -sqlalchemy.sql.schema.Column -sqlalchemy.sql.schema.ColumnCollectionConstraint -sqlalchemy.sql.schema.ColumnDefault -sqlalchemy.sql.schema.Computed -sqlalchemy.sql.schema.Constraint -sqlalchemy.sql.schema.DefaultGenerator -sqlalchemy.sql.schema.ForeignKey -sqlalchemy.sql.schema.ForeignKeyConstraint -sqlalchemy.sql.schema.Identity -sqlalchemy.sql.schema.Index -sqlalchemy.sql.schema.MetaData -sqlalchemy.sql.schema.PrimaryKeyConstraint -sqlalchemy.sql.schema.SchemaItem -sqlalchemy.sql.schema.Sequence -sqlalchemy.sql.schema.Table -sqlalchemy.sql.schema.ThreadLocalMetaData -sqlalchemy.sql.schema.UniqueConstraint -sqlalchemy.sql.selectable.Alias -sqlalchemy.sql.selectable.AliasedReturnsRows -sqlalchemy.sql.selectable.BindParameter -sqlalchemy.sql.selectable.BooleanClauseList -sqlalchemy.sql.selectable.CTE -sqlalchemy.sql.selectable.ClauseElement -sqlalchemy.sql.selectable.ClauseList -sqlalchemy.sql.selectable.ColumnClause -sqlalchemy.sql.selectable.CompoundSelect -sqlalchemy.sql.selectable.Exists -sqlalchemy.sql.selectable.ForUpdateArg -sqlalchemy.sql.selectable.FromClause -sqlalchemy.sql.selectable.FromGrouping -sqlalchemy.sql.selectable.GenerativeSelect -sqlalchemy.sql.selectable.GroupedElement -sqlalchemy.sql.selectable.Grouping -sqlalchemy.sql.selectable.Join -sqlalchemy.sql.selectable.Lateral -sqlalchemy.sql.selectable.ReturnsRows -sqlalchemy.sql.selectable.ScalarSelect -sqlalchemy.sql.selectable.Select -sqlalchemy.sql.selectable.SelectBase -sqlalchemy.sql.selectable.SelectState.default_select_compile_options -sqlalchemy.sql.selectable.SelectStatementGrouping -sqlalchemy.sql.selectable.Selectable -sqlalchemy.sql.selectable.Subquery -sqlalchemy.sql.selectable.TableClause -sqlalchemy.sql.selectable.TableSample -sqlalchemy.sql.selectable.TableValuedAlias -sqlalchemy.sql.selectable.TableValuedColumn -sqlalchemy.sql.selectable.TextualSelect -sqlalchemy.sql.selectable.UnaryExpression -sqlalchemy.sql.selectable.Values -sqlalchemy.sql.selectable._MemoizedSelectEntities -sqlalchemy.sql.selectable._OffsetLimitParam -sqlalchemy.sql.sqltypes.ARRAY -sqlalchemy.sql.sqltypes.BIGINT -sqlalchemy.sql.sqltypes.BINARY -sqlalchemy.sql.sqltypes.BLOB -sqlalchemy.sql.sqltypes.BOOLEAN -sqlalchemy.sql.sqltypes.BigInteger -sqlalchemy.sql.sqltypes.Boolean -sqlalchemy.sql.sqltypes.CHAR -sqlalchemy.sql.sqltypes.CLOB -sqlalchemy.sql.sqltypes.DATE -sqlalchemy.sql.sqltypes.DATETIME -sqlalchemy.sql.sqltypes.DECIMAL -sqlalchemy.sql.sqltypes.Date -sqlalchemy.sql.sqltypes.DateTime -sqlalchemy.sql.sqltypes.Enum -sqlalchemy.sql.sqltypes.FLOAT -sqlalchemy.sql.sqltypes.Float -sqlalchemy.sql.sqltypes.INTEGER -sqlalchemy.sql.sqltypes.Integer -sqlalchemy.sql.sqltypes.Interval -sqlalchemy.sql.sqltypes.JSON -sqlalchemy.sql.sqltypes.JSON.JSONElementType -sqlalchemy.sql.sqltypes.JSON.JSONIndexType -sqlalchemy.sql.sqltypes.JSON.JSONIntIndexType -sqlalchemy.sql.sqltypes.JSON.JSONPathType -sqlalchemy.sql.sqltypes.JSON.JSONStrIndexType -sqlalchemy.sql.sqltypes.LargeBinary -sqlalchemy.sql.sqltypes.MatchType -sqlalchemy.sql.sqltypes.NCHAR -sqlalchemy.sql.sqltypes.NUMERIC -sqlalchemy.sql.sqltypes.NVARCHAR -sqlalchemy.sql.sqltypes.NullType -sqlalchemy.sql.sqltypes.Numeric -sqlalchemy.sql.sqltypes.PickleType -sqlalchemy.sql.sqltypes.REAL -sqlalchemy.sql.sqltypes.SMALLINT -sqlalchemy.sql.sqltypes.SmallInteger -sqlalchemy.sql.sqltypes.String -sqlalchemy.sql.sqltypes.TEXT -sqlalchemy.sql.sqltypes.TIME -sqlalchemy.sql.sqltypes.TIMESTAMP -sqlalchemy.sql.sqltypes.TableValueType -sqlalchemy.sql.sqltypes.Text -sqlalchemy.sql.sqltypes.Time -sqlalchemy.sql.sqltypes.TupleType -sqlalchemy.sql.sqltypes.TypeDecorator -sqlalchemy.sql.sqltypes.TypeEngine -sqlalchemy.sql.sqltypes.Unicode -sqlalchemy.sql.sqltypes.UnicodeText -sqlalchemy.sql.sqltypes.VARBINARY -sqlalchemy.sql.sqltypes.VARCHAR -sqlalchemy.sql.sqltypes.Variant -sqlalchemy.sql.sqltypes._AbstractInterval -sqlalchemy.sql.sqltypes._Binary -sqlalchemy.sql.traversals.ColIdentityComparatorStrategy -sqlalchemy.sql.traversals.TraversalComparatorStrategy -sqlalchemy.sql.traversals._CacheKey -sqlalchemy.sql.traversals._CopyInternals -sqlalchemy.sql.traversals._GetChildren -sqlalchemy.sql.type_api.TypeDecorator -sqlalchemy.sql.type_api.TypeEngine -sqlalchemy.sql.type_api.UserDefinedType -sqlalchemy.sql.type_api.Variant -sqlalchemy.sql.visitors.ExtendedInternalTraversal -sqlalchemy.sql.visitors.InternalTraversal -sqlalchemy.sql.visitors.Traversible -sqlalchemy.types.ARRAY -sqlalchemy.types.BIGINT -sqlalchemy.types.BINARY -sqlalchemy.types.BLOB -sqlalchemy.types.BOOLEAN -sqlalchemy.types.BigInteger -sqlalchemy.types.Boolean -sqlalchemy.types.CHAR -sqlalchemy.types.CLOB -sqlalchemy.types.DATE -sqlalchemy.types.DATETIME -sqlalchemy.types.DECIMAL -sqlalchemy.types.Date -sqlalchemy.types.DateTime -sqlalchemy.types.Enum -sqlalchemy.types.FLOAT -sqlalchemy.types.Float -sqlalchemy.types.INTEGER -sqlalchemy.types.Integer -sqlalchemy.types.Interval -sqlalchemy.types.JSON -sqlalchemy.types.JSON.JSONElementType -sqlalchemy.types.JSON.JSONIndexType -sqlalchemy.types.JSON.JSONIntIndexType -sqlalchemy.types.JSON.JSONPathType -sqlalchemy.types.JSON.JSONStrIndexType -sqlalchemy.types.LargeBinary -sqlalchemy.types.MatchType -sqlalchemy.types.NCHAR -sqlalchemy.types.NUMERIC -sqlalchemy.types.NVARCHAR -sqlalchemy.types.NullType -sqlalchemy.types.Numeric -sqlalchemy.types.PickleType -sqlalchemy.types.REAL -sqlalchemy.types.SMALLINT -sqlalchemy.types.SmallInteger -sqlalchemy.types.String -sqlalchemy.types.TEXT -sqlalchemy.types.TIME -sqlalchemy.types.TIMESTAMP -sqlalchemy.types.Text -sqlalchemy.types.Time -sqlalchemy.types.TupleType -sqlalchemy.types.TypeDecorator -sqlalchemy.types.TypeEngine -sqlalchemy.types.Unicode -sqlalchemy.types.UnicodeText -sqlalchemy.types.UserDefinedType -sqlalchemy.types.VARBINARY -sqlalchemy.types.VARCHAR -sqlalchemy.types._Binary +# Same error as in stdlib due to it being re-erported +sqlalchemy.util.compat.StringIO.seek +sqlalchemy.util.compat.StringIO.truncate +sqlalchemy.util.StringIO.seek +sqlalchemy.util.StringIO.truncate diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py new file mode 100644 index 000000000000..1f596af83356 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/test_cases/check_loader_option.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from typing_extensions import assert_type + +from sqlalchemy.orm.strategy_options import ( + Load, + contains_eager, + defaultload, + defer, + immediateload, + joinedload, + lazyload, + load_only, + loader_option, + noload, + raiseload, + selectin_polymorphic, + selectinload, + subqueryload, + undefer, + undefer_group, + with_expression, +) + + +def fn(loadopt: Load, *args: object) -> loader_option: + return loader_option() + + +# Testing that the function and return type of function are actually all instances of "loader_option" +assert_type(contains_eager, loader_option) +assert_type(contains_eager(fn), loader_option) +assert_type(load_only, loader_option) +assert_type(load_only(fn), loader_option) +assert_type(joinedload, loader_option) +assert_type(joinedload(fn), loader_option) +assert_type(subqueryload, loader_option) +assert_type(subqueryload(fn), loader_option) +assert_type(selectinload, loader_option) +assert_type(selectinload(fn), loader_option) +assert_type(lazyload, loader_option) +assert_type(lazyload(fn), loader_option) +assert_type(immediateload, loader_option) +assert_type(immediateload(fn), loader_option) +assert_type(noload, loader_option) +assert_type(noload(fn), loader_option) +assert_type(raiseload, loader_option) +assert_type(raiseload(fn), loader_option) +assert_type(defaultload, loader_option) +assert_type(defaultload(fn), loader_option) +assert_type(defer, loader_option) +assert_type(defer(fn), loader_option) +assert_type(undefer, loader_option) +assert_type(undefer(fn), loader_option) +assert_type(undefer_group, loader_option) +assert_type(undefer_group(fn), loader_option) +assert_type(with_expression, loader_option) +assert_type(with_expression(fn), loader_option) +assert_type(selectin_polymorphic, loader_option) +assert_type(selectin_polymorphic(fn), loader_option) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py new file mode 100644 index 000000000000..41ad1f1d1ae5 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from _typeshed.dbapi import DBAPIConnection +from typing import cast + +from sqlalchemy.engine.base import Engine +from sqlalchemy.engine.default import DefaultDialect +from sqlalchemy.engine.url import URL +from sqlalchemy.pool.base import Pool +from sqlalchemy.testing.provision import ( + configure_follower, + create_db, + drop_all_schema_objects_post_tables, + drop_all_schema_objects_pre_tables, + drop_db, + follower_url_from_main, + generate_driver_url, + get_temp_table_name, + post_configure_engine, + prepare_for_drop_tables, + register, + run_reap_dbs, + set_default_schema_on_connection, + stop_test_class_outside_fixtures, + temp_table_keyword_args, + update_db_opts, +) +from sqlalchemy.util import immutabledict + +url = URL("", "", "", "", 0, "", immutabledict()) +engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") +unused = None + + +class Foo: + pass + + +# The decorator changes the first parameter to "cfg: str | URL" +@register.init +def no_args(__foo: Foo) -> None: + pass + + +no_args(cfg=url) +generate_driver_url(url, "", "") +drop_all_schema_objects_pre_tables(url, unused) +drop_all_schema_objects_post_tables(url, unused) +create_db(url, engine, unused) +drop_db(url, engine, unused) +update_db_opts(url, unused) +post_configure_engine(url, unused, unused) +follower_url_from_main(url, "") +configure_follower(url, unused) +run_reap_dbs(url, unused) +temp_table_keyword_args(url, engine) +prepare_for_drop_tables(url, unused) +stop_test_class_outside_fixtures(url, unused, type) +get_temp_table_name(url, unused, "") +set_default_schema_on_connection(url, unused, unused) diff --git a/stubs/SQLAlchemy/METADATA.toml b/stubs/SQLAlchemy/METADATA.toml index f58115dbfea3..6cabd7b32a64 100644 --- a/stubs/SQLAlchemy/METADATA.toml +++ b/stubs/SQLAlchemy/METADATA.toml @@ -3,3 +3,4 @@ extra_description = """\ The `sqlalchemy-stubs` package is an alternative to this package and also \ includes a mypy plugin for more precise types.\ """ +obsolete_since = "2.0.0" # Released on 2023-01-26 diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 47b9703ad3d3..59d9d16fbc12 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -197,7 +197,6 @@ class MSExecutionContext(default.DefaultExecutionContext): @property def rowcount(self): ... def handle_dbapi_exception(self, e) -> None: ... - def get_result_cursor_strategy(self, result): ... def fire_sequence(self, seq, type_): ... def get_insert_default(self, column): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index d72b1ed8d387..683ada3fc5fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -163,6 +163,7 @@ class PGCompiler(compiler.SQLCompiler): class PGDDLCompiler(compiler.DDLCompiler): def get_column_specification(self, column, **kwargs): ... def visit_check_constraint(self, constraint): ... + def visit_foreign_key_constraint(self, constraint) -> str: ... # type: ignore[override] # Different params def visit_drop_table_comment(self, drop): ... def visit_create_enum_type(self, create): ... def visit_drop_enum_type(self, drop): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index 7b6eac7d8ff0..afe46eb46e85 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -116,7 +116,6 @@ class ExecutionContext: def pre_exec(self) -> None: ... def get_out_parameter_values(self, out_param_names) -> None: ... def post_exec(self) -> None: ... - def get_result_cursor_strategy(self, result) -> None: ... def handle_dbapi_exception(self, e) -> None: ... def should_autocommit_text(self, statement) -> None: ... def lastrow_has_defaults(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 30625dfcec8a..04a8ab923ae8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -19,6 +19,7 @@ class _URLTuple(NamedTuple): _Query: TypeAlias = Mapping[str, str | Sequence[str]] | Sequence[tuple[str, str | Sequence[str]]] class URL(_URLTuple): + def __new__(self: type[Self], *arg, **kw) -> Self | URL: ... @classmethod def create( cls, diff --git a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index 9b1341c166e8..d968c86e5ddd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -12,7 +12,7 @@ class _Dispatch: class _EventMeta(type): def __init__(cls, classname, bases, dict_) -> None: ... -class Events: +class Events(metaclass=_EventMeta): dispatch: Any class _JoinedDispatcher: diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 0160b4919214..8efe02c952a0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -1,5 +1,14 @@ -from _typeshed import Incomplete -from typing import Any +from _typeshed import Incomplete, SupportsKeysAndGetItem +from collections.abc import Iterable +from typing import Any, TypeVar, overload +from typing_extensions import Literal, SupportsIndex + +from ..orm.attributes import Event +from ..util.langhelpers import _symbol, symbol + +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") class _PlainColumnGetter: cols: Any @@ -81,12 +90,41 @@ class CollectionAdapter: def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... -class InstrumentedList(list[Any]): ... -class InstrumentedSet(set[Any]): ... -class InstrumentedDict(dict[Any, Any]): ... +class InstrumentedList(list[_T]): + def append(self, item, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def clear(self, index: SupportsIndex = -1) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def insert(self, index: SupportsIndex, value: _T) -> None: ... + def pop(self, index: SupportsIndex = -1) -> _T: ... + def remove(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + +class InstrumentedSet(set[_T]): + def add(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def difference_update(self, value: Iterable[_T]) -> None: ... # type: ignore[override] + def discard(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def intersection_update(self, other: Iterable[_T]) -> None: ... # type: ignore[override] + def remove(self, value: _T, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def symmetric_difference_update(self, other: Iterable[_T]) -> None: ... + def update(self, value: Iterable[_T]) -> None: ... # type: ignore[override] + +class InstrumentedDict(dict[_KT, _VT]): ... -class MappedCollection(dict[Any, Any]): +class MappedCollection(dict[_KT, _VT]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... - def remove(self, value, _sa_initiator: Incomplete | None = ...) -> None: ... + def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def __delitem__(self, key: _KT, _sa_initiatorEvent: Event | Literal[False] | None = None) -> None: ... + def __setitem__(self, key: _KT, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + @overload + def pop(self, key: _KT) -> _VT: ... + @overload + def pop(self, key: _KT, default: _VT | _T | _symbol | symbol = ...) -> _VT | _T: ... + @overload # type: ignore[override] + def setdefault(self, key: _KT, default: _T) -> _VT | _T: ... + @overload + def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... + @overload + def update(self, __other: SupportsKeysAndGetItem[_KT, _VT] = ..., **kwargs: _VT) -> None: ... + @overload + def update(self, __other: Iterable[tuple[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 8938a45ad691..c54ea44d0485 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -13,7 +13,7 @@ _DeclT = TypeVar("_DeclT", bound=type[_DeclarativeBase]) # Dynamic class as created by registry.generate_base() via DeclarativeMeta # or another metaclass. This class does not exist at runtime. -class _DeclarativeBase(Any): # super classes are dynamic +class _DeclarativeBase(Any): # type: ignore[misc] # super classes are dynamic registry: ClassVar[registry] metadata: ClassVar[MetaData] __abstract__: ClassVar[bool] diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 5422cfffb5c5..c83a4c9dab9b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Self +from collections.abc import Callable from typing import Any from ..sql.base import Generative @@ -17,27 +18,27 @@ class Load(Generative, LoaderOption): propagate_to_loaders: bool def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... - def options(self, *opts) -> None: ... - def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> None: ... - def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> None: ... - def set_generic_strategy(self, attrs, strategy) -> None: ... - def set_class_strategy(self, strategy, opts) -> None: ... - # added dynamically at runtime - def contains_eager(self, attr, alias: Incomplete | None = ...): ... - def load_only(self, *attrs): ... - def joinedload(self, attr, innerjoin: Incomplete | None = ...): ... - def subqueryload(self, attr): ... - def selectinload(self, attr): ... - def lazyload(self, attr): ... - def immediateload(self, attr): ... - def noload(self, attr): ... - def raiseload(self, attr, sql_only: bool = ...): ... - def defaultload(self, attr): ... - def defer(self, key, raiseload: bool = ...): ... - def undefer(self, key): ... - def undefer_group(self, name): ... - def with_expression(self, key, expression): ... - def selectin_polymorphic(self, classes): ... + def options(self: Self, *opts) -> Self: ... + def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... + def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... + def set_class_strategy(self: Self, strategy, opts) -> Self: ... + # Added dynamically at runtime + def contains_eager(loadopt: Self, attr, alias: Incomplete | None = ...) -> Self: ... + def load_only(loadopt: Self, *attrs) -> Self: ... + def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def subqueryload(loadopt: Self, attr) -> Self: ... + def selectinload(loadopt: Self, attr) -> Self: ... + def lazyload(loadopt: Self, attr) -> Self: ... + def immediateload(loadopt: Self, attr) -> Self: ... + def noload(loadopt: Self, attr) -> Self: ... + def raiseload(loadopt: Self, attr, sql_only: bool = ...) -> Self: ... + def defaultload(loadopt: Self, attr) -> Self: ... + def defer(loadopt: Self, key, raiseload: bool = ...) -> Self: ... + def undefer(loadopt: Self, key) -> Self: ... + def undefer_group(loadopt: Self, name) -> Self: ... + def with_expression(loadopt: Self, key, expression) -> Self: ... + def selectin_polymorphic(loadopt: Self, classes) -> Self: ... class _UnboundLoad(Load): path: Any @@ -45,22 +46,39 @@ class _UnboundLoad(Load): def __init__(self) -> None: ... class loader_option: - name: Any - fn: Any - def __call__(self, fn): ... + name: str + # The first parameter of this Callable should always be `loadopt: Load` + fn: Callable[..., loader_option] + def __call__(self: Self, fn: Callable[..., loader_option]) -> Self: ... -def contains_eager(loadopt, attr, alias: Incomplete | None = ...): ... -def load_only(loadopt, *attrs): ... -def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...): ... -def subqueryload(loadopt, attr): ... -def selectinload(loadopt, attr): ... -def lazyload(loadopt, attr): ... -def immediateload(loadopt, attr): ... -def noload(loadopt, attr): ... -def raiseload(loadopt, attr, sql_only: bool = ...): ... -def defaultload(loadopt, attr): ... -def defer(loadopt, key, raiseload: bool = ...): ... -def undefer(loadopt, key): ... -def undefer_group(loadopt, name): ... -def with_expression(loadopt, key, expression): ... -def selectin_polymorphic(loadopt, classes): ... +# loader_option instances that can be used to dynamically add methods to Load at runtime +@loader_option() +def contains_eager(loadopt: Load, attr, alias: Incomplete | None = ...) -> loader_option: ... +@loader_option() +def load_only(loadopt: Load, *attrs) -> loader_option: ... +@loader_option() +def joinedload(loadopt, attr, innerjoin=None): ... +@loader_option() +def subqueryload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def selectinload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def lazyload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def immediateload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def noload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def raiseload(loadopt: Load, attr, sql_only: bool = ...) -> loader_option: ... +@loader_option() +def defaultload(loadopt: Load, attr) -> loader_option: ... +@loader_option() +def defer(loadopt: Load, key, raiseload: bool = ...) -> loader_option: ... +@loader_option() +def undefer(loadopt: Load, key) -> loader_option: ... +@loader_option() +def undefer_group(loadopt: Load, name) -> loader_option: ... +@loader_option() +def with_expression(loadopt: Load, key) -> loader_option: ... +@loader_option() +def selectin_polymorphic(loadopt: Load, classes) -> loader_option: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index b169e6d8e166..14e6e99b8afc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -1,4 +1,6 @@ from _typeshed import Incomplete +from _typeshed.dbapi import DBAPIConnection +from collections.abc import Callable from typing import Any from .. import log @@ -24,7 +26,7 @@ class Pool(log.Identified): echo: Any def __init__( self, - creator, + creator: Callable[[], DBAPIConnection], recycle: int = ..., echo: Incomplete | None = ..., logging_name: Incomplete | None = ..., diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 54b1d90ee954..2f7be1fbf26f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -72,7 +72,7 @@ class _MetaOptions(type): def __init__(cls, classname, bases, dict_) -> None: ... def __add__(self, other): ... -class Options: +class Options(metaclass=_MetaOptions): def __init__(self, **kw) -> None: ... def __add__(self, other): ... def __eq__(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index 44178d7f6de8..bd521727bdfa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete from typing import NamedTuple +from sqlalchemy.util.langhelpers import EnsureKWArgType + from ..util import memoized_property from . import elements @@ -67,7 +69,7 @@ class Compiled: @property def params(self): ... -class TypeCompiler: +class TypeCompiler(metaclass=EnsureKWArgType): ensure_kwarg: str dialect: Incomplete def __init__(self, dialect) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index c1a0d1ec43ae..d5180c37d9bf 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -87,7 +87,7 @@ class Function(FunctionElement): class _GenericMeta(TraversibleType): def __init__(cls, clsname, bases, clsdict) -> None: ... -class GenericFunction: +class GenericFunction(Function, metaclass=_GenericMeta): name: Incomplete identifier: Incomplete coerce_arguments: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index dd3f84929967..af91551597c6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -55,7 +55,7 @@ class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... class ExternalType: cache_ok: Any -class UserDefinedType: +class UserDefinedType(ExternalType, TypeEngine, metaclass=VisitableCheckKWArg): __visit_name__: str ensure_kwarg: str def coerce_compared_value(self, op, value): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi index c3dd44793e24..398dee26ef9a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -3,14 +3,14 @@ from typing import Any class TraversibleType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... -class Traversible: +class Traversible(metaclass=TraversibleType): def __class_getitem__(cls, key): ... def get_children(self, omit_attrs=..., **kw): ... class _InternalTraversalType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... -class InternalTraversal: +class InternalTraversal(metaclass=_InternalTraversalType): def dispatch(self, visit_symbol): ... def run_generated_dispatch(self, target, internal_dispatch, generate_dispatcher_name): ... def generate_dispatch(self, target_cls, internal_dispatch, generate_dispatcher_name): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index db67aa9cbe9d..dca81e31185f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -26,7 +26,7 @@ class Config: is_async: Any def __init__(self, db, db_opts, options, file_config) -> None: ... @classmethod - def register(cls, db, db_opts, options, file_config): ... + def register(cls, db, db_opts, options, file_config) -> Config: ... @classmethod def set_as_current(cls, config, namespace) -> None: ... @classmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index a6c48328be1f..e32fec0eaee4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,33 +1,63 @@ -from typing import Any +from _typeshed import Incomplete, Self +from collections.abc import Callable +from logging import Logger +from typing import Any, Generic, NoReturn, TypeVar +from typing_extensions import TypeAlias -log: Any -FOLLOWER_IDENT: Any +from ..engine.interfaces import Connectable +from ..engine.url import URL +from ..testing.config import Config -class register: - fns: Any - @classmethod - def init(cls, fn): ... - def for_db(self, *dbnames): ... - def __call__(self, cfg, *arg): ... +_Unused: TypeAlias = object +_S = TypeVar("_S", bound=str) +_U = TypeVar("_U", bound=URL) +_F = TypeVar("_F", bound=Callable[..., str | URL | None]) + +log: Logger +FOLLOWER_IDENT: Incomplete | None def create_follower_db(follower_ident) -> None: ... -def setup_config(db_url, options, file_config, follower_ident): ... +def setup_config(db_url, options, file_config, follower_ident) -> Config: ... def drop_follower_db(follower_ident) -> None: ... def generate_db_urls(db_urls, extra_drivers) -> None: ... -def generate_driver_url(url, driver, query_str): ... -def drop_all_schema_objects_pre_tables(cfg, eng) -> None: ... -def drop_all_schema_objects_post_tables(cfg, eng) -> None: ... def drop_all_schema_objects(cfg, eng) -> None: ... -def create_db(cfg, eng, ident) -> None: ... -def drop_db(cfg, eng, ident) -> None: ... -def update_db_opts(cfg, db_opts) -> None: ... -def post_configure_engine(url, engine, follower_ident) -> None: ... -def follower_url_from_main(url, ident): ... -def configure_follower(cfg, ident) -> None: ... -def run_reap_dbs(url, ident) -> None: ... def reap_dbs(idents_file) -> None: ... -def temp_table_keyword_args(cfg, eng) -> None: ... -def prepare_for_drop_tables(config, connection) -> None: ... -def stop_test_class_outside_fixtures(config, db, testcls) -> None: ... -def get_temp_table_name(cfg, eng, base_name): ... -def set_default_schema_on_connection(cfg, dbapi_connection, schema_name) -> None: ... + +class register(Generic[_F]): + fns: dict[str, _F] + @classmethod + def init(cls: type[Self], fn: _F) -> Self: ... + def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... + # Impossible to specify the args from the generic Callable in the current type system + def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] + +@register.init +def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... +@register.init +def drop_all_schema_objects_pre_tables(cfg: _Unused, eng: _Unused) -> None: ... +@register.init +def drop_all_schema_objects_post_tables(cfg: _Unused, eng: _Unused) -> None: ... +@register.init +def create_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +@register.init +def drop_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +@register.init +def update_db_opts(db_url: _Unused, db_opts: _Unused) -> None: ... +@register.init +def post_configure_engine(url: _Unused, engine: _Unused, follower_ident: _Unused) -> None: ... +@register.init +def follower_url_from_main(url: _U, ident: str) -> _U: ... +@register.init +def configure_follower(cfg: _Unused, ident: _Unused) -> None: ... +@register.init +def run_reap_dbs(url: _Unused, ident: _Unused) -> None: ... +@register.init +def temp_table_keyword_args(cfg: _Unused, eng: Connectable) -> NoReturn: ... +@register.init +def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... +@register.init +def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... +@register.init # type: ignore[type-var] # False-positive, _S is bound to str +def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... +@register.init +def set_default_schema_on_connection(cfg, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi index d569a665dcd9..ae064446a2b3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi @@ -59,6 +59,7 @@ from .compat import ( has_refcount_gc as has_refcount_gc, inspect_getfullargspec as inspect_getfullargspec, int_types as int_types, + is64bit as is64bit, iterbytes as iterbytes, itertools_filter as itertools_filter, itertools_filterfalse as itertools_filterfalse, @@ -76,6 +77,9 @@ from .compat import ( py37 as py37, py38 as py38, py39 as py39, + py310 as py310, + py311 as py311, + py312 as py312, pypy as pypy, quote_plus as quote_plus, raise_ as raise_, diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index c345cfd901fb..631fcce3bda3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -139,7 +139,7 @@ class IdentitySet: def __hash__(self) -> int: ... class WeakSequence: - def __init__(self, __elements=...) -> None: ... + def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ...) -> None: ... def append(self, item) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index b329ffe40c6e..eae66bce00e1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -1,19 +1,20 @@ -import builtins -import collections -import contextlib import itertools import operator import pickle as pickle +import sys import threading as threading from _typeshed import Incomplete from abc import ABC as ABC +from builtins import callable as callable, next as next +from collections import namedtuple as namedtuple # noqa: Y024 # Actual import +from contextlib import contextmanager as contextmanager from datetime import timezone as timezone from functools import reduce as reduce -from io import BytesIO as BytesIO, StringIO as StringIO +from io import BytesIO, StringIO as StringIO from itertools import zip_longest as zip_longest from time import perf_counter as perf_counter from typing import TYPE_CHECKING as TYPE_CHECKING, Any, NamedTuple -from typing_extensions import Literal +from typing_extensions import Final from urllib.parse import ( parse_qsl as parse_qsl, quote as quote, @@ -24,21 +25,28 @@ from urllib.parse import ( byte_buffer = BytesIO +py312: bool +py311: bool +py310: bool py39: bool py38: bool py37: bool -py3k: Literal[True] -py2k: Literal[False] +py3k: Final = True +py2k: Final = False pypy: bool cpython: bool -win32: bool -osx: bool +if sys.platform == "win32": + win32: Final = True +else: + win32: Final = False +if sys.platform == "darwin": + osx: Final = True +else: + osx: Final = False arm: bool +is64bit: bool has_refcount_gc: bool -contextmanager = contextlib.contextmanager dottedgetter = operator.attrgetter -namedtuple = collections.namedtuple # noqa: Y024 -next = builtins.next class FullArgSpec(NamedTuple): args: Any @@ -82,10 +90,6 @@ def raise_( ) -> None: ... def u(s): ... def ue(s): ... - -callable = builtins.callable - -def safe_bytestring(text): ... def inspect_formatargspec( args, varargs: Incomplete | None = ..., diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 4c3949000381..3f0e7c564753 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -30,7 +30,7 @@ class PluginLoader: def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... def clear(self) -> None: ... def load(self, name): ... - def register(self, name, modulepath, objname): ... + def register(self, name, modulepath, objname) -> None: ... def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... def get_func_kwargs(func): ... @@ -129,12 +129,16 @@ class hybridmethod: def classlevel(self, func): ... class _symbol(int): - def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... + def __new__( # noqa: Y034 # Excplicitely instanciates _symbol + self, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any - def __new__(cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ...): ... + def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol + cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + ) -> _symbol: ... @classmethod def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... diff --git a/stubs/croniter/@tests/stubtest_allowlist.txt b/stubs/croniter/@tests/stubtest_allowlist.txt deleted file mode 100644 index 34d9807ed05b..000000000000 --- a/stubs/croniter/@tests/stubtest_allowlist.txt +++ /dev/null @@ -1,5 +0,0 @@ -# missing from stub -croniter.croniter.EXPANDERS -croniter.croniter.HashExpander -croniter.croniter.VALID_LEN_EXPRESSION -croniter.croniter.timedelta_to_seconds diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index 69c22e9694f8..45b8d5c32869 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -1,11 +1,22 @@ import datetime -from _typeshed import Self +from _typeshed import ReadableBuffer, Self +from collections import OrderedDict from collections.abc import Iterator -from typing import Any +from re import Match, Pattern +from typing import Any, overload from typing_extensions import Literal, TypeAlias _RetType: TypeAlias = type[float | datetime.datetime] +step_search_re: Pattern[str] +only_int_re: Pattern[str] +star_or_int_re: Pattern[str] +special_weekday_re: Pattern[str] +hash_expression_re: Pattern[str] +VALID_LEN_EXPRESSION: list[int] + +def timedelta_to_seconds(td: datetime.timedelta) -> float: ... + class CroniterError(ValueError): ... class CroniterBadTypeRangeError(TypeError): ... class CroniterBadCronError(CroniterError): ... @@ -83,3 +94,42 @@ def croniter_range( exclude_ends: bool = ..., _croniter: type[croniter] | None = ..., ) -> Iterator[Any]: ... + +class HashExpander: + cron: croniter + def __init__(self, cronit: croniter) -> None: ... + @overload + def do( + self, + idx: int, + hash_type: Literal["r"], + hash_id: None = None, + range_end: int | None = None, + range_begin: int | None = None, + ) -> int: ... + @overload + def do( + self, idx: int, hash_type: str, hash_id: ReadableBuffer, range_end: int | None = None, range_begin: int | None = None + ) -> int: ... + @overload + def do( + self, + idx: int, + hash_type: str = "h", + *, + hash_id: ReadableBuffer, + range_end: int | None = None, + range_begin: int | None = None, + ) -> int: ... + def match(self, efl: object, idx: object, expr: str, hash_id: object = None, **kw: object) -> Match[str] | None: ... + def expand( + self, + efl: object, + idx: int, + expr: str, + hash_id: ReadableBuffer | None = None, + match: Match[str] | None | Literal[""] = "", + **kw: object, + ) -> str: ... + +EXPANDERS: OrderedDict[str, HashExpander] diff --git a/stubs/influxdb-client/METADATA.toml b/stubs/influxdb-client/METADATA.toml index 5da50c32624a..44ccc6d44071 100644 --- a/stubs/influxdb-client/METADATA.toml +++ b/stubs/influxdb-client/METADATA.toml @@ -1,4 +1,4 @@ -version = "1.35.*" +version = "1.36.*" requires = ["types-urllib3"] [tool.stubtest] diff --git a/stubs/ldap3/ldap3/protocol/rfc4511.pyi b/stubs/ldap3/ldap3/protocol/rfc4511.pyi index b673e67433b9..7dcd3f58f8e9 100644 --- a/stubs/ldap3/ldap3/protocol/rfc4511.pyi +++ b/stubs/ldap3/ldap3/protocol/rfc4511.pyi @@ -7,7 +7,7 @@ from pyasn1.type.namedval import NamedValues from pyasn1.type.tag import TagSet from pyasn1.type.univ import Boolean, Choice, Enumerated, Integer, Null, OctetString, Sequence, SequenceOf, SetOf -LDAP_MAX_INT: _Final = 2147483647 +LDAP_MAX_INT: _Final[int] MAXINT: _Final[Integer] rangeInt0ToMaxConstraint: ValueRangeConstraint rangeInt1To127Constraint: ValueRangeConstraint diff --git a/stubs/python-slugify/METADATA.toml b/stubs/python-slugify/METADATA.toml index 6fe7d4c5a6ee..a3be5e7587eb 100644 --- a/stubs/python-slugify/METADATA.toml +++ b/stubs/python-slugify/METADATA.toml @@ -1,4 +1,4 @@ -version = "7.0.*" +version = "8.0.*" [tool.stubtest] ignore_missing_stub = false diff --git a/stubs/redis/redis/asyncio/client.pyi b/stubs/redis/redis/asyncio/client.pyi index 68cc3bb2b3f0..6154780c3816 100644 --- a/stubs/redis/redis/asyncio/client.pyi +++ b/stubs/redis/redis/asyncio/client.pyi @@ -116,7 +116,7 @@ class Monitor: connection: Any def __init__(self, connection_pool: ConnectionPool) -> None: ... async def connect(self) -> None: ... - async def __aenter__(self): ... + async def __aenter__(self: Self) -> Self: ... async def __aexit__(self, *args) -> None: ... async def next_command(self) -> MonitorCommandInfo: ... def listen(self) -> AsyncIterator[MonitorCommandInfo]: ... @@ -142,7 +142,7 @@ class PubSub: ignore_subscribe_messages: bool = ..., encoder: Incomplete | None = ..., ) -> None: ... - async def __aenter__(self): ... + async def __aenter__(self: Self) -> Self: ... async def __aexit__(self, exc_type, exc_value, traceback) -> None: ... def __del__(self) -> None: ... async def reset(self) -> None: ... diff --git a/stubs/whatthepatch/whatthepatch/patch.pyi b/stubs/whatthepatch/whatthepatch/patch.pyi index 9e03e3d91669..669e187a447c 100644 --- a/stubs/whatthepatch/whatthepatch/patch.pyi +++ b/stubs/whatthepatch/whatthepatch/patch.pyi @@ -76,3 +76,4 @@ def parse_unified_diff(text: str | Iterable[str]) -> list[Change] | None: ... def parse_context_diff(text: str | Iterable[str]) -> list[Change] | None: ... def parse_ed_diff(text: str | Iterable[str]) -> list[Change] | None: ... def parse_rcs_ed_diff(text: str | Iterable[str]) -> list[Change] | None: ... +def parse_git_binary_diff(text: str | Iterable[str]) -> list[Change]: ... diff --git a/test_cases/stdlib/check_dataclasses.py b/test_cases/stdlib/check_dataclasses.py new file mode 100644 index 000000000000..211d63d65422 --- /dev/null +++ b/test_cases/stdlib/check_dataclasses.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +import dataclasses as dc +from typing import Any, Dict, Tuple, Type +from typing_extensions import assert_type + + +@dc.dataclass +class Foo: + attr: str + + +assert_type(dc.fields(Foo), Tuple[dc.Field[Any], ...]) + +# Mypy correctly emits errors on these +# due to the fact it's a dataclass class, not an instance. +# Pyright, however, handles ClassVar members in protocols differently. +# See https://github.com/microsoft/pyright/issues/4339 +# +# dc.asdict(Foo) +# dc.astuple(Foo) +# dc.replace(Foo) + +if dc.is_dataclass(Foo): + # The inferred type doesn't change + # if it's already known to be a subtype of type[_DataclassInstance] + assert_type(Foo, Type[Foo]) + +f = Foo(attr="attr") + +assert_type(dc.fields(f), Tuple[dc.Field[Any], ...]) +assert_type(dc.asdict(f), Dict[str, Any]) +assert_type(dc.astuple(f), Tuple[Any, ...]) +assert_type(dc.replace(f, attr="new"), Foo) + +if dc.is_dataclass(f): + # The inferred type doesn't change + # if it's already known to be a subtype of _DataclassInstance + assert_type(f, Foo) + + +def test_other_isdataclass_overloads(x: type, y: object) -> None: + # TODO: pyright correctly emits an error on this, but mypy does not -- why? + # dc.fields(x) + + dc.fields(y) # type: ignore + + dc.asdict(x) # type: ignore + dc.asdict(y) # type: ignore + + dc.astuple(x) # type: ignore + dc.astuple(y) # type: ignore + + dc.replace(x) # type: ignore + dc.replace(y) # type: ignore + + if dc.is_dataclass(x): + assert_type(dc.fields(x), Tuple[dc.Field[Any], ...]) + # These should cause type checkers to emit errors + # due to the fact it's a dataclass class, not an instance + dc.asdict(x) # type: ignore + dc.astuple(x) # type: ignore + dc.replace(x) # type: ignore + + if dc.is_dataclass(y): + assert_type(dc.fields(y), Tuple[dc.Field[Any], ...]) + + # Mypy corrextly emits an error on these due to the fact we don't know + # whether it's a dataclass class or a dataclass instance. + # Pyright, however, handles ClassVar members in protocols differently. + # See https://github.com/microsoft/pyright/issues/4339 + # + # dc.asdict(y) + # dc.astuple(y) + # dc.replace(y) + + if dc.is_dataclass(y) and not isinstance(y, type): + assert_type(dc.fields(y), Tuple[dc.Field[Any], ...]) + assert_type(dc.asdict(y), Dict[str, Any]) + assert_type(dc.astuple(y), Tuple[Any, ...]) + dc.replace(y) diff --git a/test_cases/stdlib/check_re.py b/test_cases/stdlib/check_re.py new file mode 100644 index 000000000000..b6ab2b0d59d2 --- /dev/null +++ b/test_cases/stdlib/check_re.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +import mmap +import re +import typing as t +from typing_extensions import assert_type + + +def check_search(str_pat: re.Pattern[str], bytes_pat: re.Pattern[bytes]) -> None: + assert_type(str_pat.search("x"), t.Optional[t.Match[str]]) + assert_type(bytes_pat.search(b"x"), t.Optional[t.Match[bytes]]) + assert_type(bytes_pat.search(bytearray(b"x")), t.Optional[t.Match[bytes]]) + assert_type(bytes_pat.search(mmap.mmap(0, 10)), t.Optional[t.Match[bytes]]) + + +def check_search_with_AnyStr(pattern: re.Pattern[t.AnyStr], string: t.AnyStr) -> re.Match[t.AnyStr]: + """See issue #9591""" + match = pattern.search(string) + if match is None: + raise ValueError(f"'{string!r}' does not match {pattern!r}") + return match + + +def check_no_ReadableBuffer_false_negatives() -> None: + re.compile("foo").search(bytearray(b"foo")) # type: ignore + re.compile("foo").search(mmap.mmap(0, 10)) # type: ignore diff --git a/test_cases/stdlib/typing/check_pattern.py b/test_cases/stdlib/typing/check_pattern.py deleted file mode 100644 index ec5c1c4f6141..000000000000 --- a/test_cases/stdlib/typing/check_pattern.py +++ /dev/null @@ -1,10 +0,0 @@ -from __future__ import annotations - -from typing import Match, Optional, Pattern -from typing_extensions import assert_type - - -def test_search(str_pat: Pattern[str], bytes_pat: Pattern[bytes]) -> None: - assert_type(str_pat.search("x"), Optional[Match[str]]) - assert_type(bytes_pat.search(b"x"), Optional[Match[bytes]]) - assert_type(bytes_pat.search(bytearray(b"x")), Optional[Match[bytes]]) diff --git a/tests/check_consistent.py b/tests/check_consistent.py old mode 100755 new mode 100644 index 68654a3d0d25..73f1b8b7cf7a --- a/tests/check_consistent.py +++ b/tests/check_consistent.py @@ -11,46 +11,14 @@ import urllib.parse from pathlib import Path -import tomli import yaml from packaging.requirements import Requirement from packaging.specifiers import SpecifierSet -from packaging.version import Version - -from utils import ( - METADATA_MAPPING, - VERSIONS_RE, - get_all_testcase_directories, - get_gitignore_spec, - spec_matches_path, - strip_comments, -) - -metadata_keys = { - "version", - "requires", - "extra_description", - "stub_distribution", - "obsolete_since", - "no_longer_updated", - "upload", - "tool", -} -tool_keys = { - "stubtest": { - "skip", - "apt_dependencies", - "brew_dependencies", - "choco_dependencies", - "extras", - "ignore_missing_stub", - "platforms", - } -} -extension_descriptions = {".pyi": "stub", ".py": ".py"} -supported_stubtest_platforms = {"win32", "darwin", "linux"} -dist_name_re = re.compile(r"^[a-z0-9]([a-z0-9._-]*[a-z0-9])?$", re.IGNORECASE) +from parse_metadata import read_metadata +from utils import VERSIONS_RE, get_all_testcase_directories, get_gitignore_spec, spec_matches_path, strip_comments + +extension_descriptions = {".pyi": "stub", ".py": ".py"} def assert_consistent_filetypes( @@ -163,46 +131,8 @@ def _find_stdlib_modules() -> set[str]: def check_metadata() -> None: for distribution in os.listdir("stubs"): - with open(os.path.join("stubs", distribution, "METADATA.toml"), encoding="UTF-8") as f: - data = tomli.loads(f.read()) - assert "version" in data, f"Missing version for {distribution}" - version = data["version"] - msg = f"Unsupported version {repr(version)}" - assert isinstance(version, str), msg - # Check that the version parses - Version(version.removesuffix(".*")) - for key in data: - assert key in metadata_keys, f"Unexpected key {key} for {distribution}" - assert isinstance(data.get("requires", []), list), f"Invalid requires value for {distribution}" - for dep in data.get("requires", []): - assert isinstance(dep, str), f"Invalid requirement {repr(dep)} for {distribution}" - for space in " \t\n": - assert space not in dep, f"For consistency, requirement should not have whitespace: {dep}" - # Check that the requirement parses - Requirement(dep) - - if "stub_distribution" in data: - assert dist_name_re.fullmatch(data["stub_distribution"]), f"Invalid 'stub_distribution' value for {distribution!r}" - - assert isinstance(data.get("upload", True), bool), f"Invalid 'upload' value for {distribution!r}" - - assert set(data.get("tool", [])).issubset(tool_keys.keys()), f"Unrecognised tool for {distribution}" - for tool, tk in tool_keys.items(): - for key in data.get("tool", {}).get(tool, {}): - assert key in tk, f"Unrecognised {tool} key {key} for {distribution}" - - tool_stubtest = data.get("tool", {}).get("stubtest", {}) - specified_stubtest_platforms = set(tool_stubtest.get("platforms", ["linux"])) - assert ( - specified_stubtest_platforms <= supported_stubtest_platforms - ), f"Unrecognised platforms specified: {supported_stubtest_platforms - specified_stubtest_platforms} for {distribution}" - - # Check that only specified platforms install packages: - for supported_plat in supported_stubtest_platforms: - if supported_plat not in specified_stubtest_platforms: - assert ( - METADATA_MAPPING[supported_plat] not in tool_stubtest - ), f"Installing system deps for unspecified platform {supported_plat} for {distribution}" + # This function does various sanity checks for METADATA.toml files + read_metadata(distribution) def get_txt_requirements() -> dict[str, SpecifierSet]: diff --git a/tests/get_external_stub_requirements.py b/tests/get_external_stub_requirements.py index df86253e3f87..cea368ccea73 100644 --- a/tests/get_external_stub_requirements.py +++ b/tests/get_external_stub_requirements.py @@ -4,7 +4,7 @@ import os import sys -from utils import read_dependencies +from parse_metadata import read_dependencies distributions = sys.argv[1:] if not distributions: diff --git a/tests/get_stubtest_system_requirements.py b/tests/get_stubtest_system_requirements.py index 0be137e97f62..620399249196 100644 --- a/tests/get_stubtest_system_requirements.py +++ b/tests/get_stubtest_system_requirements.py @@ -2,17 +2,14 @@ import os import sys -import tomli - -from utils import METADATA_MAPPING +from parse_metadata import read_stubtest_settings platform = sys.platform distributions = sys.argv[1:] if not distributions: distributions = os.listdir("stubs") -if platform in METADATA_MAPPING: - for distribution in distributions: - with open(f"stubs/{distribution}/METADATA.toml", "rb") as file: - for package in tomli.load(file).get("tool", {}).get("stubtest", {}).get(METADATA_MAPPING[platform], []): - print(package) +for distribution in distributions: + stubtest_settings = read_stubtest_settings(distribution) + for package in stubtest_settings.system_requirements_for_platform(platform): + print(package) diff --git a/tests/mypy_test.py b/tests/mypy_test.py index 767d203228d2..3f81e82e5378 100644 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -26,14 +26,13 @@ import tomli +from parse_metadata import PackageDependencies, get_recursive_requirements from utils import ( VERSIONS_RE as VERSION_LINE_RE, - PackageDependencies, VenvInfo, colored, get_gitignore_spec, get_mypy_req, - get_recursive_requirements, make_venv, print_error, print_success_msg, diff --git a/tests/parse_metadata.py b/tests/parse_metadata.py new file mode 100644 index 000000000000..c8c6b515a176 --- /dev/null +++ b/tests/parse_metadata.py @@ -0,0 +1,264 @@ +"""Tools to help parse and validate information stored in METADATA.toml files.""" +from __future__ import annotations + +import os +import re +from collections.abc import Mapping +from dataclasses import dataclass +from pathlib import Path +from typing import NamedTuple +from typing_extensions import Annotated, Final, TypeGuard, final + +import tomli +from packaging.requirements import Requirement +from packaging.version import Version + +from utils import cache + +__all__ = [ + "StubMetadata", + "PackageDependencies", + "StubtestSettings", + "get_recursive_requirements", + "read_dependencies", + "read_metadata", + "read_stubtest_settings", +] + + +_STUBTEST_PLATFORM_MAPPING: Final = {"linux": "apt_dependencies", "darwin": "brew_dependencies", "win32": "choco_dependencies"} + + +def _is_list_of_strings(obj: object) -> TypeGuard[list[str]]: + return isinstance(obj, list) and all(isinstance(item, str) for item in obj) + + +@final +@dataclass(frozen=True) +class StubtestSettings: + """The stubtest settings for a single stubs distribution. + + Don't construct instances directly; use the `read_stubtest_settings` function. + """ + + skipped: bool + apt_dependencies: list[str] + brew_dependencies: list[str] + choco_dependencies: list[str] + extras: list[str] + ignore_missing_stub: bool + platforms: list[str] + + def system_requirements_for_platform(self, platform: str) -> list[str]: + assert platform in _STUBTEST_PLATFORM_MAPPING, f"Unrecognised platform {platform!r}" + ret = getattr(self, _STUBTEST_PLATFORM_MAPPING[platform]) + assert _is_list_of_strings(ret) + return ret + + +@cache +def read_stubtest_settings(distribution: str) -> StubtestSettings: + """Return an object describing the stubtest settings for a single stubs distribution.""" + with Path("stubs", distribution, "METADATA.toml").open("rb") as f: + data: dict[str, object] = tomli.load(f).get("tool", {}).get("stubtest", {}) + + skipped = data.get("skip", False) + apt_dependencies = data.get("apt_dependencies", []) + brew_dependencies = data.get("brew_dependencies", []) + choco_dependencies = data.get("choco_dependencies", []) + extras = data.get("extras", []) + ignore_missing_stub = data.get("ignore_missing_stub", True) + specified_platforms = data.get("platforms", ["linux"]) + + assert type(skipped) is bool + assert type(ignore_missing_stub) is bool + + # It doesn't work for type-narrowing if we use a for loop here... + assert _is_list_of_strings(specified_platforms) + assert _is_list_of_strings(apt_dependencies) + assert _is_list_of_strings(brew_dependencies) + assert _is_list_of_strings(choco_dependencies) + assert _is_list_of_strings(extras) + + unrecognised_platforms = set(specified_platforms) - _STUBTEST_PLATFORM_MAPPING.keys() + assert not unrecognised_platforms, f"Unrecognised platforms specified for {distribution!r}: {unrecognised_platforms}" + + for platform, dep_key in _STUBTEST_PLATFORM_MAPPING.items(): + if platform not in specified_platforms: + assert dep_key not in data, ( + f"Stubtest is not run on {platform} in CI for {distribution!r}, " + f"but {dep_key!r} are specified in METADATA.toml" + ) + + return StubtestSettings( + skipped=skipped, + apt_dependencies=apt_dependencies, + brew_dependencies=brew_dependencies, + choco_dependencies=choco_dependencies, + extras=extras, + ignore_missing_stub=ignore_missing_stub, + platforms=specified_platforms, + ) + + +@final +@dataclass(frozen=True) +class StubMetadata: + """The metadata for a single stubs distribution. + + Don't construct instances directly; use the `read_metadata` function. + """ + + version: str + requires: Annotated[list[str], "The raw requirements as listed in METADATA.toml"] + extra_description: str | None + stub_distribution: Annotated[str, "The name under which the distribution is uploaded to PyPI"] + obsolete_since: Annotated[str, "A string representing a specific version"] | None + no_longer_updated: bool + uploaded_to_pypi: Annotated[bool, "Whether or not a distribution is uploaded to PyPI"] + stubtest_settings: StubtestSettings + + +_KNOWN_METADATA_FIELDS: Final = frozenset( + {"version", "requires", "extra_description", "stub_distribution", "obsolete_since", "no_longer_updated", "upload", "tool"} +) +_KNOWN_METADATA_TOOL_FIELDS: Final = { + "stubtest": { + "skip", + "apt_dependencies", + "brew_dependencies", + "choco_dependencies", + "extras", + "ignore_missing_stub", + "platforms", + } +} +_DIST_NAME_RE: Final = re.compile(r"^[a-z0-9]([a-z0-9._-]*[a-z0-9])?$", re.IGNORECASE) + + +@cache +def read_metadata(distribution: str) -> StubMetadata: + """Return an object describing the metadata of a stub as given in the METADATA.toml file. + + This function does some basic validation, + but does no parsing, transforming or normalization of the metadata. + Use `read_dependencies` if you need to parse the dependencies + given in the `requires` field, for example. + """ + with Path("stubs", distribution, "METADATA.toml").open("rb") as f: + data: dict[str, object] = tomli.load(f) + + unknown_metadata_fields = data.keys() - _KNOWN_METADATA_FIELDS + assert not unknown_metadata_fields, f"Unexpected keys in METADATA.toml for {distribution!r}: {unknown_metadata_fields}" + + assert "version" in data, f"Missing 'version' field in METADATA.toml for {distribution!r}" + version = data["version"] + assert isinstance(version, str) + # Check that the version parses + Version(version[:-2] if version.endswith(".*") else version) + + requires = data.get("requires", []) + assert isinstance(requires, list) + for req in requires: + assert isinstance(req, str), f"Invalid requirement {req!r} for {distribution!r}" + for space in " \t\n": + assert space not in req, f"For consistency, requirement should not have whitespace: {req!r}" + # Check that the requirement parses + Requirement(req) + + extra_description = data.get("extra_description") + assert isinstance(extra_description, (str, type(None))) + + if "stub_distribution" in data: + stub_distribution = data["stub_distribution"] + assert isinstance(stub_distribution, str) + assert _DIST_NAME_RE.fullmatch(stub_distribution), f"Invalid 'stub_distribution' value for {distribution!r}" + else: + stub_distribution = f"types-{distribution}" + + obsolete_since = data.get("obsolete_since") + assert isinstance(obsolete_since, (str, type(None))) + no_longer_updated = data.get("no_longer_updated", False) + assert type(no_longer_updated) is bool + uploaded_to_pypi = data.get("upload", True) + assert type(uploaded_to_pypi) is bool + + tools_settings = data.get("tool", {}) + assert isinstance(tools_settings, dict) + assert tools_settings.keys() <= _KNOWN_METADATA_TOOL_FIELDS.keys(), f"Unrecognised tool for {distribution!r}" + for tool, tk in _KNOWN_METADATA_TOOL_FIELDS.items(): + settings_for_tool = tools_settings.get(tool, {}) + assert isinstance(settings_for_tool, dict) + for key in settings_for_tool: + assert key in tk, f"Unrecognised {tool} key {key!r} for {distribution!r}" + + return StubMetadata( + version=version, + requires=requires, + extra_description=extra_description, + stub_distribution=stub_distribution, + obsolete_since=obsolete_since, + no_longer_updated=no_longer_updated, + uploaded_to_pypi=uploaded_to_pypi, + stubtest_settings=read_stubtest_settings(distribution), + ) + + +class PackageDependencies(NamedTuple): + typeshed_pkgs: tuple[str, ...] + external_pkgs: tuple[str, ...] + + +@cache +def get_pypi_name_to_typeshed_name_mapping() -> Mapping[str, str]: + return {read_metadata(typeshed_name).stub_distribution: typeshed_name for typeshed_name in os.listdir("stubs")} + + +@cache +def read_dependencies(distribution: str) -> PackageDependencies: + """Read the dependencies listed in a METADATA.toml file for a stubs package. + + Once the dependencies have been read, + determine which dependencies are typeshed-internal dependencies, + and which dependencies are external (non-types) dependencies. + For typeshed dependencies, translate the "dependency name" into the "package name"; + for external dependencies, leave them as they are in the METADATA.toml file. + + Note that this function may consider things to be typeshed stubs + even if they haven't yet been uploaded to PyPI. + If a typeshed stub is removed, this function will consider it to be an external dependency. + """ + pypi_name_to_typeshed_name_mapping = get_pypi_name_to_typeshed_name_mapping() + typeshed, external = [], [] + for dependency in read_metadata(distribution).requires: + maybe_typeshed_dependency = Requirement(dependency).name + if maybe_typeshed_dependency in pypi_name_to_typeshed_name_mapping: + typeshed.append(pypi_name_to_typeshed_name_mapping[maybe_typeshed_dependency]) + else: + # convert to Requirement and then back to str + # to make sure that the requirements all have a normalised string representation + # (This will also catch any malformed requirements early) + external.append(str(Requirement(dependency))) + return PackageDependencies(tuple(typeshed), tuple(external)) + + +@cache +def get_recursive_requirements(package_name: str) -> PackageDependencies: + """Recursively gather dependencies for a single stubs package. + + For example, if the stubs for `caldav` + declare a dependency on typeshed's stubs for `requests`, + and the stubs for requests declare a dependency on typeshed's stubs for `urllib3`, + `get_recursive_requirements("caldav")` will determine that the stubs for `caldav` + have both `requests` and `urllib3` as typeshed-internal dependencies. + """ + typeshed: set[str] = set() + external: set[str] = set() + non_recursive_requirements = read_dependencies(package_name) + typeshed.update(non_recursive_requirements.typeshed_pkgs) + external.update(non_recursive_requirements.external_pkgs) + for pkg in non_recursive_requirements.typeshed_pkgs: + reqs = get_recursive_requirements(pkg) + typeshed.update(reqs.typeshed_pkgs) + external.update(reqs.external_pkgs) + return PackageDependencies(tuple(sorted(typeshed)), tuple(sorted(external))) diff --git a/tests/pytype_test.py b/tests/pytype_test.py index 7e8e69ba0163..4d771af36172 100755 --- a/tests/pytype_test.py +++ b/tests/pytype_test.py @@ -22,7 +22,7 @@ from pytype import config as pytype_config, load_pytd # type: ignore[import] from pytype.imports import typeshed # type: ignore[import] -import utils +from parse_metadata import read_dependencies TYPESHED_SUBDIRS = ["stdlib", "stubs"] TYPESHED_HOME = "TYPESHED_HOME" @@ -153,7 +153,7 @@ def get_missing_modules(files_to_test: Sequence[str]) -> Iterable[str]: stub_distributions.add(parts[idx + 1]) missing_modules = set() for distribution in stub_distributions: - for pkg in utils.read_dependencies(distribution).external_pkgs: + for pkg in read_dependencies(distribution).external_pkgs: # See https://stackoverflow.com/a/54853084 top_level_file = os.path.join(pkg_resources.get_distribution(pkg).egg_info, "top_level.txt") # type: ignore[attr-defined] with open(top_level_file) as f: diff --git a/tests/regr_test.py b/tests/regr_test.py index cd1ac5dae2d8..2174d5903f55 100644 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -15,13 +15,13 @@ from pathlib import Path from typing_extensions import TypeAlias +from parse_metadata import get_recursive_requirements from utils import ( PackageInfo, VenvInfo, colored, get_all_testcase_directories, get_mypy_req, - get_recursive_requirements, make_venv, print_error, print_success_msg, diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index 22abbe9939ba..480d47fc33db 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -24,7 +24,6 @@ collections.AsyncGenerator.ag_frame collections.AsyncGenerator.ag_running collections.Callable collections.Mapping.__reversed__ # Set to None at runtime for a better error message -collections.UserString.maketrans contextvars.ContextVar.get distutils.command.bdist_wininst # see #6523 dummy_threading.Condition.acquire @@ -84,7 +83,6 @@ distutils.core.gen_usage distutils.core.setup_keywords dummy_threading.Lock dummy_threading.RLock -dummy_threading.stack_size html.parser.HTMLParser.unescape platform.popen plistlib.Data.asBase64 diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index ea44eb240128..b8377089c689 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -102,7 +102,6 @@ distutils.fancy_getopt.neg_alias_re dummy_threading.ExceptHookArgs dummy_threading.Lock dummy_threading.RLock -dummy_threading.stack_size html.parser.HTMLParser.unescape multiprocessing.managers.SharedMemoryServer.create multiprocessing.managers.SharedMemoryServer.list_segments diff --git a/tests/stubtest_third_party.py b/tests/stubtest_third_party.py index 7c8a44ebaa45..f142cfc60d9a 100755 --- a/tests/stubtest_third_party.py +++ b/tests/stubtest_third_party.py @@ -11,28 +11,25 @@ from pathlib import Path from typing import NoReturn -import tomli - -from utils import colored, get_mypy_req, get_recursive_requirements, make_venv, print_error, print_success_msg +from parse_metadata import get_recursive_requirements, read_metadata +from utils import colored, get_mypy_req, make_venv, print_error, print_success_msg def run_stubtest(dist: Path, *, verbose: bool = False, specified_stubs_only: bool = False) -> bool: - with open(dist / "METADATA.toml", encoding="UTF-8") as f: - metadata = dict(tomli.loads(f.read())) - - print(f"{dist.name}... ", end="") + dist_name = dist.name + metadata = read_metadata(dist_name) + print(f"{dist_name}... ", end="") - stubtest_meta = metadata.get("tool", {}).get("stubtest", {}) - if stubtest_meta.get("skip", False): + stubtest_settings = metadata.stubtest_settings + if stubtest_settings.skipped: print(colored("skipping", "yellow")) return True - platforms_to_test = stubtest_meta.get("platforms", ["linux"]) - if sys.platform not in platforms_to_test: + if sys.platform not in stubtest_settings.platforms: if specified_stubs_only: print(colored("skipping (platform not specified in METADATA.toml)", "yellow")) return True - print(colored(f"Note: {dist.name} is not currently tested on {sys.platform} in typeshed's CI.", "yellow")) + print(colored(f"Note: {dist_name} is not currently tested on {sys.platform} in typeshed's CI.", "yellow")) with tempfile.TemporaryDirectory() as tmp: venv_dir = Path(tmp) @@ -41,12 +38,8 @@ def run_stubtest(dist: Path, *, verbose: bool = False, specified_stubs_only: boo except Exception: print_error("fail") raise - dist_version = metadata["version"] - extras = stubtest_meta.get("extras", []) - assert isinstance(dist_version, str) - assert isinstance(extras, list) - dist_extras = ", ".join(extras) - dist_req = f"{dist.name}[{dist_extras}]=={dist_version}" + dist_extras = ", ".join(stubtest_settings.extras) + dist_req = f"{dist_name}[{dist_extras}]=={metadata.version}" # If @tests/requirements-stubtest.txt exists, run "pip install" on it. req_path = dist / "@tests" / "requirements-stubtest.txt" @@ -58,7 +51,7 @@ def run_stubtest(dist: Path, *, verbose: bool = False, specified_stubs_only: boo print_command_failure("Failed to install requirements", e) return False - requirements = get_recursive_requirements(dist.name) + requirements = get_recursive_requirements(dist_name) # We need stubtest to be able to import the package, so install mypy into the venv # Hopefully mypy continues to not need too many dependencies @@ -72,7 +65,7 @@ def run_stubtest(dist: Path, *, verbose: bool = False, specified_stubs_only: boo print_command_failure("Failed to install", e) return False - ignore_missing_stub = ["--ignore-missing-stub"] if stubtest_meta.get("ignore_missing_stub", True) else [] + ignore_missing_stub = ["--ignore-missing-stub"] if stubtest_settings.ignore_missing_stub else [] packages_to_check = [d.name for d in dist.iterdir() if d.is_dir() and d.name.isidentifier()] modules_to_check = [d.stem for d in dist.iterdir() if d.is_file() and d.suffix == ".pyi"] stubtest_cmd = [ diff --git a/tests/utils.py b/tests/utils.py index c2c3389323dc..ab5011eddd90 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -7,15 +7,13 @@ import subprocess import sys import venv -from collections.abc import Iterable, Mapping +from collections.abc import Iterable from functools import lru_cache from pathlib import Path from typing import NamedTuple from typing_extensions import Annotated import pathspec -import tomli -from packaging.requirements import Requirement try: from termcolor import colored as colored @@ -29,9 +27,6 @@ def colored(text: str, color: str | None = None, on_color: str | None = None, at # This module is imported by mypy_test.py, which needs to run on 3.7 in CI cache = lru_cache(None) -# Used to install system-wide packages for different OS types: -METADATA_MAPPING = {"linux": "apt_dependencies", "darwin": "brew_dependencies", "win32": "choco_dependencies"} - def strip_comments(text: str) -> str: return text.split("#")[0].strip() @@ -49,81 +44,6 @@ def print_success_msg() -> None: print(colored("success", "green")) -# ==================================================================== -# Reading dependencies from METADATA.toml files -# ==================================================================== - - -class PackageDependencies(NamedTuple): - typeshed_pkgs: tuple[str, ...] - external_pkgs: tuple[str, ...] - - -@cache -def get_pypi_name_to_typeshed_name_mapping() -> Mapping[str, str]: - stub_name_map = {} - for typeshed_name in os.listdir("stubs"): - with Path("stubs", typeshed_name, "METADATA.toml").open("rb") as f: - pypi_name = tomli.load(f).get("stub_distribution", f"types-{typeshed_name}") - assert isinstance(pypi_name, str) - stub_name_map[pypi_name] = typeshed_name - return stub_name_map - - -@cache -def read_dependencies(distribution: str) -> PackageDependencies: - """Read the dependencies listed in a METADATA.toml file for a stubs package. - - Once the dependencies have been read, - determine which dependencies are typeshed-internal dependencies, - and which dependencies are external (non-types) dependencies. - For typeshed dependencies, translate the "dependency name" into the "package name"; - for external dependencies, leave them as they are in the METADATA.toml file. - - Note that this function may consider things to be typeshed stubs - even if they haven't yet been uploaded to PyPI. - If a typeshed stub is removed, this function will consider it to be an external dependency. - """ - pypi_name_to_typeshed_name_mapping = get_pypi_name_to_typeshed_name_mapping() - with Path("stubs", distribution, "METADATA.toml").open("rb") as f: - dependencies = tomli.load(f).get("requires", []) - assert isinstance(dependencies, list) - typeshed, external = [], [] - for dependency in dependencies: - assert isinstance(dependency, str) - maybe_typeshed_dependency = Requirement(dependency).name - if maybe_typeshed_dependency in pypi_name_to_typeshed_name_mapping: - typeshed.append(pypi_name_to_typeshed_name_mapping[maybe_typeshed_dependency]) - else: - # convert to Requirement and then back to str - # to make sure that the requirements all have a normalised string representation - # (This will also catch any malformed requirements early) - external.append(str(Requirement(dependency))) - return PackageDependencies(tuple(typeshed), tuple(external)) - - -@cache -def get_recursive_requirements(package_name: str) -> PackageDependencies: - """Recursively gather dependencies for a single stubs package. - - For example, if the stubs for `caldav` - declare a dependency on typeshed's stubs for `requests`, - and the stubs for requests declare a dependency on typeshed's stubs for `urllib3`, - `get_recursive_requirements("caldav")` will determine that the stubs for `caldav` - have both `requests` and `urllib3` as typeshed-internal dependencies. - """ - typeshed: set[str] = set() - external: set[str] = set() - non_recursive_requirements = read_dependencies(package_name) - typeshed.update(non_recursive_requirements.typeshed_pkgs) - external.update(non_recursive_requirements.external_pkgs) - for pkg in non_recursive_requirements.typeshed_pkgs: - reqs = get_recursive_requirements(pkg) - typeshed.update(reqs.typeshed_pkgs) - external.update(reqs.external_pkgs) - return PackageDependencies(tuple(sorted(typeshed)), tuple(sorted(external))) - - # ==================================================================== # Dynamic venv creation # ==================================================================== From abc7fe31e5ba1c386e1c1af562033efc1b372c50 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 1 Feb 2023 13:12:32 -0500 Subject: [PATCH 13/25] Mark SQLAlchemy stubs with `ignore_missing_stub = false` --- .../SQLAlchemy/@tests/stubtest_allowlist.txt | 36 +++- stubs/SQLAlchemy/METADATA.toml | 3 + stubs/SQLAlchemy/sqlalchemy/__init__.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/cprocessors.pyi | 15 ++ .../sqlalchemy/dialects/firebird/__init__.pyi | 2 +- .../sqlalchemy/dialects/firebird/base.pyi | 13 +- .../dialects/firebird/kinterbasdb.pyi | 2 +- .../sqlalchemy/dialects/mssql/base.pyi | 6 +- .../dialects/mssql/information_schema.pyi | 2 +- .../sqlalchemy/dialects/mssql/json.pyi | 2 +- .../sqlalchemy/dialects/mssql/pymssql.pyi | 2 +- .../sqlalchemy/dialects/mssql/pyodbc.pyi | 2 +- .../sqlalchemy/dialects/mysql/asyncmy.pyi | 14 +- .../sqlalchemy/dialects/mysql/base.pyi | 3 +- .../sqlalchemy/dialects/mysql/dml.pyi | 2 +- .../sqlalchemy/dialects/mysql/json.pyi | 2 +- .../dialects/mysql/mysqlconnector.pyi | 2 +- .../sqlalchemy/dialects/mysql/mysqldb.pyi | 2 +- .../sqlalchemy/dialects/mysql/pymysql.pyi | 2 +- .../sqlalchemy/dialects/mysql/types.pyi | 2 +- .../sqlalchemy/dialects/oracle/base.pyi | 6 +- .../sqlalchemy/dialects/oracle/cx_oracle.pyi | 3 +- .../sqlalchemy/dialects/postgresql/array.pyi | 4 +- .../dialects/postgresql/asyncpg.pyi | 3 + .../sqlalchemy/dialects/postgresql/base.pyi | 3 +- .../sqlalchemy/dialects/postgresql/dml.pyi | 2 +- .../sqlalchemy/dialects/postgresql/hstore.pyi | 4 +- .../sqlalchemy/dialects/postgresql/json.pyi | 2 +- .../sqlalchemy/dialects/postgresql/pg8000.pyi | 3 +- .../dialects/postgresql/psycopg2.pyi | 3 +- .../dialects/postgresql/pygresql.pyi | 2 +- .../dialects/postgresql/pypostgresql.pyi | 5 +- .../sqlalchemy/dialects/postgresql/ranges.pyi | 2 +- .../sqlalchemy/dialects/sqlite/base.pyi | 6 +- .../sqlalchemy/dialects/sqlite/dml.pyi | 2 +- .../sqlalchemy/dialects/sqlite/json.pyi | 2 +- .../sqlalchemy/dialects/sybase/base.pyi | 7 +- .../sqlalchemy/dialects/sybase/mxodbc.pyi | 4 +- .../sqlalchemy/dialects/sybase/pyodbc.pyi | 6 +- .../sqlalchemy/dialects/sybase/pysybase.pyi | 4 +- .../sqlalchemy/engine/characteristics.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi | 7 +- .../SQLAlchemy/sqlalchemy/engine/default.pyi | 5 +- .../sqlalchemy/engine/interfaces.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/engine/row.pyi | 6 +- .../sqlalchemy/ext/associationproxy.pyi | 2 +- .../sqlalchemy/ext/asyncio/base.pyi | 8 +- .../sqlalchemy/ext/asyncio/engine.pyi | 4 +- .../sqlalchemy/ext/asyncio/result.pyi | 2 +- .../sqlalchemy/ext/asyncio/scoping.pyi | 3 +- .../sqlalchemy/ext/asyncio/session.pyi | 3 +- stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi | 9 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 14 +- .../SQLAlchemy/sqlalchemy/orm/attributes.pyi | 29 ++- stubs/SQLAlchemy/sqlalchemy/orm/base.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/context.pyi | 2 + stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 2 +- .../sqlalchemy/orm/descriptor_props.pyi | 2 +- .../sqlalchemy/orm/instrumentation.pyi | 4 +- .../SQLAlchemy/sqlalchemy/orm/interfaces.pyi | 2 + stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi | 3 +- .../sqlalchemy/orm/path_registry.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/persistence.pyi | 14 +- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 1 + .../sqlalchemy/orm/relationships.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 3 +- stubs/SQLAlchemy/sqlalchemy/orm/state.pyi | 2 +- .../sqlalchemy/orm/strategy_options.pyi | 1 + stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi | 2 +- .../SQLAlchemy/sqlalchemy/sql/annotation.pyi | 196 +++++++++++++++++- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 7 +- stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi | 8 + stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi | 4 +- .../SQLAlchemy/sqlalchemy/sql/selectable.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi | 15 +- .../SQLAlchemy/sqlalchemy/sql/traversals.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 2 + .../sqlalchemy/testing/__init__.pyi | 3 + .../sqlalchemy/testing/assertions.pyi | 3 + .../SQLAlchemy/sqlalchemy/testing/config.pyi | 1 + stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi | 1 + .../sqlalchemy/testing/plugin/plugin_base.pyi | 15 +- .../testing/plugin/pytestplugin.pyi | 5 + .../sqlalchemy/testing/requirements.pyi | 18 ++ stubs/SQLAlchemy/sqlalchemy/testing/util.pyi | 2 + stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi | 31 ++- .../sqlalchemy/util/concurrency.pyi | 4 +- .../sqlalchemy/util/deprecations.pyi | 1 + 94 files changed, 539 insertions(+), 168 deletions(-) create mode 100644 stubs/SQLAlchemy/sqlalchemy/cprocessors.pyi diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index d2716d1ab5eb..05df8b35790a 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -1,3 +1,24 @@ +# mypy plugin not supported in typeshed +sqlalchemy.ext.mypy.* +# test suites +sqlalchemy.testing.suite +# Unintended re-exports +sqlalchemy.testing.plugin.plugin_base.logging +# Leaked re-exports from the compat module +sqlalchemy.dialects.mysql.pymysql.py3k +sqlalchemy.engine.result.py2k +sqlalchemy.log.py311 +sqlalchemy.log.py38 +sqlalchemy.sql.traversals.py37 +sqlalchemy.testing.mock.py3k +sqlalchemy.testing.util.has_refcount_gc +sqlalchemy.testing.util.py2k +sqlalchemy.util.quote +sqlalchemy.util._collections.binary_types +sqlalchemy.util._collections.py2k +sqlalchemy.util._collections.py37 +sqlalchemy.util._collections.string_types + # Expanding keyword arguments in stubs sqlalchemy.ext.declarative.as_declarative @@ -19,9 +40,16 @@ sqlalchemy.engine.Connection.engine sqlalchemy.orm.Mapper.single sqlalchemy.orm.mapper.Mapper.single -# uses @memoized_property at runtime, but we use @property for compatibility +# Uses @memoized_property at runtime, but we use @property for compatibility sqlalchemy.engine.URL.normalized_query sqlalchemy.engine.url.URL.normalized_query +# Uses @memoized_property, but that causes regr_test to raise 'Cannot determine type of "..." in base class "..." [misc]' +sqlalchemy.schema.SchemaItem.info +sqlalchemy.sql.elements.AnnotatedColumnElement.info +sqlalchemy.sql.elements.AnnotatedColumnElement.key +sqlalchemy.sql.elements.AnnotatedColumnElement.name +sqlalchemy.sql.elements.AnnotatedColumnElement.table +sqlalchemy.sql.schema.SchemaItem.info # runtime has extra internal arguments that are inconsistent across micro versions sqlalchemy.testing.engines.testing_engine @@ -40,6 +68,10 @@ sqlalchemy.testing.fixtures sqlalchemy.testing.pickleable sqlalchemy.testing.plugin.bootstrap +# unclear problems +sqlalchemy.orm.instrumentation.instrumentation_finders +sqlalchemy.dialects.mysql.asyncmy.AsyncAdapt_asyncmy_dbapi.Binary + # method arguments starting with double underscores in the implementation trips up stubtest sqlalchemy.testing.resolve_lambda sqlalchemy.testing.util.resolve_lambda @@ -61,3 +93,5 @@ sqlalchemy.util.compat.StringIO.seek sqlalchemy.util.compat.StringIO.truncate sqlalchemy.util.StringIO.seek sqlalchemy.util.StringIO.truncate +# Re-export from unittest.mock, so it inherits the same stubtest issues +sqlalchemy.testing.mock.patch diff --git a/stubs/SQLAlchemy/METADATA.toml b/stubs/SQLAlchemy/METADATA.toml index 6cabd7b32a64..a57ec292efcd 100644 --- a/stubs/SQLAlchemy/METADATA.toml +++ b/stubs/SQLAlchemy/METADATA.toml @@ -4,3 +4,6 @@ extra_description = """\ includes a mypy plugin for more precise types.\ """ obsolete_since = "2.0.0" # Released on 2023-01-26 + +[tool.stubtest] +ignore_missing_stub = false diff --git a/stubs/SQLAlchemy/sqlalchemy/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/__init__.pyi index dde3cbce262a..85d101e51219 100644 --- a/stubs/SQLAlchemy/sqlalchemy/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/__init__.pyi @@ -84,7 +84,7 @@ from .sql import ( values as values, within_group as within_group, ) -from .types import ( +from .sql.sqltypes import ( ARRAY as ARRAY, BIGINT as BIGINT, BINARY as BINARY, diff --git a/stubs/SQLAlchemy/sqlalchemy/cprocessors.pyi b/stubs/SQLAlchemy/sqlalchemy/cprocessors.pyi new file mode 100644 index 000000000000..93df3b165828 --- /dev/null +++ b/stubs/SQLAlchemy/sqlalchemy/cprocessors.pyi @@ -0,0 +1,15 @@ +class DecimalResultProcessor: + def __init__(self, *args, **kwargs) -> None: ... + def process(self, *args, **kwargs): ... + +class UnicodeResultProcessor: + def __init__(self, *args, **kwargs) -> None: ... + def conditional_process(self, *args, **kwargs): ... + def process(self, *args, **kwargs): ... + +def int_to_boolean(*args, **kwargs): ... +def str_to_date(*args, **kwargs): ... +def str_to_datetime(*args, **kwargs): ... +def str_to_time(*args, **kwargs): ... +def to_float(*args, **kwargs): ... +def to_str(*args, **kwargs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi index c421f787eb13..a849e4ca686d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/__init__.pyi @@ -1,6 +1,6 @@ from typing import Any -from sqlalchemy.dialects.firebird.base import ( +from .base import ( BIGINT as BIGINT, BLOB as BLOB, CHAR as CHAR, diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi index 564282e8ec1a..8a323c6b427d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi @@ -1,10 +1,9 @@ from _typeshed import Incomplete from typing import Any -from sqlalchemy import sql, types as sqltypes -from sqlalchemy.engine import default -from sqlalchemy.sql import compiler -from sqlalchemy.types import ( +from ...engine import default +from ...sql import compiler, sqltypes +from ...sql.sqltypes import ( BIGINT as BIGINT, BLOB as BLOB, DATE as DATE, @@ -46,7 +45,7 @@ class FBTypeCompiler(compiler.GenericTypeCompiler): def visit_CHAR(self, type_, **kw): ... def visit_VARCHAR(self, type_, **kw): ... -class FBCompiler(sql.compiler.SQLCompiler): +class FBCompiler(compiler.SQLCompiler): ansi_bind_rules: bool def visit_now_func(self, fn, **kw): ... def visit_startswith_op_binary(self, binary, operator, **kw): ... @@ -63,12 +62,12 @@ class FBCompiler(sql.compiler.SQLCompiler): def limit_clause(self, select, **kw): ... def returning_clause(self, stmt, returning_cols): ... -class FBDDLCompiler(sql.compiler.DDLCompiler): +class FBDDLCompiler(compiler.DDLCompiler): def visit_create_sequence(self, create): ... def visit_drop_sequence(self, drop): ... def visit_computed_column(self, generated): ... -class FBIdentifierPreparer(sql.compiler.IdentifierPreparer): +class FBIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any illegal_initial_characters: Any def __init__(self, dialect) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi index 09d3dabd6262..163d5214b2d3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ...types import Float, Numeric +from ...sql.sqltypes import Float, Numeric from .base import FBDialect, FBExecutionContext class _kinterbasdb_numeric: diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 59d9d16fbc12..81b0d9b00848 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -2,12 +2,10 @@ from _typeshed import Incomplete from typing import Any, overload from typing_extensions import Literal -import sqlalchemy.types as sqltypes - from ...engine import default -from ...sql import compiler +from ...sql import compiler, sqltypes from ...sql.elements import Cast -from ...types import ( +from ...sql.sqltypes import ( BIGINT as BIGINT, BINARY as BINARY, CHAR as CHAR, diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi index 0a97a197f164..f91531a75777 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/information_schema.pyi @@ -1,7 +1,7 @@ from typing import Any from ...sql import expression -from ...types import TypeDecorator +from ...sql.type_api import TypeDecorator ischema: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi index 2ced3beece0d..5d5bb5efe05d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/json.pyi @@ -1,4 +1,4 @@ -from ...types import JSON as _JSON +from ...sql.sqltypes import JSON as _JSON class JSON(_JSON): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi index b16a0b4f729f..01e796368015 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pymssql.pyi @@ -1,6 +1,6 @@ from typing import Any -from ...types import Numeric +from ...sql.sqltypes import Numeric from .base import MSDialect, MSIdentifierPreparer class _MSNumeric_pymssql(Numeric): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi index 0ee156b64f52..fed71eaeb278 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from typing import Any from ...connectors.pyodbc import PyODBCConnector -from ...types import DateTime, Float, Numeric +from ...sql.sqltypes import DateTime, Float, Numeric from .base import BINARY, DATETIMEOFFSET, VARBINARY, MSDialect, MSExecutionContext class _ms_numeric_pyodbc: diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi index 69a9d5576155..f1dd233fa74c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi @@ -1,5 +1,7 @@ -from _typeshed import Incomplete -from typing import Any +from _typeshed import Incomplete, ReadableBuffer +from collections.abc import Iterable +from typing import Any, SupportsBytes +from typing_extensions import SupportsIndex from ...engine import AdaptedConnection from .pymysql import MySQLDialect_pymysql @@ -51,10 +53,18 @@ class AsyncAdapt_asyncmy_connection(AdaptedConnection): class AsyncAdaptFallback_asyncmy_connection(AsyncAdapt_asyncmy_connection): await_: Any +def _Binary(x: Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> bytes: ... + class AsyncAdapt_asyncmy_dbapi: asyncmy: Any pymysql: Any paramstyle: str + STRING: Incomplete + NUMBER: Incomplete + BINARY: Incomplete + DATETIME: Incomplete + TIMESTAMP: Incomplete + Binary = staticmethod(_Binary) def __init__(self, asyncmy: Any) -> None: ... def connect(self, *arg, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi index 129de51ebaf6..93a266921203 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi @@ -3,9 +3,10 @@ from typing import Any from ...engine import default from ...sql import compiler -from ...types import BINARY as BINARY, BLOB as BLOB, BOOLEAN as BOOLEAN, DATE as DATE, VARBINARY as VARBINARY +from ...sql.sqltypes import BINARY as BINARY, BLOB as BLOB, BOOLEAN as BOOLEAN, DATE as DATE, VARBINARY as VARBINARY from .enumerated import ENUM as ENUM, SET as SET from .json import JSON as JSON +from .reserved_words import RESERVED_WORDS_MARIADB as RESERVED_WORDS_MARIADB, RESERVED_WORDS_MYSQL as RESERVED_WORDS_MYSQL from .types import ( BIGINT as BIGINT, BIT as BIT, diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi index 77b095c16b73..47463bbc4767 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/dml.pyi @@ -2,7 +2,7 @@ from typing import Any from ...sql.dml import Insert as StandardInsert from ...sql.elements import ClauseElement -from ...util import memoized_property +from ...util.langhelpers import memoized_property class Insert(StandardInsert): stringify_dialect: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi index c35f9c440158..8baa9ff03c5a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/json.pyi @@ -1,4 +1,4 @@ -import sqlalchemy.types as sqltypes +from ...sql import sqltypes class JSON(sqltypes.JSON): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi index df0a63589b1c..5ee626ed9d9d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqlconnector.pyi @@ -1,6 +1,6 @@ from typing import Any -from ...util import memoized_property +from ...util.langhelpers import memoized_property from .base import BIT, MySQLCompiler, MySQLDialect, MySQLIdentifierPreparer class MySQLCompiler_mysqlconnector(MySQLCompiler): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi index a8479ad8bf33..f9b6d148956d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ...util import memoized_property +from ...util.langhelpers import memoized_property from .base import MySQLCompiler, MySQLDialect, MySQLExecutionContext class MySQLExecutionContext_mysqldb(MySQLExecutionContext): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi index fa7a490882a7..4554ebfe81ae 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ...util import memoized_property +from ...util.langhelpers import memoized_property from .mysqldb import MySQLDialect_mysqldb class MySQLDialect_pymysql(MySQLDialect_mysqldb): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index 5db2c9257995..b68d8692a766 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes +from ...sql import sqltypes class _NumericType: unsigned: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi index 9b41e88b2f2e..8d1b1cb82286 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi @@ -1,11 +1,9 @@ from _typeshed import Incomplete from typing import Any -from sqlalchemy.sql import ClauseElement - from ...engine import default -from ...sql import compiler, sqltypes -from ...types import ( +from ...sql import ClauseElement, compiler, sqltypes +from ...sql.sqltypes import ( BLOB as BLOB, CHAR as CHAR, CLOB as CLOB, diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi index 3484c83e073d..8d0d03defaf2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi @@ -1,8 +1,7 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes - +from ...sql import sqltypes from . import base as oracle from .base import OracleCompiler, OracleDialect, OracleExecutionContext diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi index 5bcc21b1c817..c7ecf1183b0a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi @@ -1,8 +1,6 @@ from typing import Any as _Any -import sqlalchemy.types as sqltypes - -from ...sql import expression +from ...sql import expression, sqltypes def Any(other, arrexpr, operator=...): ... def All(other, arrexpr, operator=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi index dfe48e376662..7d938c0b9642 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -122,6 +122,7 @@ class AsyncAdapt_asyncpg_connection(AdaptedConnection): def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... + def terminate(self) -> None: ... class AsyncAdaptFallback_asyncpg_connection(AsyncAdapt_asyncpg_connection): await_: Any @@ -152,6 +153,7 @@ class AsyncAdapt_asyncpg_dbapi: TIMESTAMP: Any TIMESTAMP_W_TZ: Any TIME: Any + TIME_W_TZ: Incomplete DATE: Any INTERVAL: Any NUMBER: Any @@ -175,6 +177,7 @@ class PGDialect_asyncpg(PGDialect): supports_unicode_statements: bool supports_server_side_cursors: bool supports_unicode_binds: bool + has_terminate: bool default_paramstyle: str supports_sane_multi_rowcount: bool statement_compiler: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index 683ada3fc5fb..68745b9cce6c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -5,7 +5,7 @@ from ...engine import characteristics, default, reflection from ...schema import _CreateDropBase from ...sql import compiler, elements, sqltypes from ...sql.ddl import DDLBase -from ...types import ( +from ...sql.sqltypes import ( BIGINT as BIGINT, BOOLEAN as BOOLEAN, CHAR as CHAR, @@ -179,6 +179,7 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_INET(self, type_, **kw): ... def visit_CIDR(self, type_, **kw): ... def visit_MACADDR(self, type_, **kw): ... + def visit_MACADDR8(self, type_, **kw): ... def visit_MONEY(self, type_, **kw): ... def visit_OID(self, type_, **kw): ... def visit_REGCLASS(self, type_, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi index 9ddcfcce27dd..8bfa11366da5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi @@ -3,7 +3,7 @@ from typing import Any from ...sql.dml import Insert as StandardInsert from ...sql.elements import ClauseElement -from ...util import memoized_property +from ...util.langhelpers import memoized_property class Insert(StandardInsert): stringify_dialect: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi index 3f37cdef1ac2..683f84ff75be 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -1,9 +1,7 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes - -from ...sql import functions as sqlfunc +from ...sql import functions as sqlfunc, sqltypes class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi index 728842b883ea..5f4aa5492037 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes +from ...sql import sqltypes class JSONPathType(sqltypes.JSON.JSONPathType): def bind_processor(self, dialect): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi index d87f2c0b5725..e7e9d9f71e1a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi @@ -1,8 +1,7 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes - +from ...sql import sqltypes from .array import ARRAY as PGARRAY from .base import ENUM, INTERVAL, UUID, PGCompiler, PGDialect, PGExecutionContext, PGIdentifierPreparer from .json import JSON, JSONB, JSONPathType diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi index e94fb3e02e4b..9305ed47e9fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi @@ -1,8 +1,7 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes - +from ...sql import sqltypes from .array import ARRAY as PGARRAY from .base import ENUM, UUID, PGCompiler, PGDialect, PGExecutionContext, PGIdentifierPreparer from .hstore import HSTORE diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi index a6f0d861b361..997db14e8656 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pygresql.pyi @@ -1,6 +1,6 @@ from typing import Any -from ...types import Numeric +from ...sql.sqltypes import Numeric from .base import UUID, PGCompiler, PGDialect, PGIdentifierPreparer from .hstore import HSTORE from .json import JSON, JSONB diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi index 1b5bed220c5c..9623ce216e69 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pypostgresql.pyi @@ -1,8 +1,7 @@ from typing import Any -import sqlalchemy.types as sqltypes - -from ...util import memoized_property +from ...sql import sqltypes +from ...util.langhelpers import memoized_property from .base import PGDialect, PGExecutionContext class PGNumeric(sqltypes.Numeric): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi index c31ee1b8298a..d12715f46573 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ranges.pyi @@ -1,6 +1,6 @@ from typing import Any -import sqlalchemy.types as sqltypes +from ...sql import sqltypes class RangeOperators: class comparator_factory(sqltypes.Concatenable.Comparator[Any]): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi index bb7d0c25efd7..ab1c8df9f3a9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi @@ -1,11 +1,9 @@ from _typeshed import Incomplete from typing import Any -import sqlalchemy.types as sqltypes - from ...engine import default -from ...sql import compiler -from ...types import ( +from ...sql import compiler, sqltypes +from ...sql.sqltypes import ( BLOB as BLOB, BOOLEAN as BOOLEAN, CHAR as CHAR, diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi index da20b23ada4c..8982c9ada9d0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi @@ -3,7 +3,7 @@ from typing import Any from ...sql.dml import Insert as StandardInsert from ...sql.elements import ClauseElement -from ...util import memoized_property +from ...util.langhelpers import memoized_property class Insert(StandardInsert): stringify_dialect: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi index 2ced3beece0d..5d5bb5efe05d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/json.pyi @@ -1,4 +1,4 @@ -from ...types import JSON as _JSON +from ...sql.sqltypes import JSON as _JSON class JSON(_JSON): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi index f6a90151b558..e464a67f89a0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi @@ -1,10 +1,9 @@ from _typeshed import Incomplete from typing import Any -from sqlalchemy import types as sqltypes -from sqlalchemy.engine import default, reflection -from sqlalchemy.sql import compiler -from sqlalchemy.types import ( +from ...engine import default, reflection +from ...sql import compiler, sqltypes +from ...sql.sqltypes import ( BIGINT as BIGINT, BINARY as BINARY, CHAR as CHAR, diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi index 596496ea18f5..30ba517d28e5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/mxodbc.pyi @@ -1,5 +1,5 @@ -from sqlalchemy.connectors.mxodbc import MxODBCConnector -from sqlalchemy.dialects.sybase.base import SybaseDialect, SybaseExecutionContext +from ...connectors.mxodbc import MxODBCConnector +from .base import SybaseDialect, SybaseExecutionContext class SybaseExecutionContext_mxodbc(SybaseExecutionContext): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi index 3940f1f665e3..6678e90eaf8f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi @@ -1,8 +1,8 @@ from typing import Any -from sqlalchemy import types as sqltypes -from sqlalchemy.connectors.pyodbc import PyODBCConnector -from sqlalchemy.dialects.sybase.base import SybaseDialect, SybaseExecutionContext +from ...connectors.pyodbc import PyODBCConnector +from ...sql import sqltypes +from .base import SybaseDialect, SybaseExecutionContext class _SybNumeric_pyodbc(sqltypes.Numeric): def bind_processor(self, dialect): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi index d0a7a81aa869..b66e7c0c0c7e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from typing import Any -from sqlalchemy import types as sqltypes -from sqlalchemy.dialects.sybase.base import SybaseDialect, SybaseExecutionContext, SybaseSQLCompiler +from ...sql import sqltypes +from .base import SybaseDialect, SybaseExecutionContext, SybaseSQLCompiler class _SybNumeric(sqltypes.Numeric): def result_processor(self, dialect, type_): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi index ab5b5f63cddc..2833b4fd6bfb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/characteristics.pyi @@ -1,14 +1,12 @@ -import abc +from abc import ABC, ABCMeta, abstractmethod -from ..util import ABC - -class ConnectionCharacteristic(ABC, metaclass=abc.ABCMeta): +class ConnectionCharacteristic(ABC, metaclass=ABCMeta): transactional: bool - @abc.abstractmethod + @abstractmethod def reset_characteristic(self, dialect, dbapi_conn): ... - @abc.abstractmethod + @abstractmethod def set_characteristic(self, dialect, dbapi_conn, value): ... - @abc.abstractmethod + @abstractmethod def get_characteristic(self, dialect, dbapi_conn): ... class IsolationLevelCharacteristic(ConnectionCharacteristic): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi index 76d0d369d6f7..b9787943cbec 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi @@ -1,8 +1,9 @@ -import abc from _typeshed import Incomplete +from abc import ABCMeta from typing import Any -from ..util import memoized_property +from ..sql.compiler import RM_NAME as RM_NAME, RM_OBJECTS as RM_OBJECTS, RM_RENDERED_NAME as RM_RENDERED_NAME, RM_TYPE as RM_TYPE +from ..util.langhelpers import memoized_property from .result import Result, ResultMetaData from .row import LegacyRow @@ -128,5 +129,5 @@ ResultProxy = LegacyCursorResult class BufferedRowResultProxy(ResultProxy): ... class FullyBufferedResultProxy(ResultProxy): ... -class BufferedColumnRow(LegacyRow, metaclass=abc.ABCMeta): ... +class BufferedColumnRow(LegacyRow, metaclass=ABCMeta): ... class BufferedColumnResultProxy(ResultProxy): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi index fa725cb70d93..1e872b1aa8bb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from typing import Any, ClassVar -from .. import types as sqltypes -from ..util import memoized_property +from ..sql import sqltypes +from ..util.langhelpers import memoized_property from . import interfaces AUTOCOMMIT_REGEXP: Any @@ -78,6 +78,7 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] CACHING_DISABLED: Any NO_CACHE_KEY: Any NO_DIALECT_SUPPORT: Any + has_terminate: bool convert_unicode: Any encoding: Any positional: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index afe46eb46e85..da4597688e56 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -42,8 +42,8 @@ class Dialect: supports_native_enum: bool supports_native_boolean: bool dbapi_exception_translation_map: dict[Any, Any] - supports_statement_cache: bool + dispatch: Incomplete @abstractmethod def create_connect_args(self, url: URL) -> None: ... def initialize(self, connection) -> None: ... @@ -75,6 +75,7 @@ class Dialect: def do_begin(self, dbapi_connection) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... + def do_terminate(self, dbapi_connection) -> None: ... def do_close(self, dbapi_connection) -> None: ... def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... def create_xid(self) -> None: ... @@ -122,6 +123,7 @@ class ExecutionContext: def get_rowcount(self) -> None: ... class Connectable: + dispatch: Incomplete @abstractmethod def connect(self, **kwargs) -> Connection: ... @property @@ -165,3 +167,4 @@ class ExceptionContext: class AdaptedConnection: @property def driver_connection(self): ... + def run_async(self, fn): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index c3fb605ae078..e98cba7da3ff 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -38,6 +38,8 @@ class _WithKeys: class Result(_WithKeys, ResultInternal): def __init__(self, cursor_metadata) -> None: ... def close(self) -> None: ... + @property + def closed(self): ... def yield_per(self: Self, num: int) -> Self: ... def unique(self: Self, strategy: Incomplete | None = ...) -> Self: ... def columns(self, *col_expressions): ... @@ -59,7 +61,11 @@ class Result(_WithKeys, ResultInternal): def freeze(self) -> FrozenResult: ... def merge(self, *others) -> MergedResult: ... -class FilterResult(ResultInternal): ... +class FilterResult(ResultInternal): + def yield_per(self: Self, num) -> Self: ... + @property + def closed(self): ... + def close(self) -> None: ... class ScalarResult(FilterResult): def __init__(self, real_result, index) -> None: ... @@ -101,6 +107,8 @@ class IteratorResult(Result): iterator: Any raw: Any def __init__(self, cursor_metadata, iterator, raw: Incomplete | None = ..., _source_supports_scalars: bool = ...) -> None: ... + @property + def closed(self): ... def null_result() -> IteratorResult: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi index b5098c78b5c7..909a243a19d7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi @@ -1,4 +1,4 @@ -import abc +from abc import ABCMeta from collections.abc import ItemsView, KeysView, Mapping, Sequence, ValuesView from typing import Any @@ -13,7 +13,7 @@ KEY_OBJECTS_ONLY: int KEY_OBJECTS_BUT_WARN: int KEY_OBJECTS_NO_WARN: int -class Row(BaseRow, Sequence[Any], metaclass=abc.ABCMeta): +class Row(BaseRow, Sequence[Any], metaclass=ABCMeta): @property def count(self): ... @property @@ -28,7 +28,7 @@ class Row(BaseRow, Sequence[Any], metaclass=abc.ABCMeta): def __ne__(self, other): ... def keys(self): ... -class LegacyRow(Row, metaclass=abc.ABCMeta): +class LegacyRow(Row, metaclass=ABCMeta): def __contains__(self, key): ... def has_key(self, key): ... def items(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi index d72c6d7ee574..a3ebf8f728b8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -3,7 +3,7 @@ from typing import Any from ..orm import interfaces from ..sql.operators import ColumnOperators -from ..util import memoized_property +from ..util.langhelpers import memoized_property def association_proxy(target_collection, attr, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi index fb8ba65ec5db..04c653395972 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi @@ -1,13 +1,13 @@ -import abc +from abc import ABC, ABCMeta, abstractmethod class ReversibleProxy: ... -class StartableContext(abc.ABC, metaclass=abc.ABCMeta): - @abc.abstractmethod +class StartableContext(ABC, metaclass=ABCMeta): + @abstractmethod async def start(self, is_ctxmanager: bool = ...): ... def __await__(self): ... async def __aenter__(self): ... - @abc.abstractmethod + @abstractmethod async def __aexit__(self, type_, value, traceback): ... class ProxyComparable(ReversibleProxy): diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi index 37258ead63d1..fd7d37add7e0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi @@ -4,8 +4,10 @@ from typing import Any from .base import ProxyComparable, StartableContext def create_async_engine(*arg, **kw) -> AsyncEngine: ... +def async_engine_from_config(configuration, prefix: str = ..., **kwargs) -> AsyncEngine: ... -class AsyncConnectable: ... +class AsyncConnectable: + dispatch: Incomplete class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): engine: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi index 43a2a3b0b879..95894e42707d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi @@ -3,7 +3,7 @@ from _typeshed import Incomplete from ...engine.result import FilterResult class AsyncCommon(FilterResult): - async def close(self) -> None: ... + async def close(self) -> None: ... # type: ignore[override] # supertype is not async class AsyncResult(AsyncCommon): def __init__(self, real_result) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi index a71390ced527..948731bfd62c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi @@ -2,11 +2,12 @@ from _typeshed import Incomplete from typing import Any from ...orm.scoping import ScopedSessionMixin -from ...util import memoized_property +from ...util.langhelpers import memoized_property class async_scoped_session(ScopedSessionMixin): session_factory: Any registry: Any + def invalidate(self): ... def __init__(self, session_factory, scopefunc) -> None: ... async def remove(self) -> None: ... # proxied from Session diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index da62a7d9d6a3..d2465948b322 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete, Self from typing import Any -from ...util import memoized_property +from ...util.langhelpers import memoized_property from .base import ReversibleProxy, StartableContext class AsyncSession(ReversibleProxy): @@ -51,6 +51,7 @@ class AsyncSession(ReversibleProxy): async def rollback(self): ... async def commit(self): ... async def close(self): ... + async def invalidate(self): ... @classmethod async def close_all(cls): ... async def __aenter__(self: Self) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi index 2cf3c3250ac0..dc5139effa64 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete from typing import Any +from ..orm.strategy_options import Load, loader_option + log: Any class Bakery: @@ -40,7 +42,8 @@ class Result: def bake_lazy_loaders() -> None: ... def unbake_lazy_loaders() -> None: ... +@loader_option() +def baked_lazyload(loadopt: Load, attr) -> loader_option: ... +def baked_lazyload_all(loadopt: Load, attr) -> loader_option: ... -baked_lazyload: Any -baked_lazyload_all: Any -bakery: Any +bakery = BakedQuery.bakery diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index 54b045cbc314..8f99ae0f2dcd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,11 +1,23 @@ +import sys from _typeshed import Self from logging import Logger from typing import Any, TypeVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Final, Literal, TypeAlias _ClsT = TypeVar("_ClsT", bound=type) _EchoFlag: TypeAlias = bool | Literal["debug"] | None +if sys.version_info >= (3, 8): + STACKLEVEL: Final = True + + if sys.version_info >= (3, 11): + STACKLEVEL_OFFSET: Final = 2 + else: + STACKLEVEL_OFFSET: Final = 1 +else: + STACKLEVEL: Final = False + STACKLEVEL_OFFSET: Final = 0 + rootlogger: Any def class_logger(cls: _ClsT) -> _ClsT: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi index c054153eef86..1c1c5d4ec9b0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -2,8 +2,34 @@ from _typeshed import Incomplete from typing import Any, Generic, NamedTuple, TypeVar from ..sql import base as sql_base, roles, traversals -from ..util import memoized_property +from ..util.langhelpers import memoized_property from . import interfaces +from .base import ( + ATTR_EMPTY as ATTR_EMPTY, + ATTR_WAS_SET as ATTR_WAS_SET, + CALLABLES_OK as CALLABLES_OK, + DEFERRED_HISTORY_LOAD as DEFERRED_HISTORY_LOAD, + INIT_OK as INIT_OK, + LOAD_AGAINST_COMMITTED as LOAD_AGAINST_COMMITTED, + NEVER_SET as NEVER_SET, + NO_AUTOFLUSH as NO_AUTOFLUSH, + NO_CHANGE as NO_CHANGE, + NO_RAISE as NO_RAISE, + NO_VALUE as NO_VALUE, + NON_PERSISTENT_OK as NON_PERSISTENT_OK, + PASSIVE_CLASS_MISMATCH as PASSIVE_CLASS_MISMATCH, + PASSIVE_NO_FETCH as PASSIVE_NO_FETCH, + PASSIVE_NO_FETCH_RELATED as PASSIVE_NO_FETCH_RELATED, + PASSIVE_NO_INITIALIZE as PASSIVE_NO_INITIALIZE, + PASSIVE_NO_RESULT as PASSIVE_NO_RESULT, + PASSIVE_OFF as PASSIVE_OFF, + PASSIVE_ONLY_PERSISTENT as PASSIVE_ONLY_PERSISTENT, + PASSIVE_RETURN_NO_VALUE as PASSIVE_RETURN_NO_VALUE, + RELATED_OBJECT_OK as RELATED_OBJECT_OK, + SQL_OK as SQL_OK, + instance_dict as instance_dict, + instance_state as instance_state, +) _T = TypeVar("_T") @@ -27,6 +53,7 @@ class QueryableAttribute( key: Any impl: Any comparator: Any + dispatch: Incomplete def __init__( self, class_, diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi index 4d247f53c726..cd54836b2833 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi @@ -1,6 +1,6 @@ from typing import Any -from ..util import memoized_property +from ..util.langhelpers import memoized_property PASSIVE_NO_RESULT: Any PASSIVE_CLASS_MISMATCH: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index 423eeb985552..db3e6c479589 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -56,6 +56,7 @@ class ORMCompileState(CompileState): class ORMFromStatementCompileState(ORMCompileState): multi_row_eager_loaders: bool + eager_adding_joins: bool compound_eager_adapter: Any extra_criteria_entities: Any eager_joins: Any @@ -78,6 +79,7 @@ class ORMFromStatementCompileState(ORMCompileState): class ORMSelectCompileState(ORMCompileState, SelectState): multi_row_eager_loaders: bool + eager_adding_joins: bool compound_eager_adapter: Any correlate: Any correlate_except: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index c54ea44d0485..671533116fc8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -5,7 +5,7 @@ from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..sql.schema import MetaData -from ..util import hybridproperty +from ..util.langhelpers import hybridproperty from . import interfaces _ClsT = TypeVar("_ClsT", bound=type[Any]) diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi index f4e8b7930dd9..636a70516bc6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from typing import Any, ClassVar, Generic, TypeVar from ..sql.operators import ColumnOperators -from ..util import memoized_property +from ..util.langhelpers import memoized_property from . import util as orm_util from .interfaces import MapperProperty, PropComparator diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi index 6c972cef57ad..6990518ff8b6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ..util import HasMemoized, hybridmethod +from ..util.langhelpers import HasMemoized, hybridmethod from . import base DEL_ATTR: Any @@ -24,6 +24,7 @@ class ClassManager(HasMemoized, dict[Any, Any]): new_init: Any local_attrs: Any originals: Any + dispatch: Incomplete def __init__(self, class_) -> None: ... def __hash__(self) -> int: ... # type: ignore[override] def __eq__(self, other): ... @@ -67,6 +68,7 @@ class _SerializeManager: def __call__(self, state, inst, state_dict) -> None: ... class InstrumentationFactory: + dispatch: Incomplete def create_manager_for_cls(self, class_): ... def unregister(self, class_) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi index 61b1c7f7eb0a..23d0010789e6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi @@ -44,6 +44,8 @@ class ORMFromClauseRole(roles.StrictFromClauseRole): ... class MapperProperty(HasCacheKey, _MappedAttribute, InspectionAttr, util.MemoizedSlots): cascade: Any is_property: bool + key: Incomplete + info: Incomplete def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi index 999ad8981258..aac71f2c4c1d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from typing import Any from ..sql import base as sql_base -from ..util import HasMemoized, memoized_property +from ..util.langhelpers import HasMemoized, memoized_property from .base import ( _class_to_mapper as _class_to_mapper, _state_mapper as _state_mapper, @@ -43,6 +43,7 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas polymorphic_map: Any include_properties: Any exclude_properties: Any + dispatch: Incomplete def __init__( self, class_, diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi index 9da5d3161f46..8d53184c6939 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from typing import Any, ClassVar from ..sql.traversals import HasCacheKey -from ..util import memoized_property +from ..util.langhelpers import memoized_property from . import base as orm_base log: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi index 8d5d721e7d5e..31ed7e4a0a50 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi @@ -1,7 +1,7 @@ from typing import Any from ..sql.base import CompileState, Options -from ..sql.dml import DeleteDMLState, UpdateDMLState +from ..sql.dml import DeleteDMLState, InsertDMLState, UpdateDMLState def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ... def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ... @@ -15,6 +15,18 @@ class BulkUDCompileState(CompileState): @classmethod def orm_setup_cursor_result(cls, session, statement, params, execution_options, bind_arguments, result): ... +class ORMDMLState: + @classmethod + def get_entity_description(cls, statement): ... + @classmethod + def get_returning_column_descriptions(cls, statement): ... + +class ORMInsert(ORMDMLState, InsertDMLState): + @classmethod + def orm_pre_session_exec(cls, session, statement, params, execution_options, bind_arguments, is_reentrant_invoke): ... + @classmethod + def orm_setup_cursor_result(cls, session, statement, params, execution_options, bind_arguments, result): ... + class BulkORMUpdate(UpdateDMLState, BulkUDCompileState): mapper: Any extra_criteria_entities: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index 1e643cb7720d..2931c39eb7ca 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -19,6 +19,7 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi logger: Any load_options: Any session: Any + dispatch: Incomplete def __init__(self, entities, session: Incomplete | None = ...) -> None: ... @property def statement(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi index e7382a512721..4c9e05d07664 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from typing import Any, ClassVar, Generic, TypeVar from ..sql.operators import ColumnOperators -from ..util import memoized_property +from ..util.langhelpers import memoized_property from .interfaces import PropComparator, StrategizedProperty _T = TypeVar("_T") diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi index 0731e46169c0..7a3555374768 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ..util import memoized_property +from ..util.langhelpers import memoized_property class ScopedSessionMixin: def __call__(self, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index f5ca6a284fb3..a5bc2eb9fab4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -7,7 +7,7 @@ from ..engine.result import Result from ..engine.util import TransactionalContext from ..sql.elements import ColumnElement from ..sql.schema import Table -from ..util import MemoizedSlots, memoized_property +from ..util.langhelpers import MemoizedSlots, memoized_property from .query import Query _T = TypeVar("_T") @@ -91,6 +91,7 @@ class Session(_SessionClassMethods): enable_baked_queries: Any autocommit: bool twophase: Any + dispatch: Incomplete def __init__( self, bind: Incomplete | None = ..., diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi index 60621f0bfc62..14d83915ba30 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/state.pyi @@ -1,6 +1,6 @@ from typing import Any -from ..util import memoized_property +from ..util.langhelpers import memoized_property from . import interfaces class InstanceState(interfaces.InspectionAttrInfo): diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index c83a4c9dab9b..3e1ee1b39f90 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -39,6 +39,7 @@ class Load(Generative, LoaderOption): def undefer_group(loadopt: Self, name) -> Self: ... def with_expression(loadopt: Self, key, expression) -> Self: ... def selectin_polymorphic(loadopt: Self, classes) -> Self: ... + def baked_lazyload(loadopt: Self, attr) -> Self: ... class _UnboundLoad(Load): path: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index 14e6e99b8afc..3a8d01d616c3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -4,7 +4,7 @@ from collections.abc import Callable from typing import Any from .. import log -from ..util import memoized_property +from ..util.langhelpers import memoized_property reset_rollback: Any reset_commit: Any @@ -12,8 +12,10 @@ reset_none: Any class _ConnDialect: is_async: bool + has_terminate: bool def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... + def do_terminate(self, dbapi_connection) -> None: ... def do_close(self, dbapi_connection) -> None: ... def do_ping(self, dbapi_connection) -> None: ... def get_driver_connection(self, connection): ... @@ -24,6 +26,7 @@ class _AsyncConnDialect(_ConnDialect): class Pool(log.Identified): logging_name: Any echo: Any + dispatch: Incomplete def __init__( self, creator: Callable[[], DBAPIConnection], diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi index 2646cafd536d..9b3006621f31 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi @@ -1,6 +1,6 @@ from typing import Any -from ..util import memoized_property +from ..util.langhelpers import memoized_property from .base import Pool class QueuePool(Pool): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi index e631cb48bf55..1a02e1ff88da 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi @@ -1,13 +1,112 @@ -from typing import Any +from _typeshed import Incomplete +from typing import TypeVar -EMPTY_ANNOTATIONS: Any +from ..schema import Table +from ..sql.compiler import _CompileLabel +from ..sql.crud import _multiparam_column +from ..sql.elements import ( + AnnotatedColumnElement as _ElementsAnnotatedColumnElement, + AsBoolean, + BinaryExpression, + BindParameter, + BooleanClauseList, + Case, + Cast, + ClauseList, + CollationClause, + CollectionAggregate, + ColumnClause, + ColumnElement, + Extract, + False_, + FunctionFilter, + Grouping, + IndexExpression, + Label, + NamedColumn, + Null, + Over, + Slice, + TableValuedColumn, + True_, + Tuple, + TypeCoerce, + UnaryExpression, + WithinGroup, + _label_reference, + _textual_label_reference, +) +from ..sql.functions import ( + AnsiFunction, + Function, + FunctionAsBinary, + FunctionElement, + GenericFunction, + OrderedSetAgg, + ReturnTypeFromArgs, + ScalarFunctionColumn, + array_agg, + char_length, + coalesce, + concat, + count, + cube, + cume_dist, + current_date, + current_time, + current_timestamp, + current_user, + dense_rank, + grouping_sets, + localtime, + localtimestamp, + max, + min, + mode, + next_value, + now, + percent_rank, + percentile_cont, + percentile_disc, + random, + rank, + rollup, + session_user, + sum, + sysdate, + user, +) +from ..sql.schema import Column +from ..sql.selectable import ( + CTE, + Alias, + AliasedReturnsRows, + AnnotatedFromClause as _SelectableAnnotatedFromClause, + Exists, + FromClause, + FromGrouping, + Join, + Lateral, + ScalarSelect, + Subquery, + TableClause, + TableSample, + TableValuedAlias, + Values, + _OffsetLimitParam, +) +from ..util import immutabledict + +_T = TypeVar("_T") + +EMPTY_ANNOTATIONS: immutabledict[Incomplete, Incomplete] class SupportsAnnotations: ... class SupportsCloneAnnotations(SupportsAnnotations): ... class SupportsWrappingAnnotations(SupportsAnnotations): ... class Annotated: - __dict__: Any + __dict__: dict[str, Incomplete] def __init__(self, element, values) -> None: ... def __reduce__(self): ... def __hash__(self) -> int: ... @@ -15,4 +114,93 @@ class Annotated: @property def entity_namespace(self): ... -annotated_classes: Any +annotated_classes: dict[Incomplete, Incomplete] + +# Everything below is dynamically generated at runtime + +class AnnotatedAlias(AnnotatedAliasedReturnsRows, Alias): ... +class AnnotatedAliasedReturnsRows(AnnotatedFromClause, AliasedReturnsRows): ... +class AnnotatedAnsiFunction(AnnotatedGenericFunction[_T], AnsiFunction): ... # type: ignore[misc] +class AnnotatedAsBoolean(AnnotatedUnaryExpression[_T], AsBoolean): ... +class AnnotatedBinaryExpression(AnnotatedColumnElement[_T], BinaryExpression): ... +class AnnotatedBindParameter(AnnotatedColumnElement[_T], BindParameter[_T]): ... +class AnnotatedBooleanClauseList(AnnotatedColumnElement[_T], BooleanClauseList): ... +class AnnotatedCTE(AnnotatedAliasedReturnsRows, CTE): ... +class AnnotatedCase(AnnotatedColumnElement[_T], Case): ... +class AnnotatedCast(AnnotatedColumnElement[_T], Cast): ... +class AnnotatedClauseList(Annotated, ClauseList): ... +class AnnotatedCollationClause(AnnotatedColumnElement[_T], CollationClause): ... +class AnnotatedCollectionAggregate(AnnotatedUnaryExpression[_T], CollectionAggregate): ... +class AnnotatedColumn(AnnotatedColumnClause[_T], Column): ... +class AnnotatedColumnClause(AnnotatedNamedColumn[_T], ColumnClause): ... +class AnnotatedColumnElement(_ElementsAnnotatedColumnElement, ColumnElement[_T]): ... +class AnnotatedExists(AnnotatedUnaryExpression[_T], Exists): ... +class AnnotatedExtract(AnnotatedColumnElement[_T], Extract): ... +class AnnotatedFalse_(AnnotatedColumnElement[_T], False_): ... +class AnnotatedFromClause(_SelectableAnnotatedFromClause, FromClause): ... +class AnnotatedFromGrouping(AnnotatedFromClause, FromGrouping): ... +class AnnotatedFunction(AnnotatedFunctionElement[_T], Function): ... # type: ignore[misc] +class AnnotatedFunctionAsBinary(AnnotatedBinaryExpression[_T], FunctionAsBinary): ... +class AnnotatedFunctionElement(AnnotatedColumnElement[_T], FunctionElement): ... # type: ignore[misc] +class AnnotatedFunctionFilter(AnnotatedColumnElement[_T], FunctionFilter): ... +class AnnotatedGenericFunction(AnnotatedFunction[_T], GenericFunction): ... # type: ignore[misc] +class AnnotatedGrouping(AnnotatedColumnElement[_T], Grouping): ... +class AnnotatedIndexExpression(AnnotatedBinaryExpression[_T], IndexExpression): ... +class AnnotatedJoin(AnnotatedFromClause, Join): ... +class AnnotatedLabel(AnnotatedColumnElement[_T], Label): ... +class AnnotatedLateral(AnnotatedAliasedReturnsRows, Lateral): ... +class AnnotatedNamedColumn(AnnotatedColumnElement[_T], NamedColumn): ... +class AnnotatedNull(AnnotatedColumnElement[_T], Null): ... +class AnnotatedOrderedSetAgg(AnnotatedGenericFunction[_T], OrderedSetAgg): ... # type: ignore[misc] +class AnnotatedOver(AnnotatedColumnElement[_T], Over): ... +class AnnotatedReturnTypeFromArgs(AnnotatedGenericFunction[_T], ReturnTypeFromArgs): ... # type: ignore[misc] +class AnnotatedScalarFunctionColumn(AnnotatedNamedColumn[_T], ScalarFunctionColumn): ... +class AnnotatedScalarSelect(AnnotatedGrouping[_T], ScalarSelect): ... +class AnnotatedSlice(AnnotatedColumnElement[_T], Slice): ... +class AnnotatedSubquery(AnnotatedAliasedReturnsRows, Subquery): ... +class AnnotatedTable(AnnotatedTableClause, Table): ... +class AnnotatedTableClause(AnnotatedFromClause, TableClause): ... +class AnnotatedTableSample(AnnotatedAliasedReturnsRows, TableSample): ... +class AnnotatedTableValuedAlias(AnnotatedAlias, TableValuedAlias): ... +class AnnotatedTableValuedColumn(AnnotatedNamedColumn[_T], TableValuedColumn): ... +class AnnotatedTrue_(AnnotatedColumnElement[_T], True_): ... +class AnnotatedTuple(AnnotatedColumnElement[_T], Tuple): ... +class AnnotatedTypeCoerce(AnnotatedColumnElement[_T], TypeCoerce): ... +class AnnotatedUnaryExpression(AnnotatedColumnElement[_T], UnaryExpression): ... +class AnnotatedValues(AnnotatedFromClause, Values): ... +class AnnotatedWithinGroup(AnnotatedColumnElement[_T], WithinGroup): ... +class Annotated_CompileLabel(AnnotatedColumnElement[_T], _CompileLabel): ... +class Annotated_OffsetLimitParam(AnnotatedBindParameter[_T], _OffsetLimitParam): ... +class Annotated_label_reference(AnnotatedColumnElement[_T], _label_reference): ... +class Annotated_multiparam_column(AnnotatedColumnElement[_T], _multiparam_column[_T]): ... +class Annotated_textual_label_reference(AnnotatedColumnElement[_T], _textual_label_reference): ... +class Annotatedarray_agg(AnnotatedGenericFunction[_T], array_agg): ... # type: ignore[misc] +class Annotatedchar_length(AnnotatedGenericFunction[_T], char_length): ... # type: ignore[misc] +class Annotatedcoalesce(AnnotatedReturnTypeFromArgs[_T], coalesce): ... # type: ignore[misc] +class Annotatedconcat(AnnotatedGenericFunction[_T], concat): ... # type: ignore[misc] +class Annotatedcount(AnnotatedGenericFunction[_T], count): ... # type: ignore[misc] +class Annotatedcube(AnnotatedGenericFunction[_T], cube): ... # type: ignore[misc] +class Annotatedcume_dist(AnnotatedGenericFunction[_T], cume_dist): ... # type: ignore[misc] +class Annotatedcurrent_date(AnnotatedAnsiFunction[_T], current_date): ... # type: ignore[misc] +class Annotatedcurrent_time(AnnotatedAnsiFunction[_T], current_time): ... # type: ignore[misc] +class Annotatedcurrent_timestamp(AnnotatedAnsiFunction[_T], current_timestamp): ... # type: ignore[misc] +class Annotatedcurrent_user(AnnotatedAnsiFunction[_T], current_user): ... # type: ignore[misc] +class Annotateddense_rank(AnnotatedGenericFunction[_T], dense_rank): ... # type: ignore[misc] +class Annotatedgrouping_sets(AnnotatedGenericFunction[_T], grouping_sets): ... # type: ignore[misc] +class Annotatedlocaltime(AnnotatedAnsiFunction[_T], localtime): ... # type: ignore[misc] +class Annotatedlocaltimestamp(AnnotatedAnsiFunction[_T], localtimestamp): ... # type: ignore[misc] +class Annotatedmax(AnnotatedReturnTypeFromArgs[_T], max): ... # type: ignore[misc] +class Annotatedmin(AnnotatedReturnTypeFromArgs[_T], min): ... # type: ignore[misc] +class Annotatedmode(AnnotatedOrderedSetAgg[_T], mode): ... # type: ignore[misc] +class Annotatednext_value(AnnotatedGenericFunction[_T], next_value): ... # type: ignore[misc] +class Annotatednow(AnnotatedGenericFunction[_T], now): ... # type: ignore[misc] +class Annotatedpercent_rank(AnnotatedGenericFunction[_T], percent_rank): ... # type: ignore[misc] +class Annotatedpercentile_cont(AnnotatedOrderedSetAgg[_T], percentile_cont): ... # type: ignore[misc] +class Annotatedpercentile_disc(AnnotatedOrderedSetAgg[_T], percentile_disc): ... # type: ignore[misc] +class Annotatedrandom(AnnotatedGenericFunction[_T], random): ... # type: ignore[misc] +class Annotatedrank(AnnotatedGenericFunction[_T], rank): ... # type: ignore[misc] +class Annotatedrollup(AnnotatedGenericFunction[_T], rollup): ... # type: ignore[misc] +class Annotatedsession_user(AnnotatedAnsiFunction[_T], session_user): ... # type: ignore[misc] +class Annotatedsum(AnnotatedReturnTypeFromArgs[_T], sum): ... # type: ignore[misc] +class Annotatedsysdate(AnnotatedAnsiFunction[_T], sysdate): ... # type: ignore[misc] +class Annotateduser(AnnotatedAnsiFunction[_T], user): ... # type: ignore[misc] diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 2f7be1fbf26f..c3cf355234f3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -3,7 +3,7 @@ from collections.abc import MutableMapping from typing import Any, ClassVar from .. import util -from ..util import HasMemoized, hybridmethod, memoized_property +from ..util.langhelpers import HasMemoized, hybridmethod, memoized_property from . import roles from .elements import ColumnElement from .traversals import ( @@ -109,7 +109,8 @@ class Executable(roles.StatementRole, Generative): class prefix_anon_map(dict[Any, Any]): def __missing__(self, key): ... -class SchemaEventTarget: ... +class SchemaEventTarget: + dispatch: Incomplete class SchemaVisitor(ClauseVisitor): __traverse_options__: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index bd521727bdfa..567dac7559ff 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -1,9 +1,8 @@ from _typeshed import Incomplete from typing import NamedTuple -from sqlalchemy.util.langhelpers import EnsureKWArgType - -from ..util import memoized_property +from ..sql.base import CompileState +from ..util.langhelpers import EnsureKWArgType, memoized_property from . import elements RESERVED_WORDS: Incomplete @@ -45,6 +44,7 @@ class Compiled: schema_translate_map: Incomplete execution_options: Incomplete compile_state: Incomplete + dml_compile_state: CompileState | None cache_key: Incomplete dialect: Incomplete preparer: Incomplete @@ -107,6 +107,7 @@ class SQLCompiler(Compiled): update_prefetch: Incomplete postfetch_lastrowid: bool positiontup: Incomplete + positiontup_level: dict[str, int] | None inline: bool column_keys: Incomplete cache_key: Incomplete diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi index 8dbc7c04b8b8..22b69ce3b220 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi @@ -13,6 +13,10 @@ class DMLState(CompileState): def __init__(self, statement, compiler, **kw) -> None: ... @property def dml_table(self): ... + @classmethod + def get_entity_description(cls, statement) -> dict[str, Incomplete]: ... + @classmethod + def get_returning_column_descriptions(cls, statement) -> list[dict[str, Incomplete]]: ... class InsertDMLState(DMLState): isinsert: bool @@ -43,6 +47,10 @@ class UpdateBase(roles.DMLRole, HasCTE, HasCompileState, DialectKWArgs, HasPrefi @property def exported_columns(self): ... def with_hint(self, text, selectable: Incomplete | None = ..., dialect_name: str = ...) -> None: ... + @property + def entity_description(self): ... + @property + def returning_column_descriptions(self): ... class ValuesBase(UpdateBase): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index b6a4034d2efb..f5c67286b0fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -3,7 +3,7 @@ from typing import Any, Generic, TypeVar from typing_extensions import Literal from .. import util -from ..util import HasMemoized, memoized_property +from ..util.langhelpers import HasMemoized, memoized_property from . import operators, roles from .annotation import Annotated, SupportsWrappingAnnotations from .base import Executable, Immutable, SingletonConstant @@ -449,13 +449,13 @@ class quoted_name(util.MemoizedSlots, util.text_type): class AnnotatedColumnElement(Annotated): def __init__(self, element, values) -> None: ... - @memoized_property + @property # Should be @memoized_property, but that causes issues with regr_test def name(self): ... - @memoized_property + @property # Should be @memoized_property, but that causes issues with regr_test def table(self): ... - @memoized_property + @property # Should be @memoized_property, but that causes issues with regr_test def key(self): ... - @memoized_property + @property # Should be @memoized_property, but that causes issues with regr_test def info(self): ... class _truncated_label(quoted_name): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index d5180c37d9bf..893dba2467b6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ..util import HasMemoized +from ..util.langhelpers import HasMemoized from .base import Executable, Generative from .elements import BinaryExpression, ColumnElement, NamedColumn from .selectable import FromClause, TableValuedAlias diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index 21656beed655..55dcfe560ee3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from typing import Any -from ..util import memoized_property +from ..util.langhelpers import memoized_property from . import visitors from .base import DialectKWArgs, Executable, SchemaEventTarget from .elements import ColumnClause @@ -14,7 +14,7 @@ NULL_UNSPECIFIED: Any class SchemaItem(SchemaEventTarget, visitors.Visitable): __visit_name__: str create_drop_stringify_dialect: str - @memoized_property + @property # Should be @memoized_property, but that causes issues with regr_test def info(self): ... class Table(DialectKWArgs, SchemaItem, TableClause): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index cdf9bf417aa5..4d0bcbfa1587 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete, Self from typing import Any from .. import util -from ..util import HasMemoized, memoized_property +from ..util.langhelpers import HasMemoized, memoized_property from . import roles, traversals, visitors from .annotation import Annotated, SupportsCloneAnnotations from .base import CacheableOptions, CompileState, Executable, Generative, HasCompileState, Immutable @@ -115,6 +115,14 @@ class Alias(roles.DMLTableRole, AliasedReturnsRows): class TableValuedAlias(Alias): __visit_name__: str + joins_implicitly: bool + def _init( + self, + selectable, + name: Incomplete | None = None, + table_value_type: Incomplete | None = None, + joins_implicitly: bool = False, + ) -> None: ... @HasMemoized.memoized_attribute def column(self): ... def alias(self, name: Incomplete | None = ...): ... # type: ignore[override] diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index eef39d632164..72f482b65870 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -370,9 +370,12 @@ class TableValueType(HasCacheKey, TypeEngine): class MatchType(Boolean): ... -NULLTYPE: Any -BOOLEANTYPE: Any -STRINGTYPE: Any -INTEGERTYPE: Any -MATCHTYPE: Any -TABLEVALUE: Any +NULLTYPE: NullType +BOOLEANTYPE: Boolean +STRINGTYPE: String +INTEGERTYPE: Integer +NUMERICTYPE: Numeric +MATCHTYPE: MatchType +TABLEVALUE: TableValueType +DATETIME_TIMEZONE: DateTime +TIME_TIMEZONE: Time diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi index 0bd17128785e..5742b4dc1037 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi @@ -1,7 +1,6 @@ from typing import Any -from .. import util -from ..util import HasMemoized +from ..util.langhelpers import HasMemoized, MemoizedSlots from .visitors import ExtendedInternalTraversal, InternalTraversal SKIP_TRAVERSE: Any @@ -106,7 +105,7 @@ class anon_map(dict[Any, Any]): def __init__(self) -> None: ... def __missing__(self, key): ... -class TraversalComparatorStrategy(InternalTraversal, util.MemoizedSlots): +class TraversalComparatorStrategy(InternalTraversal, MemoizedSlots): stack: Any cache: Any anon_map: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index af91551597c6..214d79e672c9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -2,6 +2,7 @@ from _typeshed import Incomplete from typing import Any, Generic, TypeVar from .. import util +from ..sql.sqltypes import Boolean from . import operators from .base import SchemaEventTarget from .visitors import Traversible, TraversibleType @@ -26,6 +27,7 @@ class TypeEngine(Traversible): def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... def __reduce__(self): ... + BOOLEANTYPE: Boolean hashable: bool comparator_factory: Any sort_key_function: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi index a27e338db2f9..c03a2b53b4f2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/__init__.pyi @@ -39,6 +39,7 @@ from .config import ( combinations_list as combinations_list, db as db, fixture as fixture, + requirements, ) from .exclusions import ( db_spec as db_spec, @@ -69,6 +70,8 @@ from .util import ( ) from .warnings import assert_warnings as assert_warnings, warn_test_suite as warn_test_suite +requires = requirements + def against(*queries): ... crashes = skip diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi index e8366e9068ce..0594d15506d1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi @@ -8,6 +8,7 @@ def expect_deprecated_20(*messages, **kw): ... def emits_warning_on(db, *messages): ... def uses_deprecated(*messages): ... def global_cleanup_assertions() -> None: ... +def int_within_variance(expected, received, variance) -> None: ... def eq_regex(a, b, msg: Incomplete | None = ...) -> None: ... def eq_(a, b, msg: Incomplete | None = ...) -> None: ... def ne_(a, b, msg: Incomplete | None = ...) -> None: ... @@ -32,6 +33,8 @@ def eq_ignore_whitespace(a, b, msg: Incomplete | None = ...) -> None: ... def assert_raises(except_cls, callable_, *args, **kw): ... def assert_raises_context_ok(except_cls, callable_, *args, **kw): ... def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): ... +def assert_warns(except_cls, callable_, *args, **kwargs): ... +def assert_warns_message(except_cls, msg, callable_, *args, **kwargs): ... def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs): ... class _ErrorContainer: diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index dca81e31185f..b9474647a629 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -12,6 +12,7 @@ ident: str def combinations(*comb, **kw): ... def combinations_list(arg_iterable, **kw): ... +def variation(argname, cases): ... def fixture(*arg, **kw): ... def get_current_test_name(): ... def mark_base_test_class(): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi index e69de29bb2d1..b20ebabfd781 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/mock.pyi @@ -0,0 +1 @@ +from unittest.mock import ANY as ANY, MagicMock as MagicMock, Mock as Mock, call as call, patch as patch diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi index e0cdfbe59f28..8bb1c05c69e7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/plugin/plugin_base.pyi @@ -1,10 +1,9 @@ -import abc +from abc import ABC as ABC, ABCMeta, abstractmethod from typing import Any bootstrapped_as_sqlalchemy: bool log: Any py3k: Any -ABC = abc.ABC fixtures: Any engines: Any @@ -47,17 +46,17 @@ def before_test(test, test_module_name, test_class, test_name) -> None: ... def after_test(test) -> None: ... def after_test_fixtures(test) -> None: ... -class FixtureFunctions(ABC, metaclass=abc.ABCMeta): - @abc.abstractmethod +class FixtureFunctions(ABC, metaclass=ABCMeta): + @abstractmethod def skip_test_exception(self, *arg, **kw): ... - @abc.abstractmethod + @abstractmethod def combinations(self, *args, **kw): ... - @abc.abstractmethod + @abstractmethod def param_ident(self, *args, **kw): ... - @abc.abstractmethod + @abstractmethod def fixture(self, *arg, **kw): ... def get_current_test_name(self) -> None: ... - @abc.abstractmethod + @abstractmethod def mark_base_test_class(self): ... def set_fixture_functions(fixture_fn_class) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi index bfdd0245e8fe..757a2a0e0e0e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi @@ -13,6 +13,11 @@ def collect_types_fixture() -> None: ... def pytest_sessionstart(session) -> None: ... def pytest_sessionfinish(session) -> None: ... def pytest_collection_finish(session): ... + +class XDistHooks: + def pytest_configure_node(self, node) -> None: ... + def pytest_testnodedown(self, node, error) -> None: ... + def pytest_collection_modifyitems(session, config, items): ... def pytest_pycollect_makeitem(collector, name, obj): ... def pytest_runtest_setup(item) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi index 5f0a97c1a49a..a3e4c1d1170c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/requirements.pyi @@ -1,3 +1,5 @@ +from ..testing.exclusions import compound + class Requirements: ... class SuiteRequirements(Requirements): @@ -34,6 +36,8 @@ class SuiteRequirements(Requirements): @property def implicitly_named_constraints(self): ... @property + def unusual_column_name_characters(self) -> compound: ... + @property def subqueries(self): ... @property def offset(self): ... @@ -168,6 +172,8 @@ class SuiteRequirements(Requirements): @property def temp_table_names(self): ... @property + def has_temp_table(self) -> compound: ... + @property def temporary_tables(self): ... @property def temporary_views(self): ... @@ -198,10 +204,18 @@ class SuiteRequirements(Requirements): @property def datetime(self): ... @property + def datetime_timezone(self) -> compound: ... + @property + def time_timezone(self) -> compound: ... + @property + def datetime_implicit_bound(self) -> compound: ... + @property def datetime_microseconds(self): ... @property def timestamp_microseconds(self): ... @property + def timestamp_microseconds_implicit_bound(self) -> compound: ... + @property def datetime_historic(self): ... @property def date(self): ... @@ -326,6 +340,8 @@ class SuiteRequirements(Requirements): @property def cpython(self): ... @property + def is64bit(self) -> compound: ... + @property def patch_library(self): ... @property def non_broken_pickle(self): ... @@ -340,6 +356,8 @@ class SuiteRequirements(Requirements): @property def async_dialect(self): ... @property + def asyncio(self) -> compound: ... + @property def greenlet(self): ... @property def computed_columns(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi index 0da8a3883e94..fc6879fc4a99 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi @@ -36,4 +36,6 @@ class adict(dict[Any, Any]): def drop_all_tables_from_metadata(metadata, engine_or_connection) -> None: ... def drop_all_tables(engine, inspector, schema: Incomplete | None = ..., include_names: Incomplete | None = ...) -> None: ... +def total_size(o) -> int: ... def teardown_events(event_cls): ... +def count_cache_key_tuples(tup) -> int: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi index ae064446a2b3..bcca0252501d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/__init__.pyi @@ -1,6 +1,16 @@ -from collections import defaultdict as defaultdict +import asyncio as asyncio +import pickle as pickle +import threading as threading +from abc import ABC as ABC +from builtins import callable as callable, next as next +from collections import defaultdict as defaultdict, namedtuple as namedtuple # noqa: Y024 # Actual import from contextlib import contextmanager as contextmanager -from functools import partial as partial, update_wrapper as update_wrapper +from datetime import timezone as timezone +from functools import partial as partial, reduce as reduce, update_wrapper as update_wrapper +from io import StringIO as StringIO +from itertools import zip_longest as zip_longest +from typing import TYPE_CHECKING as TYPE_CHECKING +from urllib.parse import parse_qsl as parse_qsl, quote_plus as quote_plus, unquote as unquote, unquote_plus as unquote_plus from ._collections import ( EMPTY_DICT as EMPTY_DICT, @@ -40,9 +50,6 @@ from ._collections import ( ) from ._preloaded import preload_module as preload_module, preloaded as preloaded from .compat import ( - ABC as ABC, - TYPE_CHECKING as TYPE_CHECKING, - StringIO as StringIO, arm as arm, b as b, b64decode as b64decode, @@ -50,7 +57,6 @@ from .compat import ( binary_type as binary_type, binary_types as binary_types, byte_buffer as byte_buffer, - callable as callable, cmp as cmp, cpython as cpython, dataclass_fields as dataclass_fields, @@ -64,13 +70,9 @@ from .compat import ( itertools_filter as itertools_filter, itertools_filterfalse as itertools_filterfalse, local_dataclass_fields as local_dataclass_fields, - namedtuple as namedtuple, - next as next, nullcontext as nullcontext, osx as osx, - parse_qsl as parse_qsl, perf_counter as perf_counter, - pickle as pickle, print_ as print_, py2k as py2k, py3k as py3k, @@ -81,25 +83,18 @@ from .compat import ( py311 as py311, py312 as py312, pypy as pypy, - quote_plus as quote_plus, + quote as quote, raise_ as raise_, raise_from_cause as raise_from_cause, - reduce as reduce, reraise as reraise, string_types as string_types, text_type as text_type, - threading as threading, - timezone as timezone, u as u, ue as ue, - unquote as unquote, - unquote_plus as unquote_plus, win32 as win32, with_metaclass as with_metaclass, - zip_longest as zip_longest, ) from .concurrency import ( - asyncio as asyncio, await_fallback as await_fallback, await_only as await_only, greenlet_spawn as greenlet_spawn, diff --git a/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi b/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi index 7fe1879c18a2..dce9ae586b2a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +import asyncio as asyncio from ._compat_py3k import asynccontextmanager as asynccontextmanager from ._concurrency_py3k import ( @@ -10,4 +10,4 @@ from ._concurrency_py3k import ( ) have_greenlet: bool -asyncio: Incomplete | None +greenlet_error: str | None diff --git a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi index ca733b24aff0..c755277f4f4b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi @@ -7,6 +7,7 @@ from .langhelpers import ( ) SQLALCHEMY_WARN_20: bool +SILENCE_UBER_WARNING: bool def warn_deprecated(msg, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... From 710ee2a874c1751f7c3cadadb04d3019f20deadd Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 7 Feb 2023 19:48:53 -0500 Subject: [PATCH 14/25] Fix new pyright error --- stubs/SQLAlchemy/@tests/test_cases/check_register.py | 3 ++- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 41ad1f1d1ae5..fa732b72566a 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -7,6 +7,7 @@ from sqlalchemy.engine.default import DefaultDialect from sqlalchemy.engine.url import URL from sqlalchemy.pool.base import Pool +from sqlalchemy.testing import config from sqlalchemy.testing.provision import ( configure_follower, create_db, @@ -57,4 +58,4 @@ def no_args(__foo: Foo) -> None: prepare_for_drop_tables(url, unused) stop_test_class_outside_fixtures(url, unused, type) get_temp_table_name(url, unused, "") -set_default_schema_on_connection(url, unused, unused) +set_default_schema_on_connection(config, unused, unused) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index e32fec0eaee4..cfb5939c123d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger +from types import ModuleType from typing import Any, Generic, NoReturn, TypeVar from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL -from ..testing.config import Config +from .config import Config _Unused: TypeAlias = object _S = TypeVar("_S", bound=str) @@ -29,7 +30,7 @@ class register(Generic[_F]): def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system - def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] + def __call__(self, cfg: str | URL | ModuleType, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @@ -59,5 +60,7 @@ def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... @register.init # type: ignore[type-var] # False-positive, _S is bound to str def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... + +# Expects the "sqlalchemy.testing.provision.config" module @register.init -def set_default_schema_on_connection(cfg, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... +def set_default_schema_on_connection(cfg: ModuleType, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... From 63e819ff84fb930f67af259dd8b6f6ab83968882 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 7 Feb 2023 20:09:42 -0500 Subject: [PATCH 15/25] Use a module protocol --- .../@tests/test_cases/check_register.py | 10 ++++++++-- stubs/SQLAlchemy/sqlalchemy/testing/config.pyi | 15 ++++++++++++--- stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi | 9 +++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index fa732b72566a..5f76ccd454b7 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -7,7 +7,7 @@ from sqlalchemy.engine.default import DefaultDialect from sqlalchemy.engine.url import URL from sqlalchemy.pool.base import Pool -from sqlalchemy.testing import config +from sqlalchemy.testing import config as ConfigModule from sqlalchemy.testing.provision import ( configure_follower, create_db, @@ -30,6 +30,7 @@ url = URL("", "", "", "", 0, "", immutabledict()) engine = Engine(Pool(lambda: cast(DBAPIConnection, object())), DefaultDialect(), "") +config = cast(ConfigModule.Config, object()) unused = None @@ -37,13 +38,17 @@ class Foo: pass -# The decorator changes the first parameter to "cfg: str | URL" +# The decorator changes the first parameter to "cfg: str | URL | _ConfigProtocol" @register.init def no_args(__foo: Foo) -> None: pass +no_args(cfg="") no_args(cfg=url) +no_args(cfg=config) + +# Test pre-decorated functions generate_driver_url(url, "", "") drop_all_schema_objects_pre_tables(url, unused) drop_all_schema_objects_post_tables(url, unused) @@ -58,4 +63,5 @@ def no_args(__foo: Foo) -> None: prepare_for_drop_tables(url, unused) stop_test_class_outside_fixtures(url, unused, type) get_temp_table_name(url, unused, "") +set_default_schema_on_connection(ConfigModule, unused, unused) set_default_schema_on_connection(config, unused, unused) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index dca81e31185f..38193d6fd3ea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -1,12 +1,12 @@ -from typing import Any +from typing import Any, Protocol requirements: Any db: Any db_url: Any db_opts: Any file_config: Any -test_schema: Any -test_schema_2: Any +test_schema: str +test_schema_2: str any_async: bool ident: str @@ -16,6 +16,15 @@ def fixture(*arg, **kw): ... def get_current_test_name(): ... def mark_base_test_class(): ... +# Matches the intersection of the config module and the Config class +class _ConfigProtocol(Protocol): # noqa: Y046 + db: Any + db_opts: Any + file_config: Any + test_schema: str + test_schema_2: str + def skip_test(self, msg) -> None: ... + class Config: db: Any db_opts: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index cfb5939c123d..2e2049d36844 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,13 +1,12 @@ from _typeshed import Incomplete, Self from collections.abc import Callable from logging import Logger -from types import ModuleType from typing import Any, Generic, NoReturn, TypeVar from typing_extensions import TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL -from .config import Config +from .config import Config, _ConfigProtocol _Unused: TypeAlias = object _S = TypeVar("_S", bound=str) @@ -30,7 +29,7 @@ class register(Generic[_F]): def init(cls: type[Self], fn: _F) -> Self: ... def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system - def __call__(self, cfg: str | URL | ModuleType, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] + def __call__(self, cfg: str | URL | _ConfigProtocol, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @@ -60,7 +59,5 @@ def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... @register.init # type: ignore[type-var] # False-positive, _S is bound to str def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... - -# Expects the "sqlalchemy.testing.provision.config" module @register.init -def set_default_schema_on_connection(cfg: ModuleType, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... +def set_default_schema_on_connection(cfg: _ConfigProtocol, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... From 7f99f3a8010453a73c53666eaf84f9bc9ad0111f Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 7 Feb 2023 20:24:04 -0500 Subject: [PATCH 16/25] Fix stubtest --- .../SQLAlchemy/sqlalchemy/testing/config.pyi | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi index 38193d6fd3ea..c787b8c731fe 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/config.pyi @@ -1,12 +1,13 @@ +from _typeshed import Incomplete from typing import Any, Protocol -requirements: Any -db: Any -db_url: Any -db_opts: Any -file_config: Any -test_schema: str -test_schema_2: str +requirements: Incomplete | None +db: Incomplete | None +db_url: Incomplete | None +db_opts: Incomplete | None +file_config: Incomplete | None +test_schema: str | None +test_schema_2: str | None any_async: bool ident: str @@ -18,21 +19,21 @@ def mark_base_test_class(): ... # Matches the intersection of the config module and the Config class class _ConfigProtocol(Protocol): # noqa: Y046 - db: Any - db_opts: Any - file_config: Any - test_schema: str - test_schema_2: str + db: Incomplete + db_opts: Incomplete + file_config: Incomplete + test_schema: Any # AnyOf[str, None] + test_schema_2: Any # AnyOf[str, None] def skip_test(self, msg) -> None: ... class Config: - db: Any - db_opts: Any - options: Any - file_config: Any + db: Incomplete + db_opts: Incomplete + options: Incomplete + file_config: Incomplete test_schema: str test_schema_2: str - is_async: Any + is_async: Incomplete def __init__(self, db, db_opts, options, file_config) -> None: ... @classmethod def register(cls, db, db_opts, options, file_config) -> Config: ... From e96e15c252d54c514885d021495ed97cb8d1dc18 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 16 Mar 2023 15:29:49 +0000 Subject: [PATCH 17/25] Update stubs/SQLAlchemy/sqlalchemy/engine/url.pyi --- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 86ca63294a9b..0a4c48a085ea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -22,7 +22,7 @@ class _URLTuple(NamedTuple): _Query: TypeAlias = Mapping[str, str | Sequence[str]] | Sequence[tuple[str, str | Sequence[str]]] class URL(_URLTuple): - def __new__(self: type[Self], *arg, **kw) -> Self | URL: ... + def __new__(self, *arg, **kw) -> Self | URL: ... @classmethod def create( cls, From 6e7f6cc8b7c1923419bfc8b520c93b3a77abeffe Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 22 Mar 2023 13:12:57 -0400 Subject: [PATCH 18/25] Update usage of Self --- .../@tests/test_cases/check_register.py | 2 +- .../sqlalchemy/orm/strategy_options.pyi | 45 ++++++++++--------- .../sqlalchemy/testing/provision.pyi | 8 ++-- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/test_cases/check_register.py b/stubs/SQLAlchemy/@tests/test_cases/check_register.py index 5f76ccd454b7..28503f022216 100644 --- a/stubs/SQLAlchemy/@tests/test_cases/check_register.py +++ b/stubs/SQLAlchemy/@tests/test_cases/check_register.py @@ -38,7 +38,7 @@ class Foo: pass -# The decorator changes the first parameter to "cfg: str | URL | _ConfigProtocol" +# Test that the decorator changes the first parameter to "cfg: str | URL | _ConfigProtocol" @register.init def no_args(__foo: Foo) -> None: pass diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index c83a4c9dab9b..cf9761cfb3ee 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from typing import Any +from typing_extensions import Self from ..sql.base import Generative from .interfaces import LoaderOption @@ -18,27 +19,27 @@ class Load(Generative, LoaderOption): propagate_to_loaders: bool def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... - def options(self: Self, *opts) -> Self: ... - def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... - def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... - def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... - def set_class_strategy(self: Self, strategy, opts) -> Self: ... + def options(self, *opts) -> Self: ... + def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... + def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_generic_strategy(self, attrs, strategy) -> Self: ... + def set_class_strategy(self, strategy, opts) -> Self: ... # Added dynamically at runtime - def contains_eager(loadopt: Self, attr, alias: Incomplete | None = ...) -> Self: ... - def load_only(loadopt: Self, *attrs) -> Self: ... - def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = ...) -> Self: ... - def subqueryload(loadopt: Self, attr) -> Self: ... - def selectinload(loadopt: Self, attr) -> Self: ... - def lazyload(loadopt: Self, attr) -> Self: ... - def immediateload(loadopt: Self, attr) -> Self: ... - def noload(loadopt: Self, attr) -> Self: ... - def raiseload(loadopt: Self, attr, sql_only: bool = ...) -> Self: ... - def defaultload(loadopt: Self, attr) -> Self: ... - def defer(loadopt: Self, key, raiseload: bool = ...) -> Self: ... - def undefer(loadopt: Self, key) -> Self: ... - def undefer_group(loadopt: Self, name) -> Self: ... - def with_expression(loadopt: Self, key, expression) -> Self: ... - def selectin_polymorphic(loadopt: Self, classes) -> Self: ... + def contains_eager(loadopt, attr, alias: Incomplete | None = ...) -> Self: ... + def load_only(loadopt, *attrs) -> Self: ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def subqueryload(loadopt, attr) -> Self: ... + def selectinload(loadopt, attr) -> Self: ... + def lazyload(loadopt, attr) -> Self: ... + def immediateload(loadopt, attr) -> Self: ... + def noload(loadopt, attr) -> Self: ... + def raiseload(loadopt, attr, sql_only: bool = ...) -> Self: ... + def defaultload(loadopt, attr) -> Self: ... + def defer(loadopt, key, raiseload: bool = ...) -> Self: ... + def undefer(loadopt, key) -> Self: ... + def undefer_group(loadopt, name) -> Self: ... + def with_expression(loadopt, key, expression) -> Self: ... + def selectin_polymorphic(loadopt, classes) -> Self: ... class _UnboundLoad(Load): path: Any @@ -49,7 +50,7 @@ class loader_option: name: str # The first parameter of this Callable should always be `loadopt: Load` fn: Callable[..., loader_option] - def __call__(self: Self, fn: Callable[..., loader_option]) -> Self: ... + def __call__(self, fn: Callable[..., loader_option]) -> Self: ... # loader_option instances that can be used to dynamically add methods to Load at runtime @loader_option() diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index 2e2049d36844..8029cd4e9851 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL @@ -26,8 +26,8 @@ def reap_dbs(idents_file) -> None: ... class register(Generic[_F]): fns: dict[str, _F] @classmethod - def init(cls: type[Self], fn: _F) -> Self: ... - def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... + def init(cls, fn: _F) -> Self: ... + def for_db(self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system def __call__(self, cfg: str | URL | _ConfigProtocol, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] From e266ef7f401e5f9ed23462f3d6a8e984293317d5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 31 Mar 2023 15:17:44 -0400 Subject: [PATCH 19/25] Ran stubdefaulter before merge --- .../SQLAlchemy/sqlalchemy/cimmutabledict.pyi | 2 +- .../sqlalchemy/connectors/mxodbc.pyi | 4 +- .../sqlalchemy/connectors/pyodbc.pyi | 2 +- .../sqlalchemy/dialects/firebird/base.pyi | 28 +-- .../sqlalchemy/dialects/firebird/fdb.pyi | 2 +- .../dialects/firebird/kinterbasdb.pyi | 4 +- .../sqlalchemy/dialects/mssql/base.pyi | 32 +-- .../sqlalchemy/dialects/mssql/mxodbc.pyi | 2 +- .../sqlalchemy/dialects/mssql/pyodbc.pyi | 4 +- .../sqlalchemy/dialects/mysql/aiomysql.pyi | 8 +- .../sqlalchemy/dialects/mysql/asyncmy.pyi | 8 +- .../sqlalchemy/dialects/mysql/base.pyi | 46 ++-- .../dialects/mysql/mariadbconnector.pyi | 4 +- .../sqlalchemy/dialects/mysql/mysqldb.pyi | 4 +- .../sqlalchemy/dialects/mysql/oursql.pyi | 16 +- .../sqlalchemy/dialects/mysql/pymysql.pyi | 2 +- .../sqlalchemy/dialects/mysql/types.pyi | 58 ++--- .../sqlalchemy/dialects/oracle/base.pyi | 48 ++-- .../sqlalchemy/dialects/oracle/cx_oracle.pyi | 18 +- .../sqlalchemy/dialects/postgresql/array.pyi | 4 +- .../dialects/postgresql/asyncpg.pyi | 10 +- .../sqlalchemy/dialects/postgresql/base.pyi | 74 +++--- .../sqlalchemy/dialects/postgresql/dml.pyi | 30 ++- .../sqlalchemy/dialects/postgresql/ext.pyi | 2 +- .../sqlalchemy/dialects/postgresql/hstore.pyi | 2 +- .../sqlalchemy/dialects/postgresql/json.pyi | 2 +- .../sqlalchemy/dialects/postgresql/pg8000.pyi | 12 +- .../dialects/postgresql/psycopg2.pyi | 16 +- .../sqlalchemy/dialects/sqlite/aiosqlite.pyi | 8 +- .../sqlalchemy/dialects/sqlite/base.pyi | 36 +-- .../sqlalchemy/dialects/sqlite/dml.pyi | 20 +- .../sqlalchemy/dialects/sybase/base.pyi | 20 +- .../sqlalchemy/dialects/sybase/pysybase.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/engine/base.pyi | 48 ++-- stubs/SQLAlchemy/sqlalchemy/engine/create.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi | 24 +- .../SQLAlchemy/sqlalchemy/engine/default.pyi | 32 +-- .../sqlalchemy/engine/interfaces.pyi | 42 ++-- .../sqlalchemy/engine/reflection.pyi | 32 +-- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 42 ++-- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 32 +-- stubs/SQLAlchemy/sqlalchemy/event/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/event/registry.pyi | 9 +- stubs/SQLAlchemy/sqlalchemy/exc.pyi | 26 +-- .../sqlalchemy/ext/associationproxy.pyi | 28 +-- .../sqlalchemy/ext/asyncio/base.pyi | 2 +- .../sqlalchemy/ext/asyncio/engine.pyi | 24 +- .../sqlalchemy/ext/asyncio/result.pyi | 20 +- .../sqlalchemy/ext/asyncio/scoping.pyi | 34 +-- .../sqlalchemy/ext/asyncio/session.pyi | 40 ++-- stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi | 20 +- stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi | 6 +- .../sqlalchemy/ext/horizontal_shard.pyi | 8 +- stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi | 2 +- .../sqlalchemy/ext/instrumentation.pyi | 6 +- .../sqlalchemy/ext/orderinglist.pyi | 6 +- .../SQLAlchemy/sqlalchemy/ext/serializer.pyi | 8 +- stubs/SQLAlchemy/sqlalchemy/future/engine.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/inspection.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/attributes.pyi | 72 +++--- stubs/SQLAlchemy/sqlalchemy/orm/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/clsregistry.pyi | 4 +- .../SQLAlchemy/sqlalchemy/orm/collections.pyi | 18 +- stubs/SQLAlchemy/sqlalchemy/orm/context.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 42 ++-- stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi | 2 +- .../sqlalchemy/orm/descriptor_props.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi | 18 +- stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi | 4 +- .../sqlalchemy/orm/instrumentation.pyi | 24 +- .../SQLAlchemy/sqlalchemy/orm/interfaces.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi | 26 +-- stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi | 62 +++--- .../sqlalchemy/orm/path_registry.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/persistence.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 29 ++- .../sqlalchemy/orm/relationships.pyi | 106 ++++----- stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi | 60 ++--- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 104 ++++----- .../SQLAlchemy/sqlalchemy/orm/strategies.pyi | 14 +- .../sqlalchemy/orm/strategy_options.pyi | 12 +- .../SQLAlchemy/sqlalchemy/orm/unitofwork.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/util.pyi | 89 ++++---- stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 24 +- stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/processors.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 186 ++++++++-------- stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi | 56 ++--- stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi | 40 ++-- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 108 ++++----- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 22 +- stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi | 30 +-- stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi | 62 +++--- stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi | 210 +++++++++--------- .../SQLAlchemy/sqlalchemy/sql/selectable.pyi | 114 +++++----- stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi | 70 +++--- .../SQLAlchemy/sqlalchemy/sql/traversals.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/util.pyi | 52 ++--- stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi | 2 +- .../sqlalchemy/testing/assertions.pyi | 76 +++---- .../sqlalchemy/testing/assertsql.pyi | 6 +- .../SQLAlchemy/sqlalchemy/testing/engines.pyi | 30 +-- .../sqlalchemy/testing/exclusions.pyi | 30 +-- .../sqlalchemy/testing/profiling.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/testing/util.pyi | 8 +- .../sqlalchemy/testing/warnings.pyi | 2 +- .../sqlalchemy/util/_collections.pyi | 22 +- .../sqlalchemy/util/_concurrency_py3k.pyi | 2 +- .../SQLAlchemy/sqlalchemy/util/_preloaded.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 20 +- .../sqlalchemy/util/deprecations.pyi | 22 +- .../sqlalchemy/util/langhelpers.pyi | 48 ++-- stubs/SQLAlchemy/sqlalchemy/util/queue.pyi | 12 +- .../sqlalchemy/util/topological.pyi | 2 +- 122 files changed, 1569 insertions(+), 1516 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi b/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi index 9883315dce8d..1a1a3006afc3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi @@ -13,7 +13,7 @@ class immutabledict(dict[_KT, _VT], Generic[_KT, _VT]): @overload def union(self, __dict: dict[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... @overload - def union(self, __dict: None = ..., **kw: SupportsKeysAndGetItem[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... + def union(self, __dict: None = None, **kw: SupportsKeysAndGetItem[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... def merge_with( self, *args: SupportsKeysAndGetItem[_KT | _KT2, _VT2] | Iterable[tuple[_KT2, _VT2]] | None ) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi index 350b3df4aa52..3bf803352a7f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi @@ -13,5 +13,5 @@ class MxODBCConnector(Connector): def on_connect(self): ... def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi index b0b7ce25d32e..7210734f90c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi @@ -13,7 +13,7 @@ class PyODBCConnector(Connector): default_paramstyle: str use_setinputsizes: bool pyodbc_driver_name: Any - def __init__(self, supports_unicode_binds: Incomplete | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ... + def __init__(self, supports_unicode_binds: Incomplete | None = None, use_setinputsizes: bool = False, **kw) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi index 564282e8ec1a..a0d8dd01b5d2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi @@ -22,15 +22,15 @@ RESERVED_WORDS: Any class _StringType(sqltypes.String): charset: Any - def __init__(self, charset: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, charset: Incomplete | None = None, **kw) -> None: ... class VARCHAR(_StringType, sqltypes.VARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class CHAR(_StringType, sqltypes.CHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class _FBDateTime(sqltypes.DateTime): def bind_processor(self, dialect): ... @@ -52,7 +52,7 @@ class FBCompiler(sql.compiler.SQLCompiler): def visit_startswith_op_binary(self, binary, operator, **kw): ... def visit_not_startswith_op_binary(self, binary, operator, **kw): ... def visit_mod_binary(self, binary, operator, **kw): ... - def visit_alias(self, alias, asfrom: bool = ..., **kwargs): ... # type: ignore[override] + def visit_alias(self, alias, asfrom: bool = False, **kwargs): ... # type: ignore[override] def visit_substring_func(self, func, **kw): ... def visit_length_func(self, function, **kw): ... visit_char_length_func: Any @@ -97,13 +97,13 @@ class FBDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... implicit_returning: Any def initialize(self, connection) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi index 4bc56c5a6659..c2c7a025a351 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi @@ -2,7 +2,7 @@ from .kinterbasdb import FBDialect_kinterbasdb class FBDialect_fdb(FBDialect_kinterbasdb): supports_statement_cache: bool - def __init__(self, enable_rowcount: bool = ..., retaining: bool = ..., **kwargs) -> None: ... + def __init__(self, enable_rowcount: bool = True, retaining: bool = False, **kwargs) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi index 09d3dabd6262..7f957f3ceb5e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi @@ -26,11 +26,11 @@ class FBDialect_kinterbasdb(FBDialect): concurrency_level: Any retaining: Any def __init__( - self, type_conv: int = ..., concurrency_level: int = ..., enable_rowcount: bool = ..., retaining: bool = ..., **kwargs + self, type_conv: int = 200, concurrency_level: int = 1, enable_rowcount: bool = True, retaining: bool = False, **kwargs ) -> None: ... @classmethod def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... def create_connect_args(self, url): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 59d9d16fbc12..2e0acfccc1e8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -47,7 +47,7 @@ class _MSDate(sqltypes.Date): class TIME(sqltypes.TIME): precision: Any - def __init__(self, precision: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, precision: Incomplete | None = None, **kwargs) -> None: ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -67,12 +67,12 @@ class SMALLDATETIME(_DateTimeBase, sqltypes.DateTime): class DATETIME2(_DateTimeBase, sqltypes.DateTime): __visit_name__: str precision: Any - def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, precision: Incomplete | None = None, **kw) -> None: ... class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime): __visit_name__: str precision: Any - def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, precision: Incomplete | None = None, **kw) -> None: ... class _UnicodeLiteral: def literal_processor(self, dialect): ... @@ -84,7 +84,7 @@ class TIMESTAMP(sqltypes._Binary): __visit_name__: str length: Any convert_int: Any - def __init__(self, convert_int: bool = ...) -> None: ... + def __init__(self, convert_int: bool = False) -> None: ... def result_processor(self, dialect, coltype): ... class ROWVERSION(TIMESTAMP): @@ -101,7 +101,7 @@ class VARBINARY(sqltypes.VARBINARY, sqltypes.LargeBinary): @overload def __init__(self, *, filestream: Literal[True]) -> None: ... @overload - def __init__(self, length: Incomplete | None = ..., filestream: Literal[False] = ...) -> None: ... + def __init__(self, length: Incomplete | None = None, filestream: Literal[False] = False) -> None: ... class IMAGE(sqltypes.LargeBinary): __visit_name__: str @@ -250,7 +250,7 @@ class MSSQLStrictCompiler(MSSQLCompiler): class MSDDLCompiler(compiler.DDLCompiler): def get_column_specification(self, column, **kwargs): ... - def visit_create_index(self, create, include_schema: bool = ...): ... # type: ignore[override] + def visit_create_index(self, create, include_schema: bool = False): ... # type: ignore[override] def visit_drop_index(self, drop): ... def visit_primary_key_constraint(self, constraint): ... def visit_unique_constraint(self, constraint): ... @@ -261,7 +261,7 @@ class MSDDLCompiler(compiler.DDLCompiler): class MSIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any def __init__(self, dialect) -> None: ... - def quote_schema(self, schema, force: Incomplete | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = None): ... class MSDialect(default.DefaultDialect): name: str @@ -295,15 +295,15 @@ class MSDialect(default.DefaultDialect): isolation_level: Any def __init__( self, - query_timeout: Incomplete | None = ..., - use_scope_identity: bool = ..., - schema_name: str = ..., - isolation_level: Incomplete | None = ..., - deprecate_large_types: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - legacy_schema_aliasing: Incomplete | None = ..., - ignore_no_transaction_on_rollback: bool = ..., + query_timeout: Incomplete | None = None, + use_scope_identity: bool = True, + schema_name: str = "dbo", + isolation_level: Incomplete | None = None, + deprecate_large_types: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + legacy_schema_aliasing: Incomplete | None = None, + ignore_no_transaction_on_rollback: bool = False, **opts, ) -> None: ... def do_savepoint(self, connection, name) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi index ee58d3dec742..2f0a14ffaab6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi @@ -22,6 +22,6 @@ class MSDialect_mxodbc(MxODBCConnector, MSDialect): supports_statement_cache: bool colspecs: Any description_encoding: Any - def __init__(self, description_encoding: Incomplete | None = ..., **params) -> None: ... + def __init__(self, description_encoding: Incomplete | None = None, **params) -> None: ... dialect = MSDialect_mxodbc diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi index 0ee156b64f52..50d53b123f38 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi @@ -37,9 +37,9 @@ class MSDialect_pyodbc(PyODBCConnector, MSDialect): description_encoding: Any use_scope_identity: Any fast_executemany: Any - def __init__(self, description_encoding: Incomplete | None = ..., fast_executemany: bool = ..., **params) -> None: ... + def __init__(self, description_encoding: Incomplete | None = None, fast_executemany: bool = False, **params) -> None: ... def on_connect(self): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor): ... dialect = MSDialect_pyodbc diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi index 3dc245d014bb..a91b28976d81 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi @@ -19,12 +19,12 @@ class AsyncAdapt_aiomysql_cursor: @property def lastrowid(self): ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...): ... + def execute(self, operation, parameters: Incomplete | None = None): ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): @@ -33,7 +33,7 @@ class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiomysql_connection(AdaptedConnection): @@ -43,7 +43,7 @@ class AsyncAdapt_aiomysql_connection(AdaptedConnection): def ping(self, reconnect): ... def character_set_name(self): ... def autocommit(self, value) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi index 69a9d5576155..16180d5820d1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi @@ -19,12 +19,12 @@ class AsyncAdapt_asyncmy_cursor: @property def lastrowid(self): ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...): ... + def execute(self, operation, parameters: Incomplete | None = None): ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): @@ -33,7 +33,7 @@ class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_asyncmy_connection(AdaptedConnection): @@ -43,7 +43,7 @@ class AsyncAdapt_asyncmy_connection(AdaptedConnection): def ping(self, reconnect): ... def character_set_name(self): ... def autocommit(self, value) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi index 129de51ebaf6..8a36027eb101 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi @@ -89,13 +89,13 @@ class MySQLCompiler(compiler.SQLCompiler): def visit_mysql_match(self, element, **kw): ... def visit_match_op_binary(self, binary, operator, **kw): ... def get_from_hint_text(self, table, text): ... - def visit_typeclause(self, typeclause, type_: Incomplete | None = ..., **kw): ... + def visit_typeclause(self, typeclause, type_: Incomplete | None = None, **kw): ... def visit_cast(self, cast, **kw): ... def render_literal_value(self, value, type_): ... def visit_true(self, element, **kw): ... def visit_false(self, element, **kw): ... def get_select_precolumns(self, select, **kw): ... - def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ... + def visit_join(self, join, asfrom: bool = False, from_linter: Incomplete | None = None, **kwargs): ... def for_update_clause(self, select, **kw): ... def limit_clause(self, select, **kw): ... def update_limit_clause(self, update_stmt): ... @@ -161,7 +161,7 @@ class MySQLTypeCompiler(compiler.GenericTypeCompiler): class MySQLIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any - def __init__(self, dialect, server_ansiquotes: bool = ..., **kw) -> None: ... + def __init__(self, dialect, server_ansiquotes: bool = False, **kw) -> None: ... class MariaDBIdentifierPreparer(MySQLIdentifierPreparer): reserved_words: Any @@ -199,10 +199,10 @@ class MySQLDialect(default.DefaultDialect): isolation_level: Any def __init__( self, - isolation_level: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - is_mariadb: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + is_mariadb: Incomplete | None = None, **kwargs, ) -> None: ... def on_connect(self): ... @@ -210,27 +210,27 @@ class MySQLDialect(default.DefaultDialect): def get_isolation_level(self, connection): ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection): ... def is_disconnect(self, e, connection, cursor): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... identifier_preparer: Any def initialize(self, connection) -> None: ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... class _DecodingRow: rowproxy: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi index 0735fb75a28e..b4ab06a53fea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi @@ -30,7 +30,7 @@ class MySQLDialect_mariadbconnector(MySQLDialect): def create_connect_args(self, url): ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... dialect = MySQLDialect_mariadbconnector diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi index a8479ad8bf33..8daaf59a611f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi @@ -27,7 +27,7 @@ class MySQLDialect_mysqldb(MySQLDialect): def dbapi(cls): ... def on_connect(self): ... def do_ping(self, dbapi_connection): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def create_connect_args(self, url, _translate_args: Incomplete | None = None): ... dialect = MySQLDialect_mysqldb diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi index 1bc65d97b235..fa7ea6fbe59d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi @@ -21,17 +21,17 @@ class MySQLDialect_oursql(MySQLDialect): colspecs: Any @classmethod def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def do_begin(self, connection) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... def initialize(self, connection): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi index fa7a490882a7..f91c2119fcb7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi @@ -14,7 +14,7 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): def supports_server_side_cursors(self): ... @classmethod def dbapi(cls): ... - def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... + def create_connect_args(self, url, _translate_args: Incomplete | None = None): ... def is_disconnect(self, e, connection, cursor): ... dialect = MySQLDialect_pymysql diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index 5db2c9257995..80e81e150e0f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -6,17 +6,17 @@ import sqlalchemy.types as sqltypes class _NumericType: unsigned: Any zerofill: Any - def __init__(self, unsigned: bool = ..., zerofill: bool = ..., **kw) -> None: ... + def __init__(self, unsigned: bool = False, zerofill: bool = False, **kw) -> None: ... class _FloatType(_NumericType, sqltypes.Float): scale: Any def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class _IntegerType(_NumericType, sqltypes.Integer): display_width: Any - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class _StringType(sqltypes.String): charset: Any @@ -26,12 +26,12 @@ class _StringType(sqltypes.String): national: Any def __init__( self, - charset: Incomplete | None = ..., - collation: Incomplete | None = ..., - ascii: bool = ..., - binary: bool = ..., - unicode: bool = ..., - national: bool = ..., + charset: Incomplete | None = None, + collation: Incomplete | None = None, + ascii: bool = False, + binary: bool = False, + unicode: bool = False, + national: bool = False, **kw, ) -> None: ... @@ -41,84 +41,84 @@ class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore[misc] # i class NUMERIC(_NumericType, sqltypes.NUMERIC): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class DECIMAL(_NumericType, sqltypes.DECIMAL): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class DOUBLE(_FloatType): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class REAL(_FloatType, sqltypes.REAL): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class FLOAT(_FloatType, sqltypes.FLOAT): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = False, **kw ) -> None: ... def bind_processor(self, dialect) -> None: ... class INTEGER(_IntegerType, sqltypes.INTEGER): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class BIGINT(_IntegerType, sqltypes.BIGINT): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class MEDIUMINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class TINYINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class SMALLINT(_IntegerType, sqltypes.SMALLINT): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... def result_processor(self, dialect, coltype): ... class TIME(sqltypes.TIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... def result_processor(self, dialect, coltype): ... class TIMESTAMP(sqltypes.TIMESTAMP): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... class DATETIME(sqltypes.DATETIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... class YEAR(sqltypes.TypeEngine): __visit_name__: str display_width: Any - def __init__(self, display_width: Incomplete | None = ...) -> None: ... + def __init__(self, display_width: Incomplete | None = None) -> None: ... class TEXT(_StringType, sqltypes.TEXT): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, length: Incomplete | None = None, **kw) -> None: ... class TINYTEXT(_StringType): __visit_name__: str @@ -134,19 +134,19 @@ class LONGTEXT(_StringType): class VARCHAR(_StringType, sqltypes.VARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class CHAR(_StringType, sqltypes.CHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class NVARCHAR(_StringType, sqltypes.NVARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class NCHAR(_StringType, sqltypes.NCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class TINYBLOB(sqltypes._Binary): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi index 9b41e88b2f2e..cd2bdf53f841 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi @@ -36,7 +36,7 @@ NVARCHAR2 = NVARCHAR class NUMBER(sqltypes.Numeric, sqltypes.Integer): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: Incomplete | None = ... + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: Incomplete | None = None ) -> None: ... def adapt(self, impltype): ... @@ -62,8 +62,8 @@ class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str day_precision: Any second_precision: Any - def __init__(self, day_precision: Incomplete | None = ..., second_precision: Incomplete | None = ...) -> None: ... - def as_generic(self, allow_nulltype: bool = ...): ... + def __init__(self, day_precision: Incomplete | None = None, second_precision: Incomplete | None = None) -> None: ... + def as_generic(self, allow_nulltype: bool = False): ... def coerce_compared_value(self, op, value): ... class ROWID(sqltypes.TypeEngine): @@ -115,7 +115,7 @@ class OracleCompiler(compiler.SQLCompiler): def visit_function(self, func, **kw): ... def visit_table_valued_column(self, element, **kw): ... def default_from(self): ... - def visit_join(self, join, from_linter: Incomplete | None = ..., **kwargs): ... # type: ignore[override] + def visit_join(self, join, from_linter: Incomplete | None = None, **kwargs): ... # type: ignore[override] def visit_outer_join_column(self, vc, **kw): ... def visit_sequence(self, seq, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... @@ -180,11 +180,11 @@ class OracleDialect(default.DefaultDialect): exclude_tablespaces: Any def __init__( self, - use_ansi: bool = ..., - optimize_limits: bool = ..., - use_binds_for_limits: Incomplete | None = ..., - use_nchar_for_unicode: bool = ..., - exclude_tablespaces=..., + use_ansi: bool = True, + optimize_limits: bool = False, + use_binds_for_limits: Incomplete | None = None, + use_nchar_for_unicode: bool = False, + exclude_tablespaces=("SYSTEM", "SYSAUX"), **kwargs, ) -> None: ... implicit_returning: Any @@ -193,28 +193,30 @@ class OracleDialect(default.DefaultDialect): def get_isolation_level(self, connection) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def set_isolation_level(self, connection, level) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_temp_table_names(self, connection, **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_table_comment( - self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw ): ... def get_indexes( - self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw ): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_view_definition( - self, connection, view_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, view_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw + ): ... + def get_check_constraints( + self, connection, table_name, schema: Incomplete | None = None, include_all: bool = False, **kw ): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., include_all: bool = ..., **kw): ... class _OuterJoinColumn(ClauseElement): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi index 3484c83e073d..1b755370b817 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi @@ -100,12 +100,12 @@ class OracleDialect_cx_oracle(OracleDialect): cx_oracle_ver: Any def __init__( self, - auto_convert_lobs: bool = ..., - coerce_to_unicode: bool = ..., - coerce_to_decimal: bool = ..., - arraysize: int = ..., - encoding_errors: Incomplete | None = ..., - threaded: Incomplete | None = ..., + auto_convert_lobs: bool = True, + coerce_to_unicode: bool = True, + coerce_to_decimal: bool = True, + arraysize: int = 50, + encoding_errors: Incomplete | None = None, + threaded: Incomplete | None = None, **kwargs, ): ... @classmethod @@ -117,11 +117,11 @@ class OracleDialect_cx_oracle(OracleDialect): def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... def create_xid(self): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... def do_recover_twophase(self, connection) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi index fe7c0e8bcb1d..834619c956c2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi @@ -14,7 +14,7 @@ class array(expression.ClauseList, expression.ColumnElement[_Any]): inherit_cache: bool type: _Any def __init__(self, clauses, **kw) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... CONTAINS: _Any CONTAINED_BY: _Any @@ -31,7 +31,7 @@ class ARRAY(sqltypes.ARRAY): dimensions: _Any zero_indexes: _Any def __init__( - self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + self, item_type, as_tuple: bool = False, dimensions: Incomplete | None = None, zero_indexes: bool = False ) -> None: ... @property def hashable(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi index dfe48e376662..a2894f2dc208 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -87,12 +87,12 @@ class AsyncAdapt_asyncpg_cursor: rowcount: int def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = None) -> None: ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): @@ -102,7 +102,7 @@ class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): def __aiter__(self): ... async def __anext__(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... def executemany(self, operation, seq_of_parameters) -> None: ... @@ -112,13 +112,13 @@ class AsyncAdapt_asyncpg_connection(AdaptedConnection): isolation_level: str readonly: bool deferrable: bool - def __init__(self, dbapi, connection, prepared_statement_cache_size: int = ...) -> None: ... + def __init__(self, dbapi, connection, prepared_statement_cache_size: int = 100) -> None: ... @property def autocommit(self): ... @autocommit.setter def autocommit(self, value) -> None: ... def set_isolation_level(self, level) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index 683ada3fc5fb..1a04cd3d0b52 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -60,21 +60,21 @@ class REGCLASS(sqltypes.TypeEngine): class TIMESTAMP(sqltypes.TIMESTAMP): precision: Any - def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, precision: Incomplete | None = None) -> None: ... class TIME(sqltypes.TIME): precision: Any - def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, precision: Incomplete | None = None) -> None: ... class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str native: bool precision: Any fields: Any - def __init__(self, precision: Incomplete | None = ..., fields: Incomplete | None = ...) -> None: ... + def __init__(self, precision: Incomplete | None = None, fields: Incomplete | None = None) -> None: ... @classmethod def adapt_emulated_to_native(cls, interval, **kw): ... - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... @property def python_type(self): ... def coerce_compared_value(self, op, value): ... @@ -85,14 +85,14 @@ class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any varying: Any - def __init__(self, length: Incomplete | None = ..., varying: bool = ...) -> None: ... + def __init__(self, length: Incomplete | None = None, varying: bool = False) -> None: ... PGBit = BIT class UUID(sqltypes.TypeEngine): __visit_name__: str as_uuid: Any - def __init__(self, as_uuid: bool = ...) -> None: ... + def __init__(self, as_uuid: bool = False) -> None: ... def coerce_compared_value(self, op, value): ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -108,17 +108,17 @@ class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore[misc] # def __init__(self, *enums, **kw) -> None: ... @classmethod def adapt_emulated_to_native(cls, impl, **kw): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... class EnumGenerator(DDLBase): checkfirst: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... class EnumDropper(DDLBase): checkfirst: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... class _ColonCast(elements.Cast): @@ -135,8 +135,8 @@ class PGCompiler(compiler.SQLCompiler): def visit_colon_cast(self, element, **kw): ... def visit_array(self, element, **kw): ... def visit_slice(self, element, **kw): ... - def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... - def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = False, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = False, **kw): ... def visit_getitem_binary(self, binary, operator, **kw): ... def visit_aggregate_order_by(self, element, **kw): ... def visit_match_op_binary(self, binary, operator, **kw): ... @@ -196,7 +196,7 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_TSTZRANGE(self, type_, **kw): ... def visit_datetime(self, type_, **kw): ... def visit_enum(self, type_, **kw): ... - def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = ..., **kw): ... + def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = None, **kw): ... def visit_TIMESTAMP(self, type_, **kw): ... def visit_TIME(self, type_, **kw): ... def visit_INTERVAL(self, type_, **kw): ... @@ -208,13 +208,13 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): class PGIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any - def format_type(self, type_, use_schema: bool = ...): ... + def format_type(self, type_, use_schema: bool = True): ... class PGInspector(reflection.Inspector): - def get_table_oid(self, table_name, schema: Incomplete | None = ...): ... - def get_enums(self, schema: Incomplete | None = ...): ... - def get_foreign_table_names(self, schema: Incomplete | None = ...): ... - def get_view_names(self, schema: Incomplete | None = ..., include=...): ... + def get_table_oid(self, table_name, schema: Incomplete | None = None): ... + def get_enums(self, schema: Incomplete | None = None): ... + def get_foreign_table_names(self, schema: Incomplete | None = None): ... + def get_view_names(self, schema: Incomplete | None = None, include=("plain", "materialized")): ... class CreateEnumType(_CreateDropBase): __visit_name__: str @@ -274,9 +274,9 @@ class PGDialect(default.DefaultDialect): reflection_options: Any def __init__( self, - isolation_level: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... @@ -289,25 +289,25 @@ class PGDialect(default.DefaultDialect): def get_deferrable(self, connection) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection): ... def has_schema(self, connection, schema): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_type(self, connection, type_name, schema: Incomplete | None = ...): ... - def get_table_oid(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_type(self, connection, type_name, schema: Incomplete | None = None): ... + def get_table_oid(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., include=..., **kw): ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, include=("plain", "materialized"), **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_foreign_keys( - self, connection, table_name, schema: Incomplete | None = ..., postgresql_ignore_search_path: bool = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, postgresql_ignore_search_path: bool = False, **kw ): ... def get_indexes(self, connection, table_name, schema, **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi index 9ddcfcce27dd..3a59fcef649c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi @@ -12,14 +12,17 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - constraint: Incomplete | None = ..., - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... def on_conflict_do_nothing( - self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + self, + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, ) -> None: ... insert: Any @@ -30,7 +33,10 @@ class OnConflictClause(ClauseElement): inferred_target_elements: Any inferred_target_whereclause: Any def __init__( - self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + self, + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, ) -> None: ... class OnConflictDoNothing(OnConflictClause): @@ -42,9 +48,9 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - constraint: Incomplete | None = ..., - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi index c9e682f0cf83..834e86264141 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi @@ -11,7 +11,7 @@ class aggregate_order_by(expression.ColumnElement[Any]): type: Any order_by: Any def __init__(self, target, *order_by) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def get_children(self, **kwargs): ... class ExcludeConstraint(ColumnCollectionConstraint): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi index 3f37cdef1ac2..afb34111704a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -9,7 +9,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): __visit_name__: str hashable: bool text_type: Any - def __init__(self, text_type: Incomplete | None = ...) -> None: ... + def __init__(self, text_type: Incomplete | None = None) -> None: ... class Comparator(sqltypes.Indexable.Comparator[Any], sqltypes.Concatenable.Comparator[Any]): def has_key(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi index 728842b883ea..7898fd46f203 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -9,7 +9,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType): class JSON(sqltypes.JSON): astext_type: Any - def __init__(self, none_as_null: bool = ..., astext_type: Incomplete | None = ...) -> None: ... + def __init__(self, none_as_null: bool = False, astext_type: Incomplete | None = None) -> None: ... class Comparator(sqltypes.JSON.Comparator): @property diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi index d87f2c0b5725..dd8b31441599 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi @@ -84,14 +84,14 @@ class ServerSideCursor: def rowcount(self): ... @property def description(self): ... - def execute(self, operation, args=..., stream: Incomplete | None = ...): ... + def execute(self, operation, args=(), stream: Incomplete | None = None): ... def executemany(self, operation, param_sets): ... def fetchone(self): ... - def fetchmany(self, num: Incomplete | None = ...): ... + def fetchmany(self, num: Incomplete | None = None): ... def fetchall(self): ... def close(self) -> None: ... def setinputsizes(self, *sizes) -> None: ... - def setoutputsize(self, size, column: Incomplete | None = ...) -> None: ... + def setoutputsize(self, size, column: Incomplete | None = None) -> None: ... class PGCompiler_pg8000(PGCompiler): def visit_mod_binary(self, binary, operator, **kw): ... @@ -113,7 +113,7 @@ class PGDialect_pg8000(PGDialect): description_encoding: Any colspecs: Any client_encoding: Any - def __init__(self, client_encoding: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, client_encoding: Incomplete | None = None, **kwargs) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... @@ -127,8 +127,8 @@ class PGDialect_pg8000(PGDialect): def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection): ... def on_connect(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi index e94fb3e02e4b..a64d86f6d415 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi @@ -70,13 +70,13 @@ class PGDialect_psycopg2(PGDialect): executemany_values_page_size: Any def __init__( self, - use_native_unicode: bool = ..., - client_encoding: Incomplete | None = ..., - use_native_hstore: bool = ..., - use_native_uuid: bool = ..., - executemany_mode: str = ..., - executemany_batch_page_size: int = ..., - executemany_values_page_size: int = ..., + use_native_unicode: bool = True, + client_encoding: Incomplete | None = None, + use_native_hstore: bool = True, + use_native_uuid: bool = True, + executemany_mode: str = "values_only", + executemany_batch_page_size: int = 100, + executemany_values_page_size: int = 1000, **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... @@ -89,7 +89,7 @@ class PGDialect_psycopg2(PGDialect): def get_deferrable(self, connection): ... def do_ping(self, dbapi_connection): ... def on_connect(self): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi index 8d48580c102a..a4c15cb91385 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi @@ -14,12 +14,12 @@ class AsyncAdapt_aiosqlite_cursor: def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... lastrowid: int - def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = None) -> None: ... def executemany(self, operation, seq_of_parameters) -> None: ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): @@ -27,7 +27,7 @@ class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): def __init__(self, *arg, **kw) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiosqlite_connection(AdaptedConnection): @@ -39,7 +39,7 @@ class AsyncAdapt_aiosqlite_connection(AdaptedConnection): @isolation_level.setter def isolation_level(self, value) -> None: ... def create_function(self, *args, **kw) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def execute(self, *args, **kw): ... def rollback(self) -> None: ... def commit(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi index bb7d0c25efd7..3ade0d400569 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi @@ -25,7 +25,7 @@ class _SQliteJson(JSON): def result_processor(self, dialect, coltype): ... class _DateTimeMixin: - def __init__(self, storage_format: Incomplete | None = ..., regexp: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, storage_format: Incomplete | None = None, regexp: Incomplete | None = None, **kw) -> None: ... @property def format_is_text_affinity(self): ... def adapt(self, cls, **kw): ... @@ -78,7 +78,7 @@ class SQLiteDDLCompiler(compiler.DDLCompiler): def visit_column_check_constraint(self, constraint): ... def visit_foreign_key_constraint(self, constraint): ... def define_constraint_remote_table(self, constraint, table, preparer): ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ...): ... # type: ignore[override] + def visit_create_index(self, create, include_schema: bool = False, include_table_schema: bool = True): ... # type: ignore[override] def post_create_table(self, table): ... class SQLiteTypeCompiler(compiler.GenericTypeCompiler): @@ -117,27 +117,27 @@ class SQLiteDialect(default.DefaultDialect): native_datetime: Any def __init__( self, - isolation_level: Incomplete | None = ..., - native_datetime: bool = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - _json_serializer: Incomplete | None = ..., - _json_deserializer: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + native_datetime: bool = False, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + _json_serializer: Incomplete | None = None, + _json_deserializer: Incomplete | None = None, **kwargs, ) -> None: ... def set_isolation_level(self, connection, level) -> None: ... def get_isolation_level(self, connection): ... def on_connect(self): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_temp_table_names(self, connection, **kw): ... def get_temp_view_names(self, connection, **kw): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi index da20b23ada4c..cfd505042a58 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi @@ -12,12 +12,12 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... - def on_conflict_do_nothing(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... + def on_conflict_do_nothing(self, index_elements: Incomplete | None = None, index_where: Incomplete | None = None) -> None: ... insert: Any @@ -26,7 +26,7 @@ class OnConflictClause(ClauseElement): constraint_target: Any inferred_target_elements: Any inferred_target_whereclause: Any - def __init__(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... + def __init__(self, index_elements: Incomplete | None = None, index_where: Incomplete | None = None) -> None: ... class OnConflictDoNothing(OnConflictClause): __visit_name__: str @@ -37,8 +37,8 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi index f6a90151b558..cb1e7c17c800 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi @@ -77,7 +77,7 @@ ischema_names: Any class SybaseInspector(reflection.Inspector): def __init__(self, conn) -> None: ... - def get_table_id(self, table_name, schema: Incomplete | None = ...): ... + def get_table_id(self, table_name, schema: Incomplete | None = None): ... class SybaseExecutionContext(default.DefaultExecutionContext): def set_ddl_autocommit(self, connection, value) -> None: ... @@ -124,13 +124,13 @@ class SybaseDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... max_identifier_length: int def initialize(self, connection) -> None: ... - def get_table_id(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_id(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi index d0a7a81aa869..e88d8e6cef88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi @@ -22,7 +22,7 @@ class SybaseDialect_pysybase(SybaseDialect): @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor): ... dialect = SybaseDialect_pysybase diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index 9d7376520a9f..2b69e99d3378 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -31,13 +31,13 @@ class Connection(Connectable): def __init__( self, engine: Engine, - connection: DBAPIConnection | None = ..., - close_with_result: bool = ..., - _branch_from: Incomplete | None = ..., - _execution_options: Incomplete | None = ..., - _dispatch: Incomplete | None = ..., - _has_events: Incomplete | None = ..., - _allow_revalidate: bool = ..., + connection: DBAPIConnection | None = None, + close_with_result: bool = False, + _branch_from: Incomplete | None = None, + _execution_options: Incomplete | None = None, + _dispatch: Incomplete | None = None, + _has_events: Incomplete | None = None, + _allow_revalidate: bool = True, ) -> None: ... def schema_for_object(self, obj) -> str | None: ... def __enter__(self) -> Self: ... @@ -57,15 +57,15 @@ class Connection(Connectable): def default_isolation_level(self): ... @property def info(self): ... - def connect(self, close_with_result: bool = ...): ... # type: ignore[override] - def invalidate(self, exception: Exception | None = ...) -> None: ... + def connect(self, close_with_result: bool = False): ... # type: ignore[override] + def invalidate(self, exception: Exception | None = None) -> None: ... def detach(self) -> None: ... def begin(self) -> Transaction: ... def begin_nested(self) -> Transaction | None: ... - def begin_twophase(self, xid: Incomplete | None = ...) -> TwoPhaseTransaction: ... + def begin_twophase(self, xid: Incomplete | None = None) -> TwoPhaseTransaction: ... def recover_twophase(self): ... - def rollback_prepared(self, xid, recover: bool = ...) -> None: ... - def commit_prepared(self, xid, recover: bool = ...) -> None: ... + def rollback_prepared(self, xid, recover: bool = False) -> None: ... + def commit_prepared(self, xid, recover: bool = False) -> None: ... def in_transaction(self) -> bool: ... def in_nested_transaction(self) -> bool: ... def get_transaction(self) -> Transaction | None: ... @@ -81,7 +81,7 @@ class Connection(Connectable): @overload def execute(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params) -> CursorResult: ... def exec_driver_sql( - self, statement: str, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ... + self, statement: str, parameters: Incomplete | None = None, execution_options: Incomplete | None = None ): ... def transaction(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... def run_callable(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... @@ -156,11 +156,11 @@ class Engine(Connectable, Identified): pool: Pool, dialect: Dialect, url: str | URL, - logging_name: str | None = ..., - echo: _EchoFlag = ..., - query_cache_size: int = ..., - execution_options: Mapping[str, Any] | None = ..., - hide_parameters: bool = ..., + logging_name: str | None = None, + echo: _EchoFlag = None, + query_cache_size: int = 500, + execution_options: Mapping[str, Any] | None = None, + hide_parameters: bool = False, ) -> None: ... @property def engine(self) -> Engine: ... @@ -172,7 +172,7 @@ class Engine(Connectable, Identified): def name(self) -> str: ... @property def driver(self): ... - def dispose(self, close: bool = ...) -> None: ... + def dispose(self, close: bool = True) -> None: ... class _trans_ctx: conn: Connection @@ -184,7 +184,7 @@ class Engine(Connectable, Identified): self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def begin(self, close_with_result: bool = ...) -> _trans_ctx: ... + def begin(self, close_with_result: bool = False) -> _trans_ctx: ... def transaction( self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs ) -> _T | None: ... @@ -197,10 +197,10 @@ class Engine(Connectable, Identified): def scalar(self, statement: _Executable, *multiparams: Mapping[str, Any], **params: Any) -> Any: ... @overload def scalar(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params: Any) -> Any: ... - def connect(self, close_with_result: bool = ...) -> Connection: ... # type: ignore[override] - def table_names(self, schema: Incomplete | None = ..., connection: Connection | None = ...): ... - def has_table(self, table_name: str, schema: Incomplete | None = ...) -> bool: ... - def raw_connection(self, _connection: Connection | None = ...) -> DBAPIConnection: ... + def connect(self, close_with_result: bool = False) -> Connection: ... # type: ignore[override] + def table_names(self, schema: Incomplete | None = None, connection: Connection | None = None): ... + def has_table(self, table_name: str, schema: Incomplete | None = None) -> bool: ... + def raw_connection(self, _connection: Connection | None = None) -> DBAPIConnection: ... class OptionEngineMixin: url: URL diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi index 97070a374a09..ae20f2002a80 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi @@ -17,6 +17,6 @@ def create_engine( ) -> FutureEngine: ... @overload def create_engine( - url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = ..., **kwargs + url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = False, **kwargs ) -> Engine: ... -def engine_from_config(configuration: Mapping[str, Any], prefix: str = ..., **kwargs) -> Engine: ... +def engine_from_config(configuration: Mapping[str, Any], prefix: str = "sqlalchemy.", **kwargs) -> Engine: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi index 76d0d369d6f7..7b67eba1f0a8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi @@ -26,16 +26,16 @@ class ResultFetchStrategy: def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...) -> None: ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False) -> None: ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None) -> None: ... def fetchall(self, result) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... class NoCursorFetchStrategy(ResultFetchStrategy): def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class NoCursorDQLFetchStrategy(NoCursorFetchStrategy): ... @@ -46,33 +46,33 @@ class CursorFetchStrategy(ResultFetchStrategy): def hard_close(self, result, dbapi_cursor) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class BufferedRowCursorFetchStrategy(CursorFetchStrategy): def __init__( - self, dbapi_cursor, execution_options, growth_factor: int = ..., initial_buffer: Incomplete | None = ... + self, dbapi_cursor, execution_options, growth_factor: int = 5, initial_buffer: Incomplete | None = None ) -> None: ... @classmethod def create(cls, result): ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class FullyBufferedCursorFetchStrategy(CursorFetchStrategy): alternate_cursor_description: Any def __init__( - self, dbapi_cursor, alternate_description: Incomplete | None = ..., initial_buffer: Incomplete | None = ... + self, dbapi_cursor, alternate_description: Incomplete | None = None, initial_buffer: Incomplete | None = None ) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class _NoResultMetaData(ResultMetaData): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi index fa725cb70d93..e7784485a074 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi @@ -89,17 +89,17 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] compiler_linting: Any def __init__( self, - convert_unicode: bool = ..., - encoding: str = ..., - paramstyle: Incomplete | None = ..., - dbapi: Incomplete | None = ..., - implicit_returning: Incomplete | None = ..., - case_sensitive: bool = ..., - supports_native_boolean: Incomplete | None = ..., - max_identifier_length: Incomplete | None = ..., - label_length: Incomplete | None = ..., - compiler_linting=..., - server_side_cursors: bool = ..., + convert_unicode: bool = False, + encoding: str = "utf-8", + paramstyle: Incomplete | None = None, + dbapi: Incomplete | None = None, + implicit_returning: Incomplete | None = None, + case_sensitive: bool = True, + supports_native_boolean: Incomplete | None = None, + max_identifier_length: Incomplete | None = None, + label_length: Incomplete | None = None, + compiler_linting=0, + server_side_cursors: bool = False, **kwargs, ) -> None: ... @property @@ -116,7 +116,7 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def on_connect(self) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def type_descriptor(self, typeobj): ... - def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...): ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = None): ... def validate_identifier(self, ident) -> None: ... def connect(self, *cargs, **cparams): ... def create_connect_args(self, url): ... @@ -131,9 +131,9 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def do_savepoint(self, connection, name) -> None: ... def do_rollback_to_savepoint(self, connection, name) -> None: ... def do_release_savepoint(self, connection, name) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, context: Incomplete | None = ...) -> None: ... # type: ignore[override] + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute_no_params(self, cursor, statement, context: Incomplete | None = None) -> None: ... # type: ignore[override] def is_disconnect(self, e, connection, cursor): ... def reset_isolation_level(self, dbapi_conn) -> None: ... def normalize_name(self, name): ... @@ -216,6 +216,6 @@ class DefaultExecutionContext(interfaces.ExecutionContext): def inserted_primary_key_rows(self): ... def lastrow_has_defaults(self): ... current_parameters: Any - def get_current_parameters(self, isolate_multiinsert_groups: bool = ...): ... + def get_current_parameters(self, isolate_multiinsert_groups: bool = True): ... def get_insert_default(self, column): ... def get_update_default(self, column): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index afe46eb46e85..a621216264cd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -54,24 +54,24 @@ class Dialect: # as abstract. @classmethod def type_descriptor(cls, typeobj) -> None: ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_temp_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_temp_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_temp_table_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_temp_view_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... def normalize_name(self, name) -> None: ... def denormalize_name(self, name) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...) -> None: ... - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ..., **kw) -> None: ... + def has_table(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = None) -> None: ... + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None, **kw) -> None: ... def do_begin(self, dbapi_connection) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... @@ -83,12 +83,12 @@ class Dialect: def do_release_savepoint(self, connection, name) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute_no_params(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor) -> None: ... def connect(self, *cargs, **cparams) -> DBAPIConnection: ... def reset_isolation_level(self, dbapi_conn) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi index 350ba42ee0df..242cf7868d78 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi @@ -9,24 +9,24 @@ class Inspector: @property def default_schema_name(self): ... def get_schema_names(self): ... - def get_table_names(self, schema: Incomplete | None = ...): ... - def has_table(self, table_name, schema: Incomplete | None = ...): ... - def has_sequence(self, sequence_name, schema: Incomplete | None = ...): ... - def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = ...): ... + def get_table_names(self, schema: Incomplete | None = None): ... + def has_table(self, table_name, schema: Incomplete | None = None): ... + def has_sequence(self, sequence_name, schema: Incomplete | None = None): ... + def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = None): ... def get_temp_table_names(self): ... def get_temp_view_names(self): ... - def get_table_options(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, schema: Incomplete | None = ...): ... - def get_sequence_names(self, schema: Incomplete | None = ...): ... - def get_view_definition(self, view_name, schema: Incomplete | None = ...): ... - def get_columns(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_options(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, schema: Incomplete | None = None): ... + def get_sequence_names(self, schema: Incomplete | None = None): ... + def get_view_definition(self, view_name, schema: Incomplete | None = None): ... + def get_columns(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, table_name, schema: Incomplete | None = None, **kw): ... def reflecttable(self, *args, **kwargs): ... def reflect_table( - self, table, include_columns, exclude_columns=..., resolve_fks: bool = ..., _extend_on: Incomplete | None = ... + self, table, include_columns, exclude_columns=(), resolve_fks: bool = True, _extend_on: Incomplete | None = None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index 7328eb5e2f4f..9500d7a11231 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -22,14 +22,14 @@ class SimpleResultMetaData(ResultMetaData): def __init__( self, keys, - extra: Incomplete | None = ..., - _processors: Incomplete | None = ..., - _tuplefilter: Incomplete | None = ..., - _translated_indexes: Incomplete | None = ..., - _unique_filters: Incomplete | None = ..., + extra: Incomplete | None = None, + _processors: Incomplete | None = None, + _tuplefilter: Incomplete | None = None, + _translated_indexes: Incomplete | None = None, + _unique_filters: Incomplete | None = None, ) -> None: ... -def result_tuple(fields, extra: Incomplete | None = ...): ... +def result_tuple(fields, extra: Incomplete | None = None): ... class ResultInternal(InPlaceGenerative): ... @@ -40,16 +40,16 @@ class Result(_WithKeys, ResultInternal): def __init__(self, cursor_metadata) -> None: ... def close(self) -> None: ... def yield_per(self, num: int) -> Self: ... - def unique(self, strategy: Incomplete | None = ...) -> Self: ... + def unique(self, strategy: Incomplete | None = None) -> Self: ... def columns(self, *col_expressions): ... - def scalars(self, index: int = ...) -> ScalarResult: ... + def scalars(self, index: int = 0) -> ScalarResult: ... def mappings(self) -> MappingResult: ... def __iter__(self): ... def __next__(self): ... - def partitions(self, size: int | None = ...) -> Generator[list[Row], None, None]: ... + def partitions(self, size: int | None = None) -> Generator[list[Row], None, None]: ... def fetchall(self) -> list[Row]: ... def fetchone(self) -> Row | None: ... - def fetchmany(self, size: int | None = ...) -> list[Row]: ... + def fetchmany(self, size: int | None = None) -> list[Row]: ... def all(self) -> list[Row]: ... def first(self) -> Row | None: ... def one_or_none(self) -> Row | None: ... @@ -64,10 +64,10 @@ class FilterResult(ResultInternal): ... class ScalarResult(FilterResult): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... - def partitions(self, size: Incomplete | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = None): ... + def partitions(self, size: Incomplete | None = None) -> None: ... def fetchall(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -77,12 +77,12 @@ class ScalarResult(FilterResult): class MappingResult(_WithKeys, FilterResult): def __init__(self, result) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - def partitions(self, size: Incomplete | None = ...) -> None: ... + def partitions(self, size: Incomplete | None = None) -> None: ... def fetchall(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -101,7 +101,9 @@ class FrozenResult: class IteratorResult(Result): iterator: Any raw: Any - def __init__(self, cursor_metadata, iterator, raw: Incomplete | None = ..., _source_supports_scalars: bool = ...) -> None: ... + def __init__( + self, cursor_metadata, iterator, raw: Incomplete | None = None, _source_supports_scalars: bool = False + ) -> None: ... def null_result() -> IteratorResult: ... @@ -114,9 +116,9 @@ class ChunkedIteratorResult(IteratorResult): self, cursor_metadata, chunks, - source_supports_scalars: bool = ..., - raw: Incomplete | None = ..., - dynamic_yield_per: bool = ..., + source_supports_scalars: bool = False, + raw: Incomplete | None = None, + dynamic_yield_per: bool = False, ) -> None: ... class MergedResult(IteratorResult): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 0a4c48a085ea..7a5b30789954 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -27,31 +27,31 @@ class URL(_URLTuple): def create( cls, drivername: str, - username: str | None = ..., + username: str | None = None, password: str | _PasswordObject | None = None, - host: str | None = ..., - port: int | None = ..., - database: str | None = ..., + host: str | None = None, + port: int | None = None, + database: str | None = None, query: _Query | None = ..., ) -> URL: ... def set( self, - drivername: str | None = ..., - username: str | None = ..., + drivername: str | None = None, + username: str | None = None, password: str | _PasswordObject | None = None, - host: str | None = ..., - port: int | None = ..., - database: str | None = ..., - query: _Query | None = ..., + host: str | None = None, + port: int | None = None, + database: str | None = None, + query: _Query | None = None, ) -> Self: ... - def update_query_string(self, query_string: str, append: bool = ...) -> Self: ... - def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... - def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... + def update_query_string(self, query_string: str, append: bool = False) -> Self: ... + def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = False) -> Self: ... + def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = False) -> Self: ... def difference_update_query(self, names: Iterable[str]) -> URL: ... @property def normalized_query(self) -> immutabledict[str, tuple[str, ...]]: ... - def __to_string__(self, hide_password: bool = ...) -> str: ... - def render_as_string(self, hide_password: bool = ...) -> str: ... + def __to_string__(self, hide_password: bool = True) -> str: ... + def render_as_string(self, hide_password: bool = True) -> str: ... def __copy__(self) -> Self: ... def __deepcopy__(self, memo: Unused) -> Self: ... def __hash__(self) -> int: ... @@ -60,6 +60,6 @@ class URL(_URLTuple): def get_backend_name(self) -> str: ... def get_driver_name(self) -> str: ... def get_dialect(self) -> type[Dialect]: ... - def translate_connect_args(self, names: list[str] | None = ..., **kw: str) -> dict[str, Any]: ... + def translate_connect_args(self, names: list[str] | None = None, **kw: str) -> dict[str, Any]: ... def make_url(name_or_url: str | URL) -> URL: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index d968c86e5ddd..d367033311fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -5,7 +5,7 @@ class _UnpickleDispatch: def __call__(self, _instance_cls): ... class _Dispatch: - def __init__(self, parent, instance_cls: Incomplete | None = ...) -> None: ... + def __init__(self, parent, instance_cls: Incomplete | None = None) -> None: ... def __getattr__(self, name: str): ... def __reduce__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi b/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi index f513b9664f50..616d3d784803 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi @@ -8,14 +8,19 @@ class _EventKey: fn_key: Any fn_wrap: Any dispatch_target: Any - def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = ...) -> None: ... + def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = None) -> None: ... def with_wrapper(self, fn_wrap): ... def with_dispatch_target(self, dispatch_target): ... def listen(self, *args, **kw) -> None: ... def remove(self) -> None: ... def contains(self): ... def base_listen( - self, propagate: bool = ..., insert: bool = ..., named: bool = ..., retval: Incomplete | None = ..., asyncio: bool = ... + self, + propagate: bool = False, + insert: bool = False, + named: bool = False, + retval: Incomplete | None = None, + asyncio: bool = False, ) -> None: ... def append_to_list(self, owner, list_): ... def remove_from_list(self, owner, list_) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/exc.pyi b/stubs/SQLAlchemy/sqlalchemy/exc.pyi index 30dba09fc49b..876de1270d83 100644 --- a/stubs/SQLAlchemy/sqlalchemy/exc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/exc.pyi @@ -22,7 +22,7 @@ class AmbiguousForeignKeysError(ArgumentError): ... class CircularDependencyError(SQLAlchemyError): cycles: Any edges: Any - def __init__(self, message, cycles, edges, msg: Incomplete | None = ..., code: Incomplete | None = ...) -> None: ... + def __init__(self, message, cycles, edges, msg: Incomplete | None = None, code: Incomplete | None = None) -> None: ... def __reduce__(self): ... class CompileError(SQLAlchemyError): ... @@ -32,7 +32,7 @@ class UnsupportedCompilationError(CompileError): compiler: Any element_type: Any message: str | None - def __init__(self, compiler, element_type, message: str | None = ...) -> None: ... + def __init__(self, compiler, element_type, message: str | None = None) -> None: ... def __reduce__(self): ... class IdentifierError(SQLAlchemyError): ... @@ -88,9 +88,9 @@ class StatementError(SQLAlchemyError): statement, params, orig, - hide_parameters: bool = ..., - code: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + code: Incomplete | None = None, + ismulti: Incomplete | None = None, ) -> None: ... def add_detail(self, msg) -> None: ... def __reduce__(self): ... @@ -104,10 +104,10 @@ class DBAPIError(StatementError): params, orig, dbapi_base_err, - hide_parameters: bool = ..., - connection_invalidated: bool = ..., - dialect: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + connection_invalidated: bool = False, + dialect: Incomplete | None = None, + ismulti: Incomplete | None = None, ): ... def __reduce__(self): ... connection_invalidated: Any @@ -116,10 +116,10 @@ class DBAPIError(StatementError): statement, params, orig, - hide_parameters: bool = ..., - connection_invalidated: bool = ..., - code: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + connection_invalidated: bool = False, + code: Incomplete | None = None, + ismulti: Incomplete | None = None, ) -> None: ... class InterfaceError(DBAPIError): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi index d72c6d7ee574..f75244e2a0e3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -25,17 +25,17 @@ class AssociationProxy(interfaces.InspectionAttrInfo): self, target_collection, attr, - creator: Incomplete | None = ..., - getset_factory: Incomplete | None = ..., - proxy_factory: Incomplete | None = ..., - proxy_bulk_set: Incomplete | None = ..., - info: Incomplete | None = ..., - cascade_scalar_deletes: bool = ..., + creator: Incomplete | None = None, + getset_factory: Incomplete | None = None, + proxy_factory: Incomplete | None = None, + proxy_bulk_set: Incomplete | None = None, + info: Incomplete | None = None, + cascade_scalar_deletes: bool = False, ) -> None: ... def __get__(self, obj, class_): ... def __set__(self, obj, values) -> None: ... def __delete__(self, obj) -> None: ... - def for_class(self, class_, obj: Incomplete | None = ...): ... + def for_class(self, class_, obj: Incomplete | None = None): ... class AssociationProxyInstance: parent: Any @@ -62,15 +62,15 @@ class AssociationProxyInstance: def get(self, obj): ... def set(self, obj, values) -> None: ... def delete(self, obj) -> None: ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... class AmbiguousAssociationProxyInstance(AssociationProxyInstance): def get(self, obj): ... def __eq__(self, obj): ... def __ne__(self, obj): ... - def any(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... - def has(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... + def any(self, criterion: Incomplete | None = None, **kwargs) -> None: ... + def has(self, criterion: Incomplete | None = None, **kwargs) -> None: ... class ObjectAssociationProxyInstance(AssociationProxyInstance): def contains(self, obj): ... @@ -113,7 +113,7 @@ class _AssociationList(_AssociationCollection): def count(self, value): ... def extend(self, values) -> None: ... def insert(self, index, value) -> None: ... - def pop(self, index: int = ...): ... + def pop(self, index: int = -1): ... def remove(self, value) -> None: ... def reverse(self) -> None: ... def sort(self) -> None: ... @@ -150,8 +150,8 @@ class _AssociationDict(_AssociationCollection): def __gt__(self, other): ... def __ge__(self, other): ... def __cmp__(self, other): ... - def get(self, key, default: Incomplete | None = ...): ... - def setdefault(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... + def setdefault(self, key, default: Incomplete | None = None): ... def keys(self): ... def items(self): ... def values(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi index 61f3579aecf8..5e1b2c263496 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi @@ -5,7 +5,7 @@ class ReversibleProxy: ... class StartableContext(abc.ABC, metaclass=abc.ABCMeta): @abc.abstractmethod - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... def __await__(self): ... async def __aenter__(self): ... @abc.abstractmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi index 26538f549e98..15aa848485fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi @@ -12,8 +12,8 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): engine: Any sync_engine: Any sync_connection: Any - def __init__(self, async_engine, sync_connection: Incomplete | None = ...) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + def __init__(self, async_engine, sync_connection: Incomplete | None = None) -> None: ... + async def start(self, is_ctxmanager: bool = False): ... @property def connection(self) -> None: ... async def get_raw_connection(self): ... @@ -21,7 +21,7 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): def info(self): ... def begin(self): ... def begin_nested(self): ... - async def invalidate(self, exception: Incomplete | None = ...): ... + async def invalidate(self, exception: Incomplete | None = None): ... async def get_isolation_level(self): ... async def set_isolation_level(self): ... def in_transaction(self): ... @@ -32,12 +32,12 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): async def commit(self) -> None: ... async def rollback(self) -> None: ... async def close(self) -> None: ... - async def exec_driver_sql(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def stream(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def execute(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def scalar(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def stream_scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def exec_driver_sql(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def stream(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def execute(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def scalar(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def scalars(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def stream_scalars(self, statement, parameters: Incomplete | None = None, execution_options=...): ... async def run_sync(self, fn, *arg, **kw): ... def __await__(self): ... async def __aexit__( @@ -57,7 +57,7 @@ class AsyncEngine(ProxyComparable, AsyncConnectable): conn: Any def __init__(self, conn) -> None: ... transaction: Any - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... @@ -87,7 +87,7 @@ class AsyncTransaction(ProxyComparable, StartableContext): connection: Any sync_transaction: Any nested: Any - def __init__(self, connection, nested: bool = ...) -> None: ... + def __init__(self, connection, nested: bool = False) -> None: ... @property def is_valid(self): ... @property @@ -95,7 +95,7 @@ class AsyncTransaction(ProxyComparable, StartableContext): async def close(self) -> None: ... async def rollback(self) -> None: ... async def commit(self) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi index 43a2a3b0b879..ee9864e0b182 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi @@ -8,11 +8,11 @@ class AsyncCommon(FilterResult): class AsyncResult(AsyncCommon): def __init__(self, real_result) -> None: ... def keys(self): ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchone(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -23,15 +23,15 @@ class AsyncResult(AsyncCommon): async def one(self): ... async def scalar(self): ... async def freeze(self): ... - def scalars(self, index: int = ...): ... + def scalars(self, index: int = 0): ... def mappings(self): ... class AsyncScalarResult(AsyncCommon): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = None): ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchall(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -42,12 +42,12 @@ class AsyncScalarResult(AsyncCommon): class AsyncMappingResult(AsyncCommon): def __init__(self, result) -> None: ... def keys(self): ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchall(self): ... async def fetchone(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi index a71390ced527..2d6557caff95 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi @@ -21,7 +21,7 @@ class async_scoped_session(ScopedSessionMixin): autoflush: Any def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -30,38 +30,40 @@ class async_scoped_session(ScopedSessionMixin): async def connection(self, **kw): ... async def delete(self, instance): ... async def execute( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - async def flush(self, objects: Incomplete | None = ...) -> None: ... + async def flush(self, objects: Incomplete | None = None) -> None: ... async def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, ): ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... - def is_modified(self, instance, include_collections: bool = ...): ... - async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... - async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... + def get_bind( + self, mapper: Incomplete | None = None, clause: Incomplete | None = None, bind: Incomplete | None = None, **kw + ): ... + def is_modified(self, instance, include_collections: bool = True): ... + async def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... + async def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None): ... async def rollback(self): ... async def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream_scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... @property def dirty(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index 02e1e942fc4d..aefe03ad9ee2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -13,40 +13,42 @@ class AsyncSession(ReversibleProxy): sync_session_class: Any sync_session: Any def __init__( - self, bind: Incomplete | None = ..., binds: Incomplete | None = ..., sync_session_class: Incomplete | None = ..., **kw + self, bind: Incomplete | None = None, binds: Incomplete | None = None, sync_session_class: Incomplete | None = None, **kw ) -> None: ... - async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... + async def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None): ... async def run_sync(self, fn, *arg, **kw): ... async def execute( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, ): ... async def stream( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream_scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def delete(self, instance): ... - async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... - async def flush(self, objects: Incomplete | None = ...) -> None: ... + async def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... + async def flush(self, objects: Incomplete | None = None) -> None: ... def get_transaction(self): ... def get_nested_transaction(self): ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... + def get_bind( + self, mapper: Incomplete | None = None, clause: Incomplete | None = None, bind: Incomplete | None = None, **kw + ): ... async def connection(self, **kw): ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -68,13 +70,13 @@ class AsyncSession(ReversibleProxy): def object_session(cls, instance): ... def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... def in_transaction(self): ... def in_nested_transaction(self): ... @property @@ -103,12 +105,12 @@ class AsyncSessionTransaction(ReversibleProxy, StartableContext): session: Any nested: Any sync_transaction: Any - def __init__(self, session, nested: bool = ...) -> None: ... + def __init__(self, session, nested: bool = False) -> None: ... @property def is_active(self): ... async def rollback(self) -> None: ... async def commit(self) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi index f17b2d3b60ae..47a5793cb398 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi @@ -12,16 +12,16 @@ class AutomapBase: @classmethod def prepare( cls, - autoload_with: Incomplete | None = ..., - engine: Incomplete | None = ..., - reflect: bool = ..., - schema: Incomplete | None = ..., - classname_for_table: Incomplete | None = ..., - collection_class: Incomplete | None = ..., - name_for_scalar_relationship: Incomplete | None = ..., - name_for_collection_relationship: Incomplete | None = ..., - generate_relationship: Incomplete | None = ..., + autoload_with: Incomplete | None = None, + engine: Incomplete | None = None, + reflect: bool = False, + schema: Incomplete | None = None, + classname_for_table: Incomplete | None = None, + collection_class: Incomplete | None = None, + name_for_scalar_relationship: Incomplete | None = None, + name_for_collection_relationship: Incomplete | None = None, + generate_relationship: Incomplete | None = None, reflection_options=..., ) -> None: ... -def automap_base(declarative_base: Incomplete | None = ..., **kw): ... +def automap_base(declarative_base: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi index 2cf3c3250ac0..250844a1d85f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi @@ -11,16 +11,16 @@ class Bakery: class BakedQuery: steps: Any - def __init__(self, bakery, initial_fn, args=...) -> None: ... + def __init__(self, bakery, initial_fn, args=()) -> None: ... @classmethod - def bakery(cls, size: int = ..., _size_alert: Incomplete | None = ...): ... + def bakery(cls, size: int = 200, _size_alert: Incomplete | None = None): ... def __iadd__(self, other): ... def __add__(self, other): ... def add_criteria(self, fn, *args): ... def with_criteria(self, fn, *args): ... def for_session(self, session): ... def __call__(self, session): ... - def spoil(self, full: bool = ...): ... + def spoil(self, full: bool = False): ... def to_query(self, query_or_session): ... class Result: diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi index 08a80eb03bce..b8355d51ced1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi @@ -22,13 +22,13 @@ class ShardedSession(Session): self, shard_chooser, id_chooser, - execute_chooser: Incomplete | None = ..., - shards: Incomplete | None = ..., + execute_chooser: Incomplete | None = None, + shards: Incomplete | None = None, query_cls=..., **kwargs, ): ... def connection_callable( - self, mapper: Incomplete | None = ..., instance: Incomplete | None = ..., shard_id: Incomplete | None = ..., **kwargs + self, mapper: Incomplete | None = None, instance: Incomplete | None = None, shard_id: Incomplete | None = None, **kwargs ): ... - def get_bind(self, mapper: Incomplete | None = ..., shard_id: Incomplete | None = ..., instance: Incomplete | None = ..., clause: Incomplete | None = ..., **kw): ... # type: ignore[override] + def get_bind(self, mapper: Incomplete | None = None, shard_id: Incomplete | None = None, instance: Incomplete | None = None, clause: Incomplete | None = None, **kw): ... # type: ignore[override] def bind_shard(self, shard_id, bind) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi index eda35d683c6e..d9d20108f4ab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi @@ -10,7 +10,7 @@ class hybrid_method(interfaces.InspectionAttrInfo): is_attribute: bool extension_type: Any func: Any - def __init__(self, func, expr: Incomplete | None = ...) -> None: ... + def __init__(self, func, expr: Incomplete | None = None) -> None: ... def __get__(self, instance, owner): ... expr: Any def expression(self, expr): ... @@ -27,11 +27,11 @@ class hybrid_property(interfaces.InspectionAttrInfo): def __init__( self, fget, - fset: Incomplete | None = ..., - fdel: Incomplete | None = ..., - expr: Incomplete | None = ..., - custom_comparator: Incomplete | None = ..., - update_expr: Incomplete | None = ..., + fset: Incomplete | None = None, + fdel: Incomplete | None = None, + expr: Incomplete | None = None, + custom_comparator: Incomplete | None = None, + update_expr: Incomplete | None = None, ) -> None: ... def __get__(self, instance, owner): ... def __set__(self, instance, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi index 1178ebd4fff4..8d34ff0db8b8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi @@ -10,7 +10,7 @@ class index_property(hybrid_property): datatype: Any onebased: Any def __init__( - self, attr_name, index, default=..., datatype: Incomplete | None = ..., mutable: bool = ..., onebased: bool = ... + self, attr_name, index, default=..., datatype: Incomplete | None = None, mutable: bool = True, onebased: bool = True ): ... def fget(self, instance): ... def fset(self, instance, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi index d054f2def40d..d88af6e40c01 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi @@ -39,7 +39,7 @@ class _ClassInstrumentationAdapter(ClassManager): def manage(self) -> None: ... def unregister(self) -> None: ... def manager_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def instrument_attribute(self, key, inst, propagated: bool = False) -> None: ... def post_configure_attribute(self, key) -> None: ... def install_descriptor(self, key, inst) -> None: ... def uninstall_descriptor(self, key) -> None: ... @@ -47,8 +47,8 @@ class _ClassInstrumentationAdapter(ClassManager): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def new_instance(self, state: Incomplete | None = ...): ... - def setup_instance(self, instance, state: Incomplete | None = ...): ... + def new_instance(self, state: Incomplete | None = None): ... + def setup_instance(self, instance, state: Incomplete | None = None): ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... def state_getter(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi index 7c86012baa48..bebca695be58 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi @@ -1,20 +1,20 @@ from _typeshed import Incomplete from typing import Any -def ordering_list(attr, count_from: Incomplete | None = ..., **kw): ... +def ordering_list(attr, count_from: Incomplete | None = None, **kw): ... class OrderingList(list[Any]): ordering_attr: Any ordering_func: Any reorder_on_append: Any def __init__( - self, ordering_attr: Incomplete | None = ..., ordering_func: Incomplete | None = ..., reorder_on_append: bool = ... + self, ordering_attr: Incomplete | None = None, ordering_func: Incomplete | None = None, reorder_on_append: bool = False ) -> None: ... def reorder(self) -> None: ... def append(self, entity) -> None: ... def insert(self, index, entity) -> None: ... def remove(self, entity) -> None: ... - def pop(self, index: int = ...): ... # type: ignore[override] + def pop(self, index: int = -1): ... # type: ignore[override] def __setitem__(self, index, entity) -> None: ... def __delitem__(self, index) -> None: ... def __setslice__(self, start, end, values) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi index 4177beb2f2e5..3584cf3ebd4c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi @@ -2,7 +2,9 @@ from _typeshed import Incomplete def Serializer(*args, **kw): ... def Deserializer( - file, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ... + file, metadata: Incomplete | None = None, scoped_session: Incomplete | None = None, engine: Incomplete | None = None +): ... +def dumps(obj, protocol=5): ... +def loads( + data, metadata: Incomplete | None = None, scoped_session: Incomplete | None = None, engine: Incomplete | None = None ): ... -def dumps(obj, protocol=...): ... -def loads(data, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi index f1b3362d14dc..049185fd8048 100644 --- a/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi @@ -22,8 +22,8 @@ class Connection(_LegacyConnection): def commit(self) -> None: ... def rollback(self) -> None: ... def close(self) -> None: ... - def execute(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] - def scalar(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] + def execute(self, statement, parameters: Incomplete | None = None, execution_options: Incomplete | None = None): ... # type: ignore[override] + def scalar(self, statement, parameters: Incomplete | None = None, execution_options: Incomplete | None = None): ... # type: ignore[override] class Engine(_LegacyEngine): transaction: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/inspection.pyi b/stubs/SQLAlchemy/sqlalchemy/inspection.pyi index d758818c57fc..3e92030a6f5d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/inspection.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/inspection.pyi @@ -1 +1 @@ -def inspect(subject, raiseerr: bool = ...): ... +def inspect(subject, raiseerr: bool = True): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index 98b20ef91797..2bb42e332f15 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -28,7 +28,7 @@ class InstanceLogger: def isEnabledFor(self, level): ... def getEffectiveLevel(self): ... -def instance_logger(instance: Identified, echoflag: _EchoFlag = ...) -> None: ... +def instance_logger(instance: Identified, echoflag: _EchoFlag = None) -> None: ... class echo_property: __doc__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi index 6e32aa68bacf..a0ba4126d5fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi @@ -85,7 +85,7 @@ from .util import ( with_polymorphic as with_polymorphic, ) -def create_session(bind: Incomplete | None = ..., **kwargs): ... +def create_session(bind: Incomplete | None = None, **kwargs): ... with_loader_criteria: Any relationship: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi index c054153eef86..d181cf386d9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -32,10 +32,10 @@ class QueryableAttribute( class_, key, parententity, - impl: Incomplete | None = ..., - comparator: Incomplete | None = ..., - of_type: Incomplete | None = ..., - extra_criteria=..., + impl: Incomplete | None = None, + comparator: Incomplete | None = None, + of_type: Incomplete | None = None, + extra_criteria=(), ) -> None: ... def __reduce__(self): ... def get_history(self, instance, passive=...): ... @@ -52,7 +52,7 @@ class QueryableAttribute( def label(self, name): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... - def hasparent(self, state, optimistic: bool = ...): ... + def hasparent(self, state, optimistic: bool = False): ... def __getattr__(self, key: str): ... @memoized_property def property(self): ... @@ -112,17 +112,17 @@ class AttributeImpl: key, callable_, dispatch, - trackparent: bool = ..., - compare_function: Incomplete | None = ..., - active_history: bool = ..., - parent_token: Incomplete | None = ..., - load_on_unexpire: bool = ..., - send_modified_events: bool = ..., - accepts_scalar_loader: Incomplete | None = ..., + trackparent: bool = False, + compare_function: Incomplete | None = None, + active_history: bool = False, + parent_token: Incomplete | None = None, + load_on_unexpire: bool = True, + send_modified_events: bool = True, + accepts_scalar_loader: Incomplete | None = None, **kwargs, ) -> None: ... active_history: Any - def hasparent(self, state, optimistic: bool = ...): ... + def hasparent(self, state, optimistic: bool = False): ... def sethasparent(self, state, parent_state, value) -> None: ... def get_history(self, state, dict_, passive=...) -> None: ... def get_all_pending(self, state, dict_, passive=...) -> None: ... @@ -130,7 +130,9 @@ class AttributeImpl: def append(self, state, dict_, value, initiator, passive=...) -> None: ... def remove(self, state, dict_, value, initiator, passive=...) -> None: ... def pop(self, state, dict_, value, initiator, passive=...) -> None: ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def get_committed_value(self, state, dict_, passive=...): ... def set_committed_value(self, state, dict_, value): ... @@ -143,7 +145,9 @@ class ScalarAttributeImpl(AttributeImpl): def __init__(self, *arg, **kw) -> None: ... def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... @property @@ -157,7 +161,9 @@ class ScalarObjectAttributeImpl(ScalarAttributeImpl): def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... def get_all_pending(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... @@ -175,10 +181,10 @@ class CollectionAttributeImpl(AttributeImpl): key, callable_, dispatch, - typecallable: Incomplete | None = ..., - trackparent: bool = ..., - copy_function: Incomplete | None = ..., - compare_function: Incomplete | None = ..., + typecallable: Incomplete | None = None, + trackparent: bool = False, + copy_function: Incomplete | None = None, + compare_function: Incomplete | None = None, **kwargs, ) -> None: ... def get_history(self, state, dict_, passive=...): ... @@ -196,14 +202,14 @@ class CollectionAttributeImpl(AttributeImpl): state, dict_, value, - initiator: Incomplete | None = ..., + initiator: Incomplete | None = None, passive=..., - check_old: Incomplete | None = ..., - pop: bool = ..., - _adapt: bool = ..., + check_old: Incomplete | None = None, + pop: bool = False, + _adapt: bool = True, ) -> None: ... def set_committed_value(self, state, dict_, value): ... - def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... + def get_collection(self, state, dict_, user_data: Incomplete | None = None, passive=...): ... def backref_listeners(attribute, key, uselist): ... @@ -227,26 +233,26 @@ HISTORY_BLANK: Any def get_history(obj, key, passive=...): ... def get_state_history(state, key, passive=...): ... -def has_parent(cls, obj, key, optimistic: bool = ...): ... +def has_parent(cls, obj, key, optimistic: bool = False): ... def register_attribute(class_, key, **kw): ... def register_attribute_impl( class_, key, - uselist: bool = ..., - callable_: Incomplete | None = ..., - useobject: bool = ..., - impl_class: Incomplete | None = ..., - backref: Incomplete | None = ..., + uselist: bool = False, + callable_: Incomplete | None = None, + useobject: bool = False, + impl_class: Incomplete | None = None, + backref: Incomplete | None = None, **kw, ): ... def register_descriptor( - class_, key, comparator: Incomplete | None = ..., parententity: Incomplete | None = ..., doc: Incomplete | None = ... + class_, key, comparator: Incomplete | None = None, parententity: Incomplete | None = None, doc: Incomplete | None = None ): ... def unregister_attribute(class_, key) -> None: ... def init_collection(obj, key): ... def init_state_collection(state, dict_, key): ... def set_committed_value(instance, key, value) -> None: ... -def set_attribute(instance, key, value, initiator: Incomplete | None = ...) -> None: ... +def set_attribute(instance, key, value, initiator: Incomplete | None = None) -> None: ... def get_attribute(instance, key): ... def del_attribute(instance, key) -> None: ... def flag_modified(instance, key) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi index 4d247f53c726..d231d89d4505 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi @@ -55,7 +55,7 @@ def _is_mapped_class(entity): ... _state_mapper: Any -def class_mapper(class_, configure: bool = ...): ... +def class_mapper(class_, configure: bool = True): ... class InspectionAttr: is_selectable: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi index b21f02a3a35f..129b82fbbc6f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi @@ -7,7 +7,7 @@ def remove_class(classname, cls, decl_class_registry) -> None: ... class _MultipleClassMarker: on_remove: Any contents: Any - def __init__(self, classes, on_remove: Incomplete | None = ...) -> None: ... + def __init__(self, classes, on_remove: Incomplete | None = None) -> None: ... def remove_item(self, cls) -> None: ... def __iter__(self): ... def attempt_get(self, path, key): ... @@ -48,5 +48,5 @@ class _class_resolver: arg: Any fallback: Any favor_tables: Any - def __init__(self, cls, prop, fallback, arg, favor_tables: bool = ...) -> None: ... + def __init__(self, cls, prop, fallback, arg, favor_tables: bool = False) -> None: ... def __call__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 8efe02c952a0..91d88b539fb2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -73,22 +73,22 @@ class CollectionAdapter: @property def data(self): ... def bulk_appender(self): ... - def append_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def append_with_event(self, item, initiator: Incomplete | None = None) -> None: ... def append_without_event(self, item) -> None: ... def append_multiple_without_event(self, items) -> None: ... def bulk_remover(self): ... - def remove_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def remove_with_event(self, item, initiator: Incomplete | None = None) -> None: ... def remove_without_event(self, item) -> None: ... - def clear_with_event(self, initiator: Incomplete | None = ...) -> None: ... + def clear_with_event(self, initiator: Incomplete | None = None) -> None: ... def clear_without_event(self) -> None: ... def __iter__(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... - def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = ...): ... - def fire_append_event(self, item, initiator: Incomplete | None = ...): ... - def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... - def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... + def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = None): ... + def fire_append_event(self, item, initiator: Incomplete | None = None): ... + def fire_remove_event(self, item, initiator: Incomplete | None = None) -> None: ... + def fire_pre_remove_event(self, initiator: Incomplete | None = None) -> None: ... class InstrumentedList(list[_T]): def append(self, item, _sa_initiator: Event | Literal[False] | None = None) -> None: ... @@ -112,8 +112,8 @@ class InstrumentedDict(dict[_KT, _VT]): ... class MappedCollection(dict[_KT, _VT]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... - def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... def __delitem__(self, key: _KT, _sa_initiatorEvent: Event | Literal[False] | None = None) -> None: ... def __setitem__(self, key: _KT, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... @overload diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index 423eeb985552..7986198b21ec 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -37,8 +37,8 @@ class QueryContext: params, session, load_options, - execution_options: Incomplete | None = ..., - bind_arguments: Incomplete | None = ..., + execution_options: Incomplete | None = None, + bind_arguments: Incomplete | None = None, ) -> None: ... class ORMCompileState(CompileState): @@ -142,8 +142,8 @@ class _BundleEntity(_QueryEntity): expr, entities_collection, is_current_entities: bool, - setup_entities: bool = ..., - parent_bundle: Incomplete | None = ..., + setup_entities: bool = True, + parent_bundle: Incomplete | None = None, ) -> None: ... @property def mapper(self): ... @@ -178,7 +178,7 @@ class _RawColumnEntity(_ColumnEntity): entities_collection, raw_column_index, is_current_entities: bool, - parent_bundle: Incomplete | None = ..., + parent_bundle: Incomplete | None = None, ) -> None: ... def corresponds_to(self, entity): ... def setup_compile_state(self, compile_state) -> None: ... @@ -200,7 +200,7 @@ class _ORMColumnEntity(_ColumnEntity): parententity, raw_column_index, is_current_entities: bool, - parent_bundle: Incomplete | None = ..., + parent_bundle: Incomplete | None = None, ) -> None: ... def corresponds_to(self, entity): ... def setup_compile_state(self, compile_state) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 3afa68d90912..f109fd39bba0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -32,10 +32,10 @@ class DeclarativeMeta(type): def __setattr__(cls, key: str, value: Any) -> None: ... def __delattr__(cls, key: str) -> None: ... -def synonym_for(name, map_column: bool = ...): ... +def synonym_for(name, map_column: bool = False): ... class declared_attr(interfaces._MappedAttribute, property): - def __init__(self, fget, cascading: bool = ...) -> None: ... + def __init__(self, fget, cascading: bool = False) -> None: ... def __get__(self, self_, cls): ... @hybridproperty def cascading(self): ... @@ -48,23 +48,23 @@ class _stateful_declared_attr(declared_attr): def declarative_mixin(cls: _ClsT) -> _ClsT: ... @overload def declarative_base( - bind: Connectable | None = ..., - metadata: MetaData | None = ..., - mapper: Incomplete | None = ..., + bind: Connectable | None = None, + metadata: MetaData | None = None, + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", constructor: Callable[..., None] = ..., - class_registry: dict[str, type[Any]] | None = ..., + class_registry: dict[str, type[Any]] | None = None, ) -> type[_DeclarativeBase]: ... @overload def declarative_base( - bind: Connectable | None = ..., - metadata: MetaData | None = ..., - mapper: Incomplete | None = ..., + bind: Connectable | None = None, + metadata: MetaData | None = None, + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", constructor: Callable[..., None] = ..., - class_registry: dict[str, type[Any]] | None = ..., + class_registry: dict[str, type[Any]] | None = None, *, metaclass: _DeclarativeBaseMeta[_DeclT], ) -> _DeclT: ... @@ -85,25 +85,25 @@ class registry: constructor: Callable[..., None] def __init__( self, - metadata: MetaData | None = ..., - class_registry: dict[str, type[Any]] | None = ..., + metadata: MetaData | None = None, + class_registry: dict[str, type[Any]] | None = None, constructor: Callable[..., None] = ..., - _bind: Connectable | None = ..., + _bind: Connectable | None = None, ) -> None: ... @property def mappers(self) -> frozenset[Any]: ... - def configure(self, cascade: bool = ...) -> None: ... - def dispose(self, cascade: bool = ...) -> None: ... + def configure(self, cascade: bool = False) -> None: ... + def dispose(self, cascade: bool = False) -> None: ... @overload def generate_base( - self, mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ... + self, mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., name: str = "Base" ) -> type[_DeclarativeBase]: ... @overload def generate_base( self, - mapper: Incomplete | None = ..., + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", *, metaclass: _DeclarativeBaseMeta[_DeclT], ) -> _DeclT: ... @@ -125,7 +125,7 @@ class registry: self, *, mapper: Incomplete | None = ..., metaclass: _DeclarativeBaseMeta[_DeclT] ) -> Callable[[_ClsT], _ClsT | _DeclT | Any]: ... def map_declaratively(self, cls): ... - def map_imperatively(self, class_, local_table: Incomplete | None = ..., **kw): ... + def map_imperatively(self, class_, local_table: Incomplete | None = None, **kw): ... @overload def as_declarative( diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi index 9d5dbf1c0723..7aab93cf9046 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi @@ -43,5 +43,5 @@ class _DeferredMapperConfig(_ClassScanMapperConfig): @classmethod def config_for_cls(cls, class_): ... @classmethod - def classes_for_base(cls, base_cls, sort: bool = ...): ... + def classes_for_base(cls, base_cls, sort: bool = True): ... def map(self, mapper_kw=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi index f4e8b7930dd9..119d974fa940 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -61,11 +61,11 @@ class SynonymProperty(DescriptorProperty): def __init__( self, name, - map_column: Incomplete | None = ..., - descriptor: Incomplete | None = ..., - comparator_factory: Incomplete | None = ..., - doc: Incomplete | None = ..., - info: Incomplete | None = ..., + map_column: Incomplete | None = None, + descriptor: Incomplete | None = None, + comparator_factory: Incomplete | None = None, + doc: Incomplete | None = None, + info: Incomplete | None = None, ) -> None: ... @property def uses_objects(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi index 40193a48f6be..6008d1d9f04a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi @@ -21,22 +21,22 @@ class DynamicAttributeImpl(attributes.AttributeImpl): target_mapper: Any query_class: Any def __init__( - self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = ..., **kw + self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = None, **kw ) -> None: ... def get(self, state, dict_, passive=...): ... - def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... - def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... - def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... + def get_collection(self, state, dict_, user_data: Incomplete | None = None, passive=...): ... + def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = None) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = None) -> None: ... def set( self, state, dict_, value, - initiator: Incomplete | None = ..., + initiator: Incomplete | None = None, passive=..., - check_old: Incomplete | None = ..., - pop: bool = ..., - _adapt: bool = ..., + check_old: Incomplete | None = None, + pop: bool = False, + _adapt: bool = True, ) -> None: ... def delete(self, *args, **kwargs) -> None: ... def set_committed_value(self, state, dict_, value) -> None: ... @@ -74,7 +74,7 @@ class CollectionHistory: unchanged_items: Any added_items: Any deleted_items: Any - def __init__(self, attr, state, apply_to: Incomplete | None = ...) -> None: ... + def __init__(self, attr, state, apply_to: Incomplete | None = None) -> None: ... @property def added_plus_unchanged(self): ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi index 9091e9694c89..1e4cf1b01419 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi @@ -11,7 +11,7 @@ class _NoObject(operators.ColumnOperators[Any]): class EvaluatorCompiler: target_cls: Any - def __init__(self, target_cls: Incomplete | None = ...) -> None: ... + def __init__(self, target_cls: Incomplete | None = None) -> None: ... def process(self, *clauses): ... def visit_grouping(self, clause): ... def visit_null(self, clause): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi index 384ffdf114cb..b589abf2f489 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi @@ -18,15 +18,15 @@ class DetachedInstanceError(sa_exc.SQLAlchemyError): code: str class UnmappedInstanceError(UnmappedError): - def __init__(self, obj, msg: Incomplete | None = ...) -> None: ... + def __init__(self, obj, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class UnmappedClassError(UnmappedError): - def __init__(self, cls, msg: Incomplete | None = ...) -> None: ... + def __init__(self, cls, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class ObjectDeletedError(sa_exc.InvalidRequestError): - def __init__(self, state, msg: Incomplete | None = ...) -> None: ... + def __init__(self, state, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class UnmappedColumnError(sa_exc.InvalidRequestError): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi index 062e91c0c095..59f767906eed 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi @@ -10,7 +10,7 @@ class IdentityMap: def has_key(self, key): ... def popitem(self) -> None: ... def pop(self, key, *args) -> None: ... - def setdefault(self, key, default: Incomplete | None = ...) -> None: ... + def setdefault(self, key, default: Incomplete | None = None) -> None: ... def __len__(self) -> int: ... def copy(self) -> None: ... def __setitem__(self, key, value) -> None: ... @@ -22,7 +22,7 @@ class WeakInstanceDict(IdentityMap): def contains_state(self, state): ... def replace(self, state): ... def add(self, state): ... - def get(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... def items(self): ... def values(self): ... def __iter__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi index 6c972cef57ad..cfdfa096db9d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -38,10 +38,10 @@ class ClassManager(HasMemoized, dict[Any, Any]): def state_getter(self): ... @hybridmethod def dict_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def instrument_attribute(self, key, inst, propagated: bool = False) -> None: ... def subclass_managers(self, recursive) -> None: ... def post_configure_attribute(self, key) -> None: ... - def uninstrument_attribute(self, key, propagated: bool = ...) -> None: ... + def uninstrument_attribute(self, key, propagated: bool = False) -> None: ... def unregister(self) -> None: ... def install_descriptor(self, key, inst) -> None: ... def uninstall_descriptor(self, key) -> None: ... @@ -49,15 +49,15 @@ class ClassManager(HasMemoized, dict[Any, Any]): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def is_instrumented(self, key, search: bool = ...): ... + def is_instrumented(self, key, search: bool = False): ... def get_impl(self, key): ... @property def attributes(self): ... - def new_instance(self, state: Incomplete | None = ...): ... - def setup_instance(self, instance, state: Incomplete | None = ...) -> None: ... + def new_instance(self, state: Incomplete | None = None): ... + def setup_instance(self, instance, state: Incomplete | None = None) -> None: ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... - def has_parent(self, state, key, optimistic: bool = ...): ... + def has_parent(self, state, key, optimistic: bool = False): ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @@ -77,12 +77,12 @@ manager_of_class = base.manager_of_class def register_class( class_, - finalize: bool = ..., - mapper: Incomplete | None = ..., - registry: Incomplete | None = ..., - declarative_scan: Incomplete | None = ..., - expired_attribute_loader: Incomplete | None = ..., - init_method: Incomplete | None = ..., + finalize: bool = True, + mapper: Incomplete | None = None, + registry: Incomplete | None = None, + declarative_scan: Incomplete | None = None, + expired_attribute_loader: Incomplete | None = None, + init_method: Incomplete | None = None, ): ... def unregister_class(class_) -> None: ... def is_instrumented(instance, key): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi index 61b1c7f7eb0a..07a8975782b8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi @@ -46,7 +46,7 @@ class MapperProperty(HasCacheKey, _MappedAttribute, InspectionAttr, util.Memoize is_property: bool def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...): ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = None): ... parent: Any def set_parent(self, parent, init) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -64,7 +64,7 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): __visit_name__: str prop: Any property: Any - def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = ...) -> None: ... + def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = None) -> None: ... def __clause_element__(self) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @property @@ -79,8 +79,8 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): def of_type_op(a, class_): ... def of_type(self, class_): ... def and_(self, *criteria): ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... class StrategizedProperty(MapperProperty): inherit_cache: bool @@ -111,7 +111,7 @@ class CriteriaOption(CompileStateOption): class UserDefinedOption(ORMOption): propagate_to_loaders: bool payload: Any - def __init__(self, payload: Incomplete | None = ...) -> None: ... + def __init__(self, payload: Incomplete | None = None) -> None: ... class MapperOption(ORMOption): propagate_to_loaders: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi index 8341245981e4..328b33ef126b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi @@ -2,18 +2,18 @@ from _typeshed import Incomplete from typing import Any def instances(cursor, context): ... -def merge_frozen_result(session, statement, frozen_result, load: bool = ...): ... -def merge_result(query, iterator, load: bool = ...): ... +def merge_frozen_result(session, statement, frozen_result, load: bool = True): ... +def merge_result(query, iterator, load: bool = True): ... def get_from_identity(session, mapper, key, passive): ... def load_on_ident( session, statement, key, - load_options: Incomplete | None = ..., - refresh_state: Incomplete | None = ..., - with_for_update: Incomplete | None = ..., - only_load_props: Incomplete | None = ..., - no_autoflush: bool = ..., + load_options: Incomplete | None = None, + refresh_state: Incomplete | None = None, + with_for_update: Incomplete | None = None, + only_load_props: Incomplete | None = None, + no_autoflush: bool = False, bind_arguments=..., execution_options=..., ): ... @@ -21,12 +21,12 @@ def load_on_pk_identity( session, statement, primary_key_identity, - load_options: Incomplete | None = ..., - refresh_state: Incomplete | None = ..., - with_for_update: Incomplete | None = ..., - only_load_props: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - no_autoflush: bool = ..., + load_options: Incomplete | None = None, + refresh_state: Incomplete | None = None, + with_for_update: Incomplete | None = None, + only_load_props: Incomplete | None = None, + identity_token: Incomplete | None = None, + no_autoflush: bool = False, bind_arguments=..., execution_options=..., ): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi index 999ad8981258..816e98eb102f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi @@ -46,33 +46,33 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def __init__( self, class_, - local_table: Incomplete | None = ..., - properties: Incomplete | None = ..., - primary_key: Incomplete | None = ..., - non_primary: bool = ..., - inherits: Incomplete | None = ..., - inherit_condition: Incomplete | None = ..., - inherit_foreign_keys: Incomplete | None = ..., - always_refresh: bool = ..., - version_id_col: Incomplete | None = ..., - version_id_generator: Incomplete | None = ..., - polymorphic_on: Incomplete | None = ..., - _polymorphic_map: Incomplete | None = ..., - polymorphic_identity: Incomplete | None = ..., - concrete: bool = ..., - with_polymorphic: Incomplete | None = ..., - polymorphic_load: Incomplete | None = ..., - allow_partial_pks: bool = ..., - batch: bool = ..., - column_prefix: Incomplete | None = ..., - include_properties: Incomplete | None = ..., - exclude_properties: Incomplete | None = ..., - passive_updates: bool = ..., - passive_deletes: bool = ..., - confirm_deleted_rows: bool = ..., - eager_defaults: bool = ..., - legacy_is_orphan: bool = ..., - _compiled_cache_size: int = ..., + local_table: Incomplete | None = None, + properties: Incomplete | None = None, + primary_key: Incomplete | None = None, + non_primary: bool = False, + inherits: Incomplete | None = None, + inherit_condition: Incomplete | None = None, + inherit_foreign_keys: Incomplete | None = None, + always_refresh: bool = False, + version_id_col: Incomplete | None = None, + version_id_generator: Incomplete | None = None, + polymorphic_on: Incomplete | None = None, + _polymorphic_map: Incomplete | None = None, + polymorphic_identity: Incomplete | None = None, + concrete: bool = False, + with_polymorphic: Incomplete | None = None, + polymorphic_load: Incomplete | None = None, + allow_partial_pks: bool = True, + batch: bool = True, + column_prefix: Incomplete | None = None, + include_properties: Incomplete | None = None, + exclude_properties: Incomplete | None = None, + passive_updates: bool = True, + passive_deletes: bool = False, + confirm_deleted_rows: bool = True, + eager_defaults: bool = False, + legacy_is_orphan: bool = False, + _compiled_cache_size: int = 100, ): ... is_mapper: bool represents_outer_join: bool @@ -92,7 +92,7 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def add_properties(self, dict_of_properties) -> None: ... def add_property(self, key, prop) -> None: ... def has_property(self, key): ... - def get_property(self, key, _configure_mappers: bool = ...): ... + def get_property(self, key, _configure_mappers: bool = True): ... def get_property_by_column(self, column): ... @property def iterate_properties(self): ... @@ -126,11 +126,11 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def primary_mapper(self): ... @property def primary_base_mapper(self): ... - def identity_key_from_row(self, row, identity_token: Incomplete | None = ..., adapter: Incomplete | None = ...): ... - def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = ...): ... + def identity_key_from_row(self, row, identity_token: Incomplete | None = None, adapter: Incomplete | None = None): ... + def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = None): ... def identity_key_from_instance(self, instance): ... def primary_key_from_instance(self, instance): ... - def cascade_iterator(self, type_, state, halt_on: Incomplete | None = ...) -> None: ... + def cascade_iterator(self, type_, state, halt_on: Incomplete | None = None) -> None: ... class _OptGetColumnsNotAvailable(Exception): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi index 9da5d3161f46..8b7e2303352f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -15,7 +15,7 @@ class PathRegistry(HasCacheKey): def __ne__(self, other): ... def set(self, attributes, key, value) -> None: ... def setdefault(self, attributes, key, value) -> None: ... - def get(self, attributes, key, value: Incomplete | None = ...): ... + def get(self, attributes, key, value: Incomplete | None = None): ... def __len__(self) -> int: ... def __hash__(self) -> int: ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi index 8d5d721e7d5e..f6bef4909bd2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi @@ -3,7 +3,7 @@ from typing import Any from ..sql.base import CompileState, Options from ..sql.dml import DeleteDMLState, UpdateDMLState -def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ... +def save_obj(base_mapper, states, uowtransaction, single: bool = False) -> None: ... def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ... def delete_obj(base_mapper, states, uowtransaction) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index ab769f034319..30fd701100d8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -19,11 +19,11 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi logger: Any load_options: Any session: Any - def __init__(self, entities, session: Incomplete | None = ...) -> None: ... + def __init__(self, entities, session: Incomplete | None = None) -> None: ... @property def statement(self): ... - def subquery(self, name: str | None = ..., with_labels: bool = ..., reduce_columns: bool = ...): ... - def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def subquery(self, name: str | None = None, with_labels: bool = False, reduce_columns: bool = False): ... + def cte(self, name: Incomplete | None = None, recursive: bool = False, nesting: bool = False): ... def label(self, name): ... def as_scalar(self): ... def scalar_subquery(self): ... @@ -43,7 +43,7 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi @property def whereclause(self): ... def with_polymorphic( - self, cls_or_mappers, selectable: Incomplete | None = ..., polymorphic_on: Incomplete | None = ... + self, cls_or_mappers, selectable: Incomplete | None = None, polymorphic_on: Incomplete | None = None ) -> Self: ... def yield_per(self, count) -> Self: ... def get(self, ident): ... @@ -52,8 +52,8 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def correlate(self, *fromclauses) -> Self: ... def autoflush(self, setting) -> Self: ... def populate_existing(self) -> Self: ... - def with_parent(self, instance, property: Incomplete | None = ..., from_entity: Incomplete | None = ...): ... - def add_entity(self, entity, alias: Incomplete | None = ...) -> Self: ... + def with_parent(self, instance, property: Incomplete | None = None, from_entity: Incomplete | None = None): ... + def add_entity(self, entity, alias: Incomplete | None = None) -> Self: ... def with_session(self, session) -> Self: ... def from_self(self, *entities): ... def values(self, *columns): ... @@ -66,7 +66,12 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def get_execution_options(self): ... def execution_options(self, **kwargs) -> Self: ... def with_for_update( - self, read: bool = ..., nowait: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + read: bool = False, + nowait: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> Self: ... def params(self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... @@ -100,12 +105,14 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def __iter__(self) -> Iterator[_T]: ... @property def column_descriptions(self): ... - def instances(self, result_proxy, context: Incomplete | None = ...): ... - def merge_result(self, iterator, load: bool = ...): ... + def instances(self, result_proxy, context: Incomplete | None = None): ... + def merge_result(self, iterator, load: bool = True): ... def exists(self): ... def count(self) -> int: ... - def delete(self, synchronize_session: _SynchronizeSessionArgument = ...) -> int: ... - def update(self, values, synchronize_session: _SynchronizeSessionArgument = ..., update_args: Incomplete | None = ...): ... + def delete(self, synchronize_session: _SynchronizeSessionArgument = "evaluate") -> int: ... + def update( + self, values, synchronize_session: _SynchronizeSessionArgument = "evaluate", update_args: Incomplete | None = None + ): ... class FromStatement(GroupedElement, SelectBase, Executable): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi index e7382a512721..cac546132331 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -51,40 +51,40 @@ class RelationshipProperty(StrategizedProperty): def __init__( self, argument, - secondary: Incomplete | None = ..., - primaryjoin: Incomplete | None = ..., - secondaryjoin: Incomplete | None = ..., - foreign_keys: Incomplete | None = ..., - uselist: Incomplete | None = ..., - order_by: bool = ..., - backref: Incomplete | None = ..., - back_populates: Incomplete | None = ..., - overlaps: Incomplete | None = ..., - post_update: bool = ..., - cascade: bool = ..., - viewonly: bool = ..., - lazy: str = ..., - collection_class: Incomplete | None = ..., - passive_deletes=..., - passive_updates=..., - remote_side: Incomplete | None = ..., - enable_typechecks=..., - join_depth: Incomplete | None = ..., - comparator_factory: Incomplete | None = ..., - single_parent: bool = ..., - innerjoin: bool = ..., - distinct_target_key: Incomplete | None = ..., - doc: Incomplete | None = ..., - active_history=..., - cascade_backrefs=..., - load_on_pending: bool = ..., - bake_queries: bool = ..., - _local_remote_pairs: Incomplete | None = ..., - query_class: Incomplete | None = ..., - info: Incomplete | None = ..., - omit_join: Incomplete | None = ..., - sync_backref: Incomplete | None = ..., - _legacy_inactive_history_style: bool = ..., + secondary: Incomplete | None = None, + primaryjoin: Incomplete | None = None, + secondaryjoin: Incomplete | None = None, + foreign_keys: Incomplete | None = None, + uselist: Incomplete | None = None, + order_by: bool = False, + backref: Incomplete | None = None, + back_populates: Incomplete | None = None, + overlaps: Incomplete | None = None, + post_update: bool = False, + cascade: bool = False, + viewonly: bool = False, + lazy: str = "select", + collection_class: Incomplete | None = None, + passive_deletes=False, + passive_updates=True, + remote_side: Incomplete | None = None, + enable_typechecks=True, + join_depth: Incomplete | None = None, + comparator_factory: Incomplete | None = None, + single_parent: bool = False, + innerjoin: bool = False, + distinct_target_key: Incomplete | None = None, + doc: Incomplete | None = None, + active_history=False, + cascade_backrefs=True, + load_on_pending: bool = False, + bake_queries: bool = True, + _local_remote_pairs: Incomplete | None = None, + query_class: Incomplete | None = None, + info: Incomplete | None = None, + omit_join: Incomplete | None = None, + sync_backref: Incomplete | None = None, + _legacy_inactive_history_style: bool = False, ) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -94,9 +94,9 @@ class RelationshipProperty(StrategizedProperty): self, prop, parentmapper, - adapt_to_entity: Incomplete | None = ..., - of_type: Incomplete | None = ..., - extra_criteria=..., + adapt_to_entity: Incomplete | None = None, + of_type: Incomplete | None = None, + extra_criteria=(), ) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @memoized_property @@ -109,8 +109,8 @@ class RelationshipProperty(StrategizedProperty): def in_(self, other) -> ColumnOperators[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] def __eq__(self, other): ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... def contains(self, other, **kwargs) -> ColumnOperators[_T]: ... def __ne__(self, other) -> ColumnOperators[_T]: ... # type: ignore[override] @memoized_property @@ -119,7 +119,7 @@ class RelationshipProperty(StrategizedProperty): def merge( self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map ) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...) -> None: ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = None) -> None: ... @memoized_property def entity(self): ... @memoized_property @@ -151,17 +151,17 @@ class JoinCondition: child_persist_selectable, parent_local_selectable, child_local_selectable, - primaryjoin: Incomplete | None = ..., - secondary: Incomplete | None = ..., - secondaryjoin: Incomplete | None = ..., - parent_equivalents: Incomplete | None = ..., - child_equivalents: Incomplete | None = ..., - consider_as_foreign_keys: Incomplete | None = ..., - local_remote_pairs: Incomplete | None = ..., - remote_side: Incomplete | None = ..., - self_referential: bool = ..., - prop: Incomplete | None = ..., - support_sync: bool = ..., + primaryjoin: Incomplete | None = None, + secondary: Incomplete | None = None, + secondaryjoin: Incomplete | None = None, + parent_equivalents: Incomplete | None = None, + child_equivalents: Incomplete | None = None, + consider_as_foreign_keys: Incomplete | None = None, + local_remote_pairs: Incomplete | None = None, + remote_side: Incomplete | None = None, + self_referential: bool = False, + prop: Incomplete | None = None, + support_sync: bool = True, can_be_synced_fn=..., ): ... @property @@ -177,9 +177,9 @@ class JoinCondition: @memoized_property def foreign_key_columns(self): ... def join_targets( - self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = ..., extra_criteria=... + self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = None, extra_criteria=() ): ... - def create_lazy_clause(self, reverse_direction: bool = ...): ... + def create_lazy_clause(self, reverse_direction: bool = False): ... class _ColInAnnotations: name: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi index 0731e46169c0..4f007eae9b9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi @@ -10,9 +10,9 @@ class ScopedSessionMixin: class scoped_session(ScopedSessionMixin): session_factory: Any registry: Any - def __init__(self, session_factory, scopefunc: Incomplete | None = ...) -> None: ... + def __init__(self, session_factory, scopefunc: Incomplete | None = None) -> None: ... def remove(self) -> None: ... - def query_property(self, query_cls: Incomplete | None = ...): ... + def query_property(self, query_cls: Incomplete | None = None): ... # dynamically proxied from class Session bind: Any identity_map: Any @@ -38,68 +38,68 @@ class scoped_session(ScopedSessionMixin): def object_session(cls, instance): ... def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... - def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin(self, subtransactions: bool = False, nested: bool = False, _subtrans: bool = False): ... def begin_nested(self): ... def close(self) -> None: ... def commit(self) -> None: ... def connection( self, - bind_arguments: Incomplete | None = ..., - close_with_result: bool = ..., - execution_options: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + close_with_result: bool = False, + execution_options: Incomplete | None = None, **kw, ): ... def delete(self, instance) -> None: ... def execute( self, statement, - params: Incomplete | None = ..., + params: Incomplete | None = None, execution_options=..., - bind_arguments: Incomplete | None = ..., - _parent_execute_state: Incomplete | None = ..., - _add_event: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + _parent_execute_state: Incomplete | None = None, + _add_event: Incomplete | None = None, **kw, ): ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def flush(self, objects: Incomplete | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = None) -> None: ... def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - execution_options: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, + execution_options: Incomplete | None = None, ): ... def get_bind( self, - mapper: Incomplete | None = ..., - clause: Incomplete | None = ..., - bind: Incomplete | None = ..., - _sa_skip_events: Incomplete | None = ..., - _sa_skip_for_implicit_returning: bool = ..., + mapper: Incomplete | None = None, + clause: Incomplete | None = None, + bind: Incomplete | None = None, + _sa_skip_events: Incomplete | None = None, + _sa_skip_for_implicit_returning: bool = False, ): ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... def bulk_save_objects( - self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + self, objects, return_defaults: bool = False, update_changed_only: bool = True, preserve_order: bool = True ): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = False, render_nulls: bool = False) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... def query(self, *entities, **kwargs): ... - def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None) -> None: ... def rollback(self) -> None: ... def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... ScopedSession = scoped_session diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index 9f60a2669e58..91ef8ebe299d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -34,10 +34,10 @@ class ORMExecuteState(MemoizedSlots): ) -> None: ... def invoke_statement( self, - statement: Incomplete | None = ..., - params: Incomplete | None = ..., - execution_options: Incomplete | None = ..., - bind_arguments: Incomplete | None = ..., + statement: Incomplete | None = None, + params: Incomplete | None = None, + execution_options: Incomplete | None = None, + bind_arguments: Incomplete | None = None, ): ... @property def bind_mapper(self): ... @@ -72,16 +72,16 @@ class ORMExecuteState(MemoizedSlots): class SessionTransaction(TransactionalContext): session: Any nested: Any - def __init__(self, session, parent: Incomplete | None = ..., nested: bool = ..., autobegin: bool = ...) -> None: ... + def __init__(self, session, parent: Incomplete | None = None, nested: bool = False, autobegin: bool = False) -> None: ... @property def parent(self): ... @property def is_active(self): ... - def connection(self, bindkey, execution_options: Incomplete | None = ..., **kwargs): ... + def connection(self, bindkey, execution_options: Incomplete | None = None, **kwargs): ... def prepare(self) -> None: ... - def commit(self, _to_root: bool = ...): ... - def rollback(self, _capture_exception: bool = ..., _to_root: bool = ...): ... - def close(self, invalidate: bool = ...) -> None: ... + def commit(self, _to_root: bool = False): ... + def rollback(self, _capture_exception: bool = False, _to_root: bool = False): ... + def close(self, invalidate: bool = False) -> None: ... class Session(_SessionClassMethods): identity_map: Any @@ -95,16 +95,16 @@ class Session(_SessionClassMethods): twophase: Any def __init__( self, - bind: Incomplete | None = ..., - autoflush: bool = ..., - future: bool = ..., - expire_on_commit: bool = ..., - autocommit: bool = ..., - twophase: bool = ..., - binds: Incomplete | None = ..., - enable_baked_queries: bool = ..., - info: Incomplete | None = ..., - query_cls: Incomplete | None = ..., + bind: Incomplete | None = None, + autoflush: bool = True, + future: bool = False, + expire_on_commit: bool = True, + autocommit: bool = False, + twophase: bool = False, + binds: Incomplete | None = None, + enable_baked_queries: bool = True, + info: Incomplete | None = None, + query_cls: Incomplete | None = None, ) -> None: ... connection_callable: Any def __enter__(self) -> Self: ... @@ -119,7 +119,7 @@ class Session(_SessionClassMethods): def get_nested_transaction(self): ... @memoized_property def info(self): ... - def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin(self, subtransactions: bool = False, nested: bool = False, _subtrans: bool = False): ... def begin_nested(self): ... def rollback(self) -> None: ... def commit(self) -> None: ... @@ -127,26 +127,26 @@ class Session(_SessionClassMethods): # TODO: bind_arguments could use a TypedDict def connection( self, - bind_arguments: Mapping[str, Any] | None = ..., - close_with_result: bool = ..., - execution_options: Mapping[str, Any] | None = ..., + bind_arguments: Mapping[str, Any] | None = None, + close_with_result: bool = False, + execution_options: Mapping[str, Any] | None = None, **kw: Any, ) -> Connection: ... def execute( self, statement, - params: Incomplete | None = ..., + params: Incomplete | None = None, execution_options=..., - bind_arguments: Incomplete | None = ..., - _parent_execute_state: Incomplete | None = ..., - _add_event: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + _parent_execute_state: Incomplete | None = None, + _add_event: Incomplete | None = None, **kw, ) -> Result: ... def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def close(self) -> None: ... def invalidate(self) -> None: ... @@ -155,11 +155,11 @@ class Session(_SessionClassMethods): def bind_table(self, table, bind) -> None: ... def get_bind( self, - mapper: Incomplete | None = ..., - clause: Incomplete | None = ..., - bind: Incomplete | None = ..., - _sa_skip_events: Incomplete | None = ..., - _sa_skip_for_implicit_returning: bool = ..., + mapper: Incomplete | None = None, + clause: Incomplete | None = None, + bind: Incomplete | None = None, + _sa_skip_events: Incomplete | None = None, + _sa_skip_for_implicit_returning: bool = False, ): ... @overload def query(self, entities: Table, **kwargs: Any) -> Query[Any]: ... @@ -171,34 +171,34 @@ class Session(_SessionClassMethods): def query(self, *entities: type[_T], **kwargs: Any) -> Query[_T]: ... @property def no_autoflush(self) -> None: ... - def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expunge(self, instance) -> None: ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... def delete(self, instance) -> None: ... def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - execution_options: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, + execution_options: Incomplete | None = None, ): ... - def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... def enable_relationship_loading(self, obj) -> None: ... def __contains__(self, instance): ... def __iter__(self): ... - def flush(self, objects: Incomplete | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = None) -> None: ... def bulk_save_objects( - self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + self, objects, return_defaults: bool = False, update_changed_only: bool = True, preserve_order: bool = True ): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = False, render_nulls: bool = False) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... @property def is_active(self): ... @property @@ -213,12 +213,12 @@ class sessionmaker(_SessionClassMethods): class_: Any def __init__( self, - bind: Incomplete | None = ..., + bind: Incomplete | None = None, class_=..., - autoflush: bool = ..., - autocommit: bool = ..., - expire_on_commit: bool = ..., - info: Incomplete | None = ..., + autoflush: bool = True, + autocommit: bool = False, + expire_on_commit: bool = True, + info: Incomplete | None = None, **kw, ) -> None: ... def begin(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi index f4b9508149f5..7ca4a1c2dcf4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi @@ -8,7 +8,7 @@ class UninstrumentedColumnLoader(LoaderStrategy): columns: Any def __init__(self, parent, strategy_key) -> None: ... def setup_query( - self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = ..., **kwargs + self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = None, **kwargs ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -17,7 +17,7 @@ class ColumnLoader(LoaderStrategy): columns: Any is_composite: Any def __init__(self, parent, strategy_key) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = ..., **kwargs) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = False, **kwargs) -> None: ... # type: ignore[override] is_class_level: bool def init_class_attribute(self, mapper) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -39,12 +39,12 @@ class DeferredColumnLoader(LoaderStrategy): def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... is_class_level: bool def init_class_attribute(self, mapper) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = None, **kw) -> None: ... # type: ignore[override] class LoadDeferredColumns: key: Any raiseload: Any - def __init__(self, key, raiseload: bool = ...) -> None: ... + def __init__(self, key, raiseload: bool = False) -> None: ... def __call__(self, state, passive=...): ... class AbstractRelationshipLoader(LoaderStrategy): @@ -116,9 +116,9 @@ class JoinedLoader(AbstractRelationshipLoader): path, loadopt, adapter, - column_collection: Incomplete | None = ..., - parentmapper: Incomplete | None = ..., - chained_from_outerjoin: bool = ..., + column_collection: Incomplete | None = None, + parentmapper: Incomplete | None = None, + chained_from_outerjoin: bool = False, **kwargs, ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index cf9761cfb3ee..48321a09b0be 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -20,22 +20,22 @@ class Load(Generative, LoaderOption): def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... def options(self, *opts) -> Self: ... - def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... - def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = True) -> Self: ... + def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = None, opts_only: bool = False) -> Self: ... def set_generic_strategy(self, attrs, strategy) -> Self: ... def set_class_strategy(self, strategy, opts) -> Self: ... # Added dynamically at runtime - def contains_eager(loadopt, attr, alias: Incomplete | None = ...) -> Self: ... + def contains_eager(loadopt, attr, alias: Incomplete | None = None) -> Self: ... def load_only(loadopt, *attrs) -> Self: ... - def joinedload(loadopt, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = None) -> Self: ... def subqueryload(loadopt, attr) -> Self: ... def selectinload(loadopt, attr) -> Self: ... def lazyload(loadopt, attr) -> Self: ... def immediateload(loadopt, attr) -> Self: ... def noload(loadopt, attr) -> Self: ... - def raiseload(loadopt, attr, sql_only: bool = ...) -> Self: ... + def raiseload(loadopt, attr, sql_only: bool = False) -> Self: ... def defaultload(loadopt, attr) -> Self: ... - def defer(loadopt, key, raiseload: bool = ...) -> Self: ... + def defer(loadopt, key, raiseload: bool = False) -> Self: ... def undefer(loadopt, key) -> Self: ... def undefer_group(loadopt, name) -> Self: ... def with_expression(loadopt, key, expression) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi index 20de2df97427..26b13e383029 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi @@ -26,11 +26,11 @@ class UOWTransaction: def register_object( self, state, - isdelete: bool = ..., - listonly: bool = ..., - cancel_delete: bool = ..., - operation: Incomplete | None = ..., - prop: Incomplete | None = ..., + isdelete: bool = False, + listonly: bool = False, + cancel_delete: bool = False, + operation: Incomplete | None = None, + prop: Incomplete | None = None, ): ... def register_post_update(self, state, post_update_cols) -> None: ... def filter_states_for_dep(self, dep, states): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi index b7c6fd4f7d78..cb7e9f809ea9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi @@ -32,7 +32,7 @@ class CascadeOptions(frozenset[Any]): @classmethod def from_string(cls, arg): ... -def polymorphic_union(table_map, typecolname, aliasname: str = ..., cast_nulls: bool = ...): ... +def polymorphic_union(table_map, typecolname, aliasname: str = "p_union", cast_nulls: bool = True): ... def identity_key(*args, **kwargs): ... class ORMAdapter(sql_util.ColumnAdapter): @@ -41,10 +41,10 @@ class ORMAdapter(sql_util.ColumnAdapter): def __init__( self, entity, - equivalents: Incomplete | None = ..., - adapt_required: bool = ..., - allow_label_resolve: bool = ..., - anonymize_labels: bool = ..., + equivalents: Incomplete | None = None, + adapt_required: bool = False, + allow_label_resolve: bool = True, + anonymize_labels: bool = False, ) -> None: ... class AliasedClass: @@ -52,15 +52,15 @@ class AliasedClass: def __init__( self, mapped_class_or_ac, - alias: Incomplete | None = ..., - name: Incomplete | None = ..., - flat: bool = ..., - adapt_on_names: bool = ..., - with_polymorphic_mappers=..., - with_polymorphic_discriminator: Incomplete | None = ..., - base_alias: Incomplete | None = ..., - use_mapper_path: bool = ..., - represents_outer_join: bool = ..., + alias: Incomplete | None = None, + name: Incomplete | None = None, + flat: bool = False, + adapt_on_names: bool = False, + with_polymorphic_mappers=(), + with_polymorphic_discriminator: Incomplete | None = None, + base_alias: Incomplete | None = None, + use_mapper_path: bool = False, + represents_outer_join: bool = False, ) -> None: ... def __getattr__(self, key: str): ... @@ -110,29 +110,29 @@ class LoaderCriteriaOption(CriteriaOption): self, entity_or_base, where_criteria, - loader_only: bool = ..., - include_aliases: bool = ..., - propagate_to_loaders: bool = ..., - track_closure_variables: bool = ..., + loader_only: bool = False, + include_aliases: bool = False, + propagate_to_loaders: bool = True, + track_closure_variables: bool = True, ) -> None: ... def process_compile_state_replaced_entities(self, compile_state, mapper_entities): ... def process_compile_state(self, compile_state) -> None: ... def get_global_criteria(self, attributes) -> None: ... def aliased( - element, alias: Incomplete | None = ..., name: Incomplete | None = ..., flat: bool = ..., adapt_on_names: bool = ... + element, alias: Incomplete | None = None, name: Incomplete | None = None, flat: bool = False, adapt_on_names: bool = False ): ... def with_polymorphic( base, classes, - selectable: bool = ..., - flat: bool = ..., - polymorphic_on: Incomplete | None = ..., - aliased: bool = ..., - adapt_on_names: bool = ..., - innerjoin: bool = ..., - _use_mapper_path: bool = ..., - _existing_alias: Incomplete | None = ..., + selectable: bool = False, + flat: bool = False, + polymorphic_on: Incomplete | None = None, + aliased: bool = False, + adapt_on_names: bool = False, + innerjoin: bool = False, + _use_mapper_path: bool = False, + _existing_alias: Incomplete | None = None, ) -> AliasedClass: ... class Bundle(ORMColumnsClauseRole, SupportsCloneAnnotations, sql_base.MemoizedHasCacheKey, InspectionAttr): @@ -166,28 +166,35 @@ class _ORMJoin(expression.Join): self, left, right, - onclause: Incomplete | None = ..., - isouter: bool = ..., - full: bool = ..., - _left_memo: Incomplete | None = ..., - _right_memo: Incomplete | None = ..., - _extra_criteria=..., + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + _left_memo: Incomplete | None = None, + _right_memo: Incomplete | None = None, + _extra_criteria=(), ) -> None: ... def join( self, right, - onclause: Incomplete | None = ..., - isouter: bool = ..., - full: bool = ..., - join_to_left: Incomplete | None = ..., + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + join_to_left: Incomplete | None = None, + ): ... + def outerjoin( + self, right, onclause: Incomplete | None = None, full: bool = False, join_to_left: Incomplete | None = None ): ... - def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... def join( - left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Incomplete | None = ... + left, + right, + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + join_to_left: Incomplete | None = None, ): ... -def outerjoin(left, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... -def with_parent(instance, prop, from_entity: Incomplete | None = ...): ... +def outerjoin(left, right, onclause: Incomplete | None = None, full: bool = False, join_to_left: Incomplete | None = None): ... +def with_parent(instance, prop, from_entity: Incomplete | None = None): ... def has_identity(object_): ... def was_deleted(object_): ... def randomize_unitofwork() -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index 14e6e99b8afc..0a22c6e1741a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -27,14 +27,14 @@ class Pool(log.Identified): def __init__( self, creator: Callable[[], DBAPIConnection], - recycle: int = ..., - echo: Incomplete | None = ..., - logging_name: Incomplete | None = ..., - reset_on_return: bool = ..., - events: Incomplete | None = ..., - dialect: Incomplete | None = ..., - pre_ping: bool = ..., - _dispatch: Incomplete | None = ..., + recycle: int = -1, + echo: Incomplete | None = None, + logging_name: Incomplete | None = None, + reset_on_return: bool = True, + events: Incomplete | None = None, + dialect: Incomplete | None = None, + pre_ping: bool = False, + _dispatch: Incomplete | None = None, ) -> None: ... def recreate(self) -> None: ... def dispose(self) -> None: ... @@ -43,7 +43,7 @@ class Pool(log.Identified): class _ConnectionRecord: finalize_callback: Any - def __init__(self, pool, connect: bool = ...) -> None: ... + def __init__(self, pool, connect: bool = True) -> None: ... fresh: bool fairy_ref: Any starttime: Any @@ -60,13 +60,13 @@ class _ConnectionRecord: def record_info(self): ... @classmethod def checkout(cls, pool): ... - def checkin(self, _fairy_was_created: bool = ...) -> None: ... + def checkin(self, _fairy_was_created: bool = True) -> None: ... @property def in_use(self): ... @property def last_connect_time(self): ... def close(self) -> None: ... - def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = None, soft: bool = False) -> None: ... def get_connection(self): ... class _ConnectionFairy: @@ -84,7 +84,7 @@ class _ConnectionFairy: def info(self): ... @property def record_info(self): ... - def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = None, soft: bool = False) -> None: ... def cursor(self, *args, **kwargs): ... def __getattr__(self, key: str): ... def detach(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi index 2646cafd536d..88eb1fb2ea60 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi @@ -5,7 +5,7 @@ from .base import Pool class QueuePool(Pool): def __init__( - self, creator, pool_size: int = ..., max_overflow: int = ..., timeout: float = ..., use_lifo: bool = ..., **kw + self, creator, pool_size: int = 5, max_overflow: int = 10, timeout: float = 30.0, use_lifo: bool = False, **kw ) -> None: ... def recreate(self): ... def dispose(self) -> None: ... @@ -26,7 +26,7 @@ class NullPool(Pool): class SingletonThreadPool(Pool): size: Any - def __init__(self, creator, pool_size: int = ..., **kw) -> None: ... + def __init__(self, creator, pool_size: int = 5, **kw) -> None: ... def recreate(self): ... def dispose(self) -> None: ... def status(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/processors.pyi b/stubs/SQLAlchemy/sqlalchemy/processors.pyi index 2c74bf49992d..26ee40a7c386 100644 --- a/stubs/SQLAlchemy/sqlalchemy/processors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/processors.pyi @@ -2,6 +2,6 @@ from _typeshed import Incomplete def str_to_datetime_processor_factory(regexp, type_): ... def py_fallback(): ... -def to_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... -def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... +def to_unicode_processor_factory(encoding, errors: Incomplete | None = None): ... +def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = None): ... def to_decimal_processor_factory(target_class, scale): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 2218cb44fb9e..bf12c6fd34cb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -116,7 +116,7 @@ class SchemaVisitor(ClauseVisitor): __traverse_options__: Any class ColumnCollection: - def __init__(self, columns: Incomplete | None = ...) -> None: ... + def __init__(self, columns: Incomplete | None = None) -> None: ... def keys(self): ... def values(self): ... def items(self): ... @@ -128,7 +128,7 @@ class ColumnCollection: def __contains__(self, key): ... def compare(self, other): ... def __eq__(self, other): ... - def get(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... def __setattr__(self, key: str, obj) -> None: ... @@ -136,13 +136,13 @@ class ColumnCollection: def remove(self, column) -> None: ... def update(self, iter_) -> None: ... __hash__: ClassVar[None] # type: ignore[assignment] - def add(self, column, key: Incomplete | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = None) -> None: ... def contains_column(self, col): ... def as_immutable(self): ... - def corresponding_column(self, column, require_embedded: bool = ...): ... + def corresponding_column(self, column, require_embedded: bool = False): ... class DedupeColumnCollection(ColumnCollection): - def add(self, column, key: Incomplete | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = None) -> None: ... def extend(self, iter_) -> None: ... def remove(self, column) -> None: ... def replace(self, column) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi index 034252252300..605ed309ac66 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi @@ -13,9 +13,9 @@ traversals: Any def expect( role, element, - apply_propagate_attrs: Incomplete | None = ..., - argname: Incomplete | None = ..., - post_inspect: bool = ..., + apply_propagate_attrs: Incomplete | None = None, + argname: Incomplete | None = None, + post_inspect: bool = False, **kw, ): ... def expect_as_key(role, element, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index bd521727bdfa..c10001f35fab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -38,7 +38,7 @@ WARN_LINTING: Incomplete FROM_LINTING: Incomplete class FromLinter: - def lint(self, start: Incomplete | None = ...): ... + def lint(self, start: Incomplete | None = None): ... def warn(self) -> None: ... class Compiled: @@ -55,8 +55,8 @@ class Compiled: self, dialect, statement, - schema_translate_map: Incomplete | None = ..., - render_schema_translate: bool = ..., + schema_translate_map: Incomplete | None = None, + render_schema_translate: bool = False, compile_kwargs=..., ) -> None: ... def visit_unsupported_compilation(self, element, err) -> None: ... @@ -64,7 +64,7 @@ class Compiled: def sql_compiler(self) -> None: ... def process(self, obj, **kwargs): ... def construct_params( - self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... + self, params: Incomplete | None = None, extracted_parameters: Incomplete | None = None, escape_names: bool = True ) -> None: ... @property def params(self): ... @@ -80,7 +80,7 @@ class _CompileLabel(elements.ColumnElement[Incomplete]): __visit_name__: str element: Incomplete name: Incomplete - def __init__(self, col, name, alt_names=...) -> None: ... + def __init__(self, col, name, alt_names=()) -> None: ... @property def proxy_set(self): ... @property @@ -125,9 +125,9 @@ class SQLCompiler(Compiled): self, dialect, statement, - cache_key: Incomplete | None = ..., - column_keys: Incomplete | None = ..., - for_executemany: bool = ..., + cache_key: Incomplete | None = None, + column_keys: Incomplete | None = None, + for_executemany: bool = False, linting=..., **kwargs, ) -> None: ... @@ -138,27 +138,27 @@ class SQLCompiler(Compiled): def is_subquery(self): ... @property def sql_compiler(self): ... - def construct_params(self, params: Incomplete | None = ..., _group_number: Incomplete | None = ..., _check: bool = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ...): ... # type: ignore[override] + def construct_params(self, params: Incomplete | None = None, _group_number: Incomplete | None = None, _check: bool = True, extracted_parameters: Incomplete | None = None, escape_names: bool = True): ... # type: ignore[override] @property def params(self): ... def default_from(self): ... - def visit_grouping(self, grouping, asfrom: bool = ..., **kwargs): ... + def visit_grouping(self, grouping, asfrom: bool = False, **kwargs): ... def visit_select_statement_grouping(self, grouping, **kwargs): ... - def visit_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... - def visit_textual_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... + def visit_label_reference(self, element, within_columns_clause: bool = False, **kwargs): ... + def visit_textual_label_reference(self, element, within_columns_clause: bool = False, **kwargs): ... def visit_label( self, label, - add_to_result_map: Incomplete | None = ..., - within_label_clause: bool = ..., - within_columns_clause: bool = ..., - render_label_as_label: Incomplete | None = ..., - result_map_targets=..., + add_to_result_map: Incomplete | None = None, + within_label_clause: bool = False, + within_columns_clause: bool = False, + render_label_as_label: Incomplete | None = None, + result_map_targets=(), **kw, ): ... def visit_lambda_element(self, element, **kw): ... def visit_column( - self, column, add_to_result_map: Incomplete | None = ..., include_table: bool = ..., result_map_targets=..., **kwargs + self, column, add_to_result_map: Incomplete | None = None, include_table: bool = True, result_map_targets=(), **kwargs ): ... def visit_collation(self, element, **kw): ... def visit_fromclause(self, fromclause, **kwargs): ... @@ -166,8 +166,8 @@ class SQLCompiler(Compiled): def visit_typeclause(self, typeclause, **kw): ... def post_process_text(self, text): ... def escape_literal_column(self, text): ... - def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = ..., **kw): ... - def visit_textual_select(self, taf, compound_index: Incomplete | None = ..., asfrom: bool = ..., **kw): ... + def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = None, **kw): ... + def visit_textual_select(self, taf, compound_index: Incomplete | None = None, asfrom: bool = False, **kw): ... def visit_null(self, expr, **kw): ... def visit_true(self, expr, **kw): ... def visit_false(self, expr, **kw): ... @@ -181,13 +181,13 @@ class SQLCompiler(Compiled): def visit_funcfilter(self, funcfilter, **kwargs): ... def visit_extract(self, extract, **kwargs): ... def visit_scalar_function_column(self, element, **kw): ... - def visit_function(self, func, add_to_result_map: Incomplete | None = ..., **kwargs): ... + def visit_function(self, func, add_to_result_map: Incomplete | None = None, **kwargs): ... def visit_next_value_func(self, next_value, **kw): ... def visit_sequence(self, sequence, **kw) -> None: ... def function_argspec(self, func, **kwargs): ... compile_state: Incomplete - def visit_compound_select(self, cs, asfrom: bool = ..., compound_index: Incomplete | None = ..., **kwargs): ... - def visit_unary(self, unary, add_to_result_map: Incomplete | None = ..., result_map_targets=..., **kw): ... + def visit_compound_select(self, cs, asfrom: bool = False, compound_index: Incomplete | None = None, **kwargs): ... + def visit_unary(self, unary, add_to_result_map: Incomplete | None = None, result_map_targets=(), **kw): ... def visit_is_true_unary_operator(self, element, operator, **kw): ... def visit_is_false_unary_operator(self, element, operator, **kw): ... def visit_not_match_op_binary(self, binary, operator, **kw): ... @@ -197,10 +197,10 @@ class SQLCompiler(Compiled): def visit_binary( self, binary, - override_operator: Incomplete | None = ..., - eager_grouping: bool = ..., - from_linter: Incomplete | None = ..., - lateral_from_linter: Incomplete | None = ..., + override_operator: Incomplete | None = None, + eager_grouping: bool = False, + from_linter: Incomplete | None = None, + lateral_from_linter: Incomplete | None = None, **kw, ): ... def visit_function_as_comparison_op_binary(self, element, operator, **kw): ... @@ -226,24 +226,24 @@ class SQLCompiler(Compiled): def visit_bindparam( self, bindparam, - within_columns_clause: bool = ..., - literal_binds: bool = ..., - skip_bind_expression: bool = ..., - literal_execute: bool = ..., - render_postcompile: bool = ..., + within_columns_clause: bool = False, + literal_binds: bool = False, + skip_bind_expression: bool = False, + literal_execute: bool = False, + render_postcompile: bool = False, **kwargs, ): ... def render_literal_bindparam( - self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = ..., **kw + self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = None, **kw ): ... def render_literal_value(self, value, type_): ... def bindparam_string( self, name, - positional_names: Incomplete | None = ..., - post_compile: bool = ..., - expanding: bool = ..., - escaped_from: Incomplete | None = ..., + positional_names: Incomplete | None = None, + post_compile: bool = False, + expanding: bool = False, + escaped_from: Incomplete | None = None, **kw, ): ... execution_options: Incomplete @@ -251,11 +251,11 @@ class SQLCompiler(Compiled): def visit_cte( self, cte, - asfrom: bool = ..., - ashint: bool = ..., - fromhints: Incomplete | None = ..., - visiting_cte: Incomplete | None = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + ashint: bool = False, + fromhints: Incomplete | None = None, + visiting_cte: Incomplete | None = None, + from_linter: Incomplete | None = None, **kwargs, ): ... def visit_table_valued_alias(self, element, **kw): ... @@ -263,20 +263,20 @@ class SQLCompiler(Compiled): def visit_alias( self, alias, - asfrom: bool = ..., - ashint: bool = ..., - iscrud: bool = ..., - fromhints: Incomplete | None = ..., - subquery: bool = ..., - lateral: bool = ..., - enclosing_alias: Incomplete | None = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + ashint: bool = False, + iscrud: bool = False, + fromhints: Incomplete | None = None, + subquery: bool = False, + lateral: bool = False, + enclosing_alias: Incomplete | None = None, + from_linter: Incomplete | None = None, **kwargs, ): ... def visit_subquery(self, subquery, **kw): ... def visit_lateral(self, lateral_, **kw): ... - def visit_tablesample(self, tablesample, asfrom: bool = ..., **kw): ... - def visit_values(self, element, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kw): ... + def visit_tablesample(self, tablesample, asfrom: bool = False, **kw): ... + def visit_values(self, element, asfrom: bool = False, from_linter: Incomplete | None = None, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... def format_from_hint_text(self, sqltext, table, hint, iscrud): ... def get_select_hint_text(self, byfroms) -> None: ... @@ -287,13 +287,13 @@ class SQLCompiler(Compiled): def visit_select( self, select_stmt, - asfrom: bool = ..., - insert_into: bool = ..., - fromhints: Incomplete | None = ..., - compound_index: Incomplete | None = ..., - select_wraps_for: Incomplete | None = ..., - lateral: bool = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + insert_into: bool = False, + fromhints: Incomplete | None = None, + compound_index: Incomplete | None = None, + select_wraps_for: Incomplete | None = None, + lateral: bool = False, + from_linter: Incomplete | None = None, **kwargs, ): ... def get_cte_preamble(self, recursive): ... @@ -307,15 +307,15 @@ class SQLCompiler(Compiled): def visit_table( self, table, - asfrom: bool = ..., - iscrud: bool = ..., - ashint: bool = ..., - fromhints: Incomplete | None = ..., - use_schema: bool = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + iscrud: bool = False, + ashint: bool = False, + fromhints: Incomplete | None = None, + use_schema: bool = True, + from_linter: Incomplete | None = None, **kwargs, ): ... - def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ... + def visit_join(self, join, asfrom: bool = False, from_linter: Incomplete | None = None, **kwargs): ... def visit_insert(self, insert_stmt, **kw): ... def update_limit_clause(self, update_stmt) -> None: ... def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... @@ -349,17 +349,17 @@ class DDLCompiler(Compiled): @memoized_property def type_compiler(self): ... def construct_params( - self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... + self, params: Incomplete | None = None, extracted_parameters: Incomplete | None = None, escape_names: bool = True ) -> None: ... def visit_ddl(self, ddl, **kwargs): ... def visit_create_schema(self, create, **kw): ... def visit_drop_schema(self, drop, **kw): ... def visit_create_table(self, create, **kw): ... - def visit_create_column(self, create, first_pk: bool = ..., **kw): ... - def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = ..., **kw): ... + def visit_create_column(self, create, first_pk: bool = False, **kw): ... + def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = None, **kw): ... def visit_drop_table(self, drop, **kw): ... def visit_drop_view(self, drop, **kw): ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ..., **kw): ... + def visit_create_index(self, create, include_schema: bool = False, include_table_schema: bool = True, **kw): ... def visit_drop_index(self, drop, **kw): ... def visit_add_constraint(self, create, **kw): ... def visit_set_table_comment(self, create, **kw): ... @@ -367,7 +367,7 @@ class DDLCompiler(Compiled): def visit_set_column_comment(self, create, **kw): ... def visit_drop_column_comment(self, drop, **kw): ... def get_identity_options(self, identity_options): ... - def visit_create_sequence(self, create, prefix: Incomplete | None = ..., **kw): ... + def visit_create_sequence(self, create, prefix: Incomplete | None = None, **kw): ... def visit_drop_sequence(self, drop, **kw): ... def visit_drop_constraint(self, drop, **kw): ... def get_column_specification(self, column, **kwargs): ... @@ -451,36 +451,36 @@ class IdentifierPreparer: def __init__( self, dialect, - initial_quote: str = ..., - final_quote: Incomplete | None = ..., - escape_quote: str = ..., - quote_case_sensitive_collations: bool = ..., - omit_schema: bool = ..., + initial_quote: str = '"', + final_quote: Incomplete | None = None, + escape_quote: str = '"', + quote_case_sensitive_collations: bool = True, + omit_schema: bool = False, ) -> None: ... def validate_sql_phrase(self, element, reg): ... def quote_identifier(self, value): ... - def quote_schema(self, schema, force: Incomplete | None = ...): ... - def quote(self, ident, force: Incomplete | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = None): ... + def quote(self, ident, force: Incomplete | None = None): ... def format_collation(self, collation_name): ... - def format_sequence(self, sequence, use_schema: bool = ...): ... - def format_label(self, label, name: Incomplete | None = ...): ... - def format_alias(self, alias, name: Incomplete | None = ...): ... - def format_savepoint(self, savepoint, name: Incomplete | None = ...): ... - def format_constraint(self, constraint, _alembic_quote: bool = ...): ... - def truncate_and_render_index_name(self, name, _alembic_quote: bool = ...): ... - def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = ...): ... + def format_sequence(self, sequence, use_schema: bool = True): ... + def format_label(self, label, name: Incomplete | None = None): ... + def format_alias(self, alias, name: Incomplete | None = None): ... + def format_savepoint(self, savepoint, name: Incomplete | None = None): ... + def format_constraint(self, constraint, _alembic_quote: bool = True): ... + def truncate_and_render_index_name(self, name, _alembic_quote: bool = True): ... + def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = True): ... def format_index(self, index): ... - def format_table(self, table, use_schema: bool = ..., name: Incomplete | None = ...): ... + def format_table(self, table, use_schema: bool = True, name: Incomplete | None = None): ... def format_schema(self, name): ... - def format_label_name(self, name, anon_map: Incomplete | None = ...): ... + def format_label_name(self, name, anon_map: Incomplete | None = None): ... def format_column( self, column, - use_table: bool = ..., - name: Incomplete | None = ..., - table_name: Incomplete | None = ..., - use_schema: bool = ..., - anon_map: Incomplete | None = ..., + use_table: bool = False, + name: Incomplete | None = None, + table_name: Incomplete | None = None, + use_schema: bool = False, + anon_map: Incomplete | None = None, ): ... - def format_table_seq(self, table, use_schema: bool = ...): ... + def format_table_seq(self, table, use_schema: bool = True): ... def unformat_identifiers(self, identifiers): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi index 5d34ce026300..4749fedd2bba 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi @@ -12,11 +12,11 @@ class DDLElement(roles.DDLRole, Executable, _DDLCompiles): on: Any dialect: Any callable_: Any - def execute(self, bind: Incomplete | None = ..., target: Incomplete | None = ...): ... # type: ignore[override] + def execute(self, bind: Incomplete | None = None, target: Incomplete | None = None): ... # type: ignore[override] def against(self, target) -> None: ... state: Any def execute_if( - self, dialect: Incomplete | None = ..., callable_: Incomplete | None = ..., state: Incomplete | None = ... + self, dialect: Incomplete | None = None, callable_: Incomplete | None = None, state: Incomplete | None = None ) -> None: ... def __call__(self, target, bind, **kw): ... bind: Any @@ -25,7 +25,7 @@ class DDL(DDLElement): __visit_name__: str statement: Any context: Any - def __init__(self, statement, context: Incomplete | None = ..., bind: Incomplete | None = ...) -> None: ... + def __init__(self, statement, context: Incomplete | None = None, bind: Incomplete | None = None) -> None: ... class _CreateDropBase(DDLElement): element: Any @@ -35,10 +35,10 @@ class _CreateDropBase(DDLElement): def __init__( self, element, - bind: Incomplete | None = ..., - if_exists: bool = ..., - if_not_exists: bool = ..., - _legacy_bind: Incomplete | None = ..., + bind: Incomplete | None = None, + if_exists: bool = False, + if_not_exists: bool = False, + _legacy_bind: Incomplete | None = None, ) -> None: ... @property def stringify_dialect(self): ... @@ -46,13 +46,13 @@ class _CreateDropBase(DDLElement): class CreateSchema(_CreateDropBase): __visit_name__: str quote: Any - def __init__(self, name, quote: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = None, **kw) -> None: ... class DropSchema(_CreateDropBase): __visit_name__: str quote: Any cascade: Any - def __init__(self, name, quote: Incomplete | None = ..., cascade: bool = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = None, cascade: bool = False, **kw) -> None: ... class CreateTable(_CreateDropBase): __visit_name__: str @@ -61,9 +61,9 @@ class CreateTable(_CreateDropBase): def __init__( self, element, - bind: Incomplete | None = ..., - include_foreign_key_constraints: Incomplete | None = ..., - if_not_exists: bool = ..., + bind: Incomplete | None = None, + include_foreign_key_constraints: Incomplete | None = None, + if_not_exists: bool = False, ) -> None: ... class _DropView(_CreateDropBase): @@ -76,7 +76,7 @@ class CreateColumn(_DDLCompiles): class DropTable(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_exists: bool = False) -> None: ... class CreateSequence(_CreateDropBase): __visit_name__: str @@ -86,11 +86,11 @@ class DropSequence(_CreateDropBase): class CreateIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_not_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_not_exists: bool = False) -> None: ... class DropIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_exists: bool = False) -> None: ... class AddConstraint(_CreateDropBase): __visit_name__: str @@ -99,7 +99,7 @@ class AddConstraint(_CreateDropBase): class DropConstraint(_CreateDropBase): __visit_name__: str cascade: Any - def __init__(self, element, cascade: bool = ..., **kw) -> None: ... + def __init__(self, element, cascade: bool = False, **kw) -> None: ... class SetTableComment(_CreateDropBase): __visit_name__: str @@ -123,18 +123,18 @@ class SchemaGenerator(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, tables: Incomplete | None = None, **kwargs) -> None: ... def visit_metadata(self, metadata) -> None: ... def visit_table( self, table, - create_ok: bool = ..., - include_foreign_key_constraints: Incomplete | None = ..., - _is_metadata_operation: bool = ..., + create_ok: bool = False, + include_foreign_key_constraints: Incomplete | None = None, + _is_metadata_operation: bool = False, ) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... - def visit_sequence(self, sequence, create_ok: bool = ...) -> None: ... - def visit_index(self, index, create_ok: bool = ...) -> None: ... + def visit_sequence(self, sequence, create_ok: bool = False) -> None: ... + def visit_index(self, index, create_ok: bool = False) -> None: ... class SchemaDropper(DDLBase): checkfirst: Any @@ -142,14 +142,14 @@ class SchemaDropper(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, tables: Incomplete | None = None, **kwargs) -> None: ... def visit_metadata(self, metadata): ... - def visit_index(self, index, drop_ok: bool = ...) -> None: ... - def visit_table(self, table, drop_ok: bool = ..., _is_metadata_operation: bool = ..., _ignore_sequences=...) -> None: ... + def visit_index(self, index, drop_ok: bool = False) -> None: ... + def visit_table(self, table, drop_ok: bool = False, _is_metadata_operation: bool = False, _ignore_sequences=()) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... - def visit_sequence(self, sequence, drop_ok: bool = ...) -> None: ... + def visit_sequence(self, sequence, drop_ok: bool = False) -> None: ... -def sort_tables(tables, skip_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ...): ... +def sort_tables(tables, skip_fn: Incomplete | None = None, extra_dependencies: Incomplete | None = None): ... def sort_tables_and_constraints( - tables, filter_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ..., _warn_for_cycles: bool = ... + tables, filter_fn: Incomplete | None = None, extra_dependencies: Incomplete | None = None, _warn_for_cycles: bool = False ): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi index 8dbc7c04b8b8..891beefdf4a4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi @@ -42,7 +42,7 @@ class UpdateBase(roles.DMLRole, HasCTE, HasCompileState, DialectKWArgs, HasPrefi def returning(self, *cols) -> None: ... @property def exported_columns(self): ... - def with_hint(self, text, selectable: Incomplete | None = ..., dialect_name: str = ...) -> None: ... + def with_hint(self, text, selectable: Incomplete | None = None, dialect_name: str = "*") -> None: ... class ValuesBase(UpdateBase): __visit_name__: str @@ -60,16 +60,16 @@ class Insert(ValuesBase): def __init__( self, table, - values: Incomplete | None = ..., - inline: bool = ..., - bind: Incomplete | None = ..., - prefixes: Incomplete | None = ..., - returning: Incomplete | None = ..., - return_defaults: bool = ..., + values: Incomplete | None = None, + inline: bool = False, + bind: Incomplete | None = None, + prefixes: Incomplete | None = None, + returning: Incomplete | None = None, + return_defaults: bool = False, **dialect_kw, ) -> None: ... def inline(self) -> None: ... - def from_select(self, names, select, include_defaults: bool = ...) -> None: ... + def from_select(self, names, select, include_defaults: bool = True) -> None: ... class DMLWhereBase: def where(self, *whereclause) -> None: ... @@ -84,14 +84,14 @@ class Update(DMLWhereBase, ValuesBase): def __init__( self, table, - whereclause: Incomplete | None = ..., - values: Incomplete | None = ..., - inline: bool = ..., - bind: Incomplete | None = ..., - prefixes: Incomplete | None = ..., - returning: Incomplete | None = ..., - return_defaults: bool = ..., - preserve_parameter_order: bool = ..., + whereclause: Incomplete | None = None, + values: Incomplete | None = None, + inline: bool = False, + bind: Incomplete | None = None, + prefixes: Incomplete | None = None, + returning: Incomplete | None = None, + return_defaults: bool = False, + preserve_parameter_order: bool = False, **dialect_kw, ) -> None: ... def ordered_values(self, *args) -> None: ... @@ -104,9 +104,9 @@ class Delete(DMLWhereBase, UpdateBase): def __init__( self, table, - whereclause: Incomplete | None = ..., - bind: Incomplete | None = ..., - returning: Incomplete | None = ..., - prefixes: Incomplete | None = ..., + whereclause: Incomplete | None = None, + bind: Incomplete | None = None, + returning: Incomplete | None = None, + prefixes: Incomplete | None = None, **dialect_kw, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index 93c53c0c5c65..48be8c4669d7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -13,9 +13,9 @@ from .visitors import Traversible _T = TypeVar("_T") def collate(expression, collation): ... -def between(expr, lower_bound, upper_bound, symmetric: bool = ...): ... -def literal(value, type_: Incomplete | None = ...): ... -def outparam(key, type_: Incomplete | None = ...): ... +def between(expr, lower_bound, upper_bound, symmetric: bool = False): ... +def literal(value, type_: Incomplete | None = None): ... +def outparam(key, type_: Incomplete | None = None): ... def not_(clause): ... class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCacheKey, HasCopyInternals, Traversible): @@ -31,8 +31,8 @@ class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCache def unique_params(self, *optionaldict, **kwargs): ... def params(self, *optionaldict, **kwargs): ... def compare(self, other, **kw): ... - def self_group(self, against: Incomplete | None = ...): ... - def compile(self, bind: Incomplete | None = ..., dialect: Incomplete | None = ..., **kw): ... + def self_group(self, against: Incomplete | None = None): ... + def compile(self, bind: Incomplete | None = None, dialect: Incomplete | None = None, **kw): ... def __invert__(self): ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @@ -56,7 +56,7 @@ class ColumnElement( primary_key: bool foreign_keys: Any key: Any - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute @@ -99,17 +99,17 @@ class BindParameter(roles.InElementRole, ColumnElement[_T], Generic[_T]): self, key, value=..., - type_: Incomplete | None = ..., - unique: bool = ..., + type_: Incomplete | None = None, + unique: bool = False, required=..., - quote: Incomplete | None = ..., - callable_: Incomplete | None = ..., - expanding: bool = ..., - isoutparam: bool = ..., - literal_execute: bool = ..., - _compared_to_operator: Incomplete | None = ..., - _compared_to_type: Incomplete | None = ..., - _is_crud: bool = ..., + quote: Incomplete | None = None, + callable_: Incomplete | None = None, + expanding: bool = False, + isoutparam: bool = False, + literal_execute: bool = False, + _compared_to_operator: Incomplete | None = None, + _compared_to_type: Incomplete | None = None, + _is_crud: bool = False, ) -> None: ... @property def effective_value(self): ... @@ -144,7 +144,7 @@ class TextClause( def type(self): ... @property def comparator(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Null(SingletonConstant, roles.ConstExprRole, ColumnElement[None]): __visit_name__: str @@ -171,7 +171,7 @@ class ClauseList(roles.InElementRole, roles.OrderByRole, roles.ColumnsClauseRole def __iter__(self): ... def __len__(self) -> int: ... def append(self, clause) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class BooleanClauseList(ClauseList, ColumnElement[Any]): __visit_name__: str @@ -181,7 +181,7 @@ class BooleanClauseList(ClauseList, ColumnElement[Any]): def and_(cls, *clauses): ... @classmethod def or_(cls, *clauses): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... and_: Any or_: Any @@ -190,7 +190,7 @@ class Tuple(ClauseList, ColumnElement[Any]): __visit_name__: str type: Any def __init__(self, *clauses, **kw) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Case(ColumnElement[Any]): __visit_name__: str @@ -200,7 +200,7 @@ class Case(ColumnElement[Any]): else_: Any def __init__(self, *whens, **kw) -> None: ... -def literal_column(text, type_: Incomplete | None = ...): ... +def literal_column(text, type_: Incomplete | None = None): ... class Cast(WrapsColumnExpression, ColumnElement[Any]): __visit_name__: str @@ -220,7 +220,7 @@ class TypeCoerce(WrapsColumnExpression, ColumnElement[Any]): def typed_expression(self): ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Extract(ColumnElement[Any]): __visit_name__: str @@ -249,12 +249,12 @@ class UnaryExpression(ColumnElement[Any]): def __init__( self, element, - operator: Incomplete | None = ..., - modifier: Incomplete | None = ..., - type_: Incomplete | None = ..., - wraps_column_expression: bool = ..., + operator: Incomplete | None = None, + modifier: Incomplete | None = None, + type_: Incomplete | None = None, + wraps_column_expression: bool = False, ) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class CollectionAggregate(UnaryExpression): inherit_cache: bool @@ -272,7 +272,7 @@ class AsBoolean(WrapsColumnExpression, UnaryExpression): def __init__(self, element, operator, negate) -> None: ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class BinaryExpression(ColumnElement[Any]): __visit_name__: str @@ -287,15 +287,15 @@ class BinaryExpression(ColumnElement[Any]): left, right, operator, - type_: Incomplete | None = ..., - negate: Incomplete | None = ..., - modifiers: Incomplete | None = ..., + type_: Incomplete | None = None, + negate: Incomplete | None = None, + modifiers: Incomplete | None = None, ) -> None: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @property def is_comparison(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Slice(ColumnElement[Any]): __visit_name__: str @@ -303,15 +303,15 @@ class Slice(ColumnElement[Any]): stop: Any step: Any type: Any - def __init__(self, start, stop, step, _name: Incomplete | None = ...) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def __init__(self, start, stop, step, _name: Incomplete | None = None) -> None: ... + def self_group(self, against: Incomplete | None = None): ... class IndexExpression(BinaryExpression): inherit_cache: bool class GroupedElement(ClauseElement): __visit_name__: str - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Grouping(GroupedElement, ColumnElement[Any]): element: Any @@ -332,10 +332,10 @@ class Over(ColumnElement[Any]): def __init__( self, element, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ) -> None: ... def __reduce__(self): ... @memoized_property @@ -349,10 +349,10 @@ class WithinGroup(ColumnElement[Any]): def __reduce__(self): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ): ... @memoized_property def type(self): ... @@ -365,12 +365,12 @@ class FunctionFilter(ColumnElement[Any]): def filter(self, *criterion): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @memoized_property def type(self): ... @@ -378,13 +378,13 @@ class Label(roles.LabeledColumnExprRole, ColumnElement[Any]): __visit_name__: str name: Any key: Any - def __init__(self, name, element, type_: Incomplete | None = ...) -> None: ... + def __init__(self, name, element, type_: Incomplete | None = None) -> None: ... def __reduce__(self): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute def element(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def primary_key(self): ... @property @@ -407,9 +407,9 @@ class ColumnClause(roles.DDLReferredColumnRole, roles.LabeledColumnExprRole, rol key: Any type: Any def __init__( - self, text, type_: Incomplete | None = ..., is_literal: bool = ..., _selectable: Incomplete | None = ... + self, text, type_: Incomplete | None = None, is_literal: bool = False, _selectable: Incomplete | None = None ) -> None: ... - def get_children(self, column_tables: bool = ..., **kw): ... # type: ignore[override] + def get_children(self, column_tables: bool = False, **kw): ... # type: ignore[override] @property def entity_namespace(self): ... @@ -459,7 +459,7 @@ class AnnotatedColumnElement(Annotated): def info(self): ... class _truncated_label(quoted_name): - def __new__(cls, value, quote: Incomplete | None = ...): ... + def __new__(cls, value, quote: Incomplete | None = None): ... def __reduce__(self): ... def apply_map(self, map_): ... @@ -467,7 +467,7 @@ class conv(_truncated_label): ... class _anonymous_label(_truncated_label): @classmethod - def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = ..., sanitize_key: bool = ...): ... + def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = None, sanitize_key: bool = False): ... def __add__(self, other): ... def __radd__(self, other): ... def apply_map(self, map_): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index d5180c37d9bf..22404d7612b5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -7,15 +7,15 @@ from .elements import BinaryExpression, ColumnElement, NamedColumn from .selectable import FromClause, TableValuedAlias from .visitors import TraversibleType -def register_function(identifier, fn, package: str = ...) -> None: ... +def register_function(identifier, fn, package: str = "_default") -> None: ... class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): # type: ignore[misc] packagenames: Incomplete clause_expr: Incomplete def __init__(self, *clauses, **kwargs) -> None: ... - def scalar_table_valued(self, name, type_: Incomplete | None = ...): ... + def scalar_table_valued(self, name, type_: Incomplete | None = None): ... def table_valued(self, *expr, **kw): ... - def column_valued(self, name: str | None = ..., joins_implicitly: bool = ...): ... + def column_valued(self, name: str | None = None, joins_implicitly: bool = False): ... @property def columns(self): ... @property @@ -24,20 +24,20 @@ class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): def clauses(self): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - rows: Incomplete | None = ..., - range_: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + rows: Incomplete | None = None, + range_: Incomplete | None = None, ): ... def within_group(self, *order_by): ... def filter(self, *criterion): ... def as_comparison(self, left_index, right_index): ... def within_group_type(self, within_group) -> None: ... - def alias(self, name: str | None = ..., joins_implicitly: bool = ...) -> TableValuedAlias: ... # type: ignore[override] + def alias(self, name: str | None = None, joins_implicitly: bool = False) -> TableValuedAlias: ... # type: ignore[override] def select(self): ... def scalar(self): ... def execute(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def entity_namespace(self): ... @@ -66,7 +66,7 @@ class ScalarFunctionColumn(NamedColumn): fn: Incomplete name: Incomplete type: Incomplete - def __init__(self, fn, name, type_: Incomplete | None = ...) -> None: ... + def __init__(self, fn, name, type_: Incomplete | None = None) -> None: ... class _FunctionGenerator: opts: Incomplete @@ -143,7 +143,7 @@ class random(GenericFunction): class count(GenericFunction): type: Incomplete inherit_cache: bool - def __init__(self, expression: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, expression: Incomplete | None = None, **kwargs) -> None: ... class current_date(AnsiFunction): type: Incomplete diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi index b6ada6db4382..49c91eefc3c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi @@ -17,12 +17,12 @@ class LambdaOptions(Options): def lambda_stmt( lmb, - enable_tracking: bool = ..., - track_closure_variables: bool = ..., - track_on: Incomplete | None = ..., - global_track_bound_values: bool = ..., - track_bound_values: bool = ..., - lambda_cache: Incomplete | None = ..., + enable_tracking: bool = True, + track_closure_variables: bool = True, + track_on: Incomplete | None = None, + global_track_bound_values: bool = True, + track_bound_values: bool = True, + lambda_cache: Incomplete | None = None, ): ... class LambdaElement(elements.ClauseElement): @@ -32,22 +32,22 @@ class LambdaElement(elements.ClauseElement): role: Incomplete tracker_key: Incomplete opts: Incomplete - def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = ...) -> None: ... + def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = None) -> None: ... def __getattr__(self, key: str): ... class DeferredLambdaElement(LambdaElement): lambda_args: Incomplete - def __init__(self, fn, role, opts=..., lambda_args=...) -> None: ... + def __init__(self, fn, role, opts=..., lambda_args=()) -> None: ... class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): def __add__(self, other): ... def add_criteria( self, other, - enable_tracking: bool = ..., - track_on: Incomplete | None = ..., - track_closure_variables: bool = ..., - track_bound_values: bool = ..., + enable_tracking: bool = True, + track_on: Incomplete | None = None, + track_closure_variables: bool = True, + track_bound_values: bool = True, ): ... def spoil(self): ... @@ -105,9 +105,9 @@ class PyWrapper(ColumnOperators[_T], Generic[_T]): fn, name, to_evaluate, - closure_index: Incomplete | None = ..., - getter: Incomplete | None = ..., - track_bound_values: bool = ..., + closure_index: Incomplete | None = None, + getter: Incomplete | None = None, + track_bound_values: bool = True, ) -> None: ... def __call__(self, *arg, **kw): ... def operate(self, op, *other, **kwargs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi index abfafe7c2e63..cb91ff53553d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi @@ -11,8 +11,8 @@ class Operators: def __and__(self, other): ... def __or__(self, other): ... def __invert__(self): ... - def op(self, opstring, precedence: int = ..., is_comparison: bool = ..., return_type: Incomplete | None = ...): ... - def bool_op(self, opstring, precedence: int = ...): ... + def op(self, opstring, precedence: int = 0, is_comparison: bool = False, return_type: Incomplete | None = None): ... + def bool_op(self, opstring, precedence: int = 0): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... @@ -27,11 +27,11 @@ class custom_op: def __init__( self, opstring, - precedence: int = ..., - is_comparison: bool = ..., - return_type: Incomplete | None = ..., - natural_self_precedent: bool = ..., - eager_grouping: bool = ..., + precedence: int = 0, + is_comparison: bool = False, + return_type: Incomplete | None = None, + natural_self_precedent: bool = False, + eager_grouping: bool = False, ) -> None: ... def __eq__(self, other): ... def __hash__(self) -> int: ... @@ -55,15 +55,15 @@ class ColumnOperators(Operators, Generic[_T]): def __lshift__(self, other) -> ColumnOperators[_T]: ... def __rshift__(self, other) -> ColumnOperators[_T]: ... def concat(self, other: _T | ColumnOperators[_T] | None) -> ColumnOperators[_T]: ... - def like(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def ilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... + def like(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def ilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... def in_(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... def not_in(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... def notin_(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... - def not_like(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def notlike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def not_ilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def notilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... + def not_like(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def notlike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def not_ilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def notilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... def is_(self, other: _T) -> ColumnOperators[_T]: ... def is_not(self, other: _T) -> ColumnOperators[_T]: ... def isnot(self, other: _T) -> ColumnOperators[_T]: ... @@ -71,8 +71,8 @@ class ColumnOperators(Operators, Generic[_T]): def endswith(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def contains(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def match(self, other: str, **kwargs) -> ColumnOperators[_T]: ... - def regexp_match(self, pattern, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... - def regexp_replace(self, pattern, replacement, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... + def regexp_match(self, pattern, flags: Incomplete | None = None) -> ColumnOperators[_T]: ... + def regexp_replace(self, pattern, replacement, flags: Incomplete | None = None) -> ColumnOperators[_T]: ... def desc(self) -> ColumnOperators[_T]: ... def asc(self) -> ColumnOperators[_T]: ... def nulls_first(self) -> ColumnOperators[_T]: ... @@ -85,7 +85,7 @@ class ColumnOperators(Operators, Generic[_T]): def __rmul__(self, other) -> ColumnOperators[_T]: ... def __rdiv__(self, other) -> ColumnOperators[_T]: ... def __rmod__(self, other) -> ColumnOperators[_T]: ... - def between(self, cleft, cright, symmetric: bool = ...) -> ColumnOperators[_T]: ... + def between(self, cleft, cright, symmetric: bool = False) -> ColumnOperators[_T]: ... def distinct(self) -> ColumnOperators[_T]: ... def any_(self) -> ColumnOperators[_T]: ... def all_(self) -> ColumnOperators[_T]: ... @@ -123,18 +123,18 @@ isnot = is_not def collate(a, b): ... def op(a, opstring, b): ... -def like_op(a, b, escape: Incomplete | None = ...): ... -def not_like_op(a, b, escape: Incomplete | None = ...): ... +def like_op(a, b, escape: Incomplete | None = None): ... +def not_like_op(a, b, escape: Incomplete | None = None): ... notlike_op = not_like_op -def ilike_op(a, b, escape: Incomplete | None = ...): ... -def not_ilike_op(a, b, escape: Incomplete | None = ...): ... +def ilike_op(a, b, escape: Incomplete | None = None): ... +def not_ilike_op(a, b, escape: Incomplete | None = None): ... notilike_op = not_ilike_op -def between_op(a, b, c, symmetric: bool = ...): ... -def not_between_op(a, b, c, symmetric: bool = ...): ... +def between_op(a, b, c, symmetric: bool = False): ... +def not_between_op(a, b, c, symmetric: bool = False): ... notbetween_op = not_between_op @@ -146,25 +146,25 @@ notin_op = not_in_op def distinct_op(a): ... def any_op(a): ... def all_op(a): ... -def startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def startswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_startswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notstartswith_op = not_startswith_op -def endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def endswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_endswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notendswith_op = not_endswith_op -def contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def contains_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_contains_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notcontains_op = not_contains_op def match_op(a, b, **kw): ... -def regexp_match_op(a, b, flags: Incomplete | None = ...): ... -def not_regexp_match_op(a, b, flags: Incomplete | None = ...): ... -def regexp_replace_op(a, b, replacement, flags: Incomplete | None = ...): ... +def regexp_match_op(a, b, flags: Incomplete | None = None): ... +def not_regexp_match_op(a, b, flags: Incomplete | None = None): ... +def regexp_replace_op(a, b, replacement, flags: Incomplete | None = None): ... def not_match_op(a, b, **kw): ... notmatch_op = not_match_op diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index 21656beed655..3199c6d3dcd2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -30,13 +30,13 @@ class Table(DialectKWArgs, SchemaItem, TableClause): @property def bind(self): ... def add_is_dependent_on(self, table) -> None: ... - def append_column(self, column, replace_existing: bool = ...) -> None: ... # type: ignore[override] + def append_column(self, column, replace_existing: bool = False) -> None: ... # type: ignore[override] def append_constraint(self, constraint) -> None: ... - def exists(self, bind: Incomplete | None = ...): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... - def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... + def exists(self, bind: Incomplete | None = None): ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = None, name: Incomplete | None = None): ... + def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = None, name: Incomplete | None = None): ... class Column(DialectKWArgs, SchemaItem, ColumnClause): __visit_name__: str @@ -80,20 +80,20 @@ class ForeignKey(DialectKWArgs, SchemaItem): def __init__( self, column, - _constraint: Incomplete | None = ..., - use_alter: bool = ..., - name: Incomplete | None = ..., - onupdate: Incomplete | None = ..., - ondelete: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - link_to_name: bool = ..., - match: Incomplete | None = ..., - info: Incomplete | None = ..., - _unresolvable: bool = ..., + _constraint: Incomplete | None = None, + use_alter: bool = False, + name: Incomplete | None = None, + onupdate: Incomplete | None = None, + ondelete: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + link_to_name: bool = False, + match: Incomplete | None = None, + info: Incomplete | None = None, + _unresolvable: bool = False, **dialect_kw, ) -> None: ... - def copy(self, schema: Incomplete | None = ..., **kw): ... + def copy(self, schema: Incomplete | None = None, **kw): ... @property def target_fullname(self): ... def references(self, table): ... @@ -107,8 +107,8 @@ class DefaultGenerator(Executable, SchemaItem): is_server_default: bool column: Any for_update: Any - def __init__(self, for_update: bool = ...) -> None: ... - def execute(self, bind: Incomplete | None = ...): ... # type: ignore[override] + def __init__(self, for_update: bool = False) -> None: ... + def execute(self, bind: Incomplete | None = None): ... # type: ignore[override] @property def bind(self): ... @@ -134,15 +134,15 @@ class IdentityOptions: order: Any def __init__( self, - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, ) -> None: ... class Sequence(IdentityOptions, DefaultGenerator): @@ -156,22 +156,22 @@ class Sequence(IdentityOptions, DefaultGenerator): def __init__( self, name, - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - schema: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., - data_type: Incomplete | None = ..., - optional: bool = ..., - quote: Incomplete | None = ..., - metadata: Incomplete | None = ..., - quote_schema: Incomplete | None = ..., - for_update: bool = ..., + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + schema: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, + data_type: Incomplete | None = None, + optional: bool = False, + quote: Incomplete | None = None, + metadata: Incomplete | None = None, + quote_schema: Incomplete | None = None, + for_update: bool = False, ) -> None: ... @memoized_property def is_callable(self): ... @@ -180,8 +180,8 @@ class Sequence(IdentityOptions, DefaultGenerator): def next_value(self): ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... class FetchedValue(SchemaEventTarget): is_server_default: bool @@ -189,13 +189,13 @@ class FetchedValue(SchemaEventTarget): has_argument: bool is_clause_element: bool for_update: Any - def __init__(self, for_update: bool = ...) -> None: ... + def __init__(self, for_update: bool = False) -> None: ... class DefaultClause(FetchedValue): has_argument: bool arg: Any reflected: Any - def __init__(self, arg, for_update: bool = ..., _reflected: bool = ...) -> None: ... + def __init__(self, arg, for_update: bool = False, _reflected: bool = False) -> None: ... class Constraint(DialectKWArgs, SchemaItem): __visit_name__: str @@ -205,12 +205,12 @@ class Constraint(DialectKWArgs, SchemaItem): info: Any def __init__( self, - name: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - _create_rule: Incomplete | None = ..., - info: Incomplete | None = ..., - _type_bound: bool = ..., + name: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + _create_rule: Incomplete | None = None, + info: Incomplete | None = None, + _type_bound: bool = False, **dialect_kw, ) -> None: ... @property @@ -225,7 +225,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): def __init__(self, *columns, **kw) -> None: ... columns: Any def __contains__(self, x): ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = None, **kw): ... def contains_column(self, col): ... def __iter__(self): ... def __len__(self) -> int: ... @@ -236,19 +236,19 @@ class CheckConstraint(ColumnCollectionConstraint): def __init__( self, sqltext, - name: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - table: Incomplete | None = ..., - info: Incomplete | None = ..., - _create_rule: Incomplete | None = ..., - _autoattach: bool = ..., - _type_bound: bool = ..., + name: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + table: Incomplete | None = None, + info: Incomplete | None = None, + _create_rule: Incomplete | None = None, + _autoattach: bool = True, + _type_bound: bool = False, **kw, ) -> None: ... @property def is_column_level(self): ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = None, **kw): ... class ForeignKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -262,16 +262,16 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): self, columns, refcolumns, - name: Incomplete | None = ..., - onupdate: Incomplete | None = ..., - ondelete: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - use_alter: bool = ..., - link_to_name: bool = ..., - match: Incomplete | None = ..., - table: Incomplete | None = ..., - info: Incomplete | None = ..., + name: Incomplete | None = None, + onupdate: Incomplete | None = None, + ondelete: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + use_alter: bool = False, + link_to_name: bool = False, + match: Incomplete | None = None, + table: Incomplete | None = None, + info: Incomplete | None = None, **dialect_kw, ) -> None: ... columns: Any @@ -279,7 +279,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): def referred_table(self): ... @property def column_keys(self): ... - def copy(self, schema: Incomplete | None = ..., target_table: Incomplete | None = ..., **kw): ... # type: ignore[override] + def copy(self, schema: Incomplete | None = None, target_table: Incomplete | None = None, **kw): ... # type: ignore[override] class PrimaryKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -300,8 +300,8 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): def __init__(self, name, *expressions, **kw) -> None: ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...): ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False): ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... DEFAULT_NAMING_CONVENTION: Any @@ -313,11 +313,11 @@ class MetaData(SchemaItem): info: Any def __init__( self, - bind: Incomplete | None = ..., - schema: Incomplete | None = ..., - quote_schema: Incomplete | None = ..., - naming_convention: Incomplete | None = ..., - info: Incomplete | None = ..., + bind: Incomplete | None = None, + schema: Incomplete | None = None, + quote_schema: Incomplete | None = None, + naming_convention: Incomplete | None = None, + info: Incomplete | None = None, ) -> None: ... def __contains__(self, table_or_key) -> bool: ... def is_bound(self): ... @@ -328,17 +328,17 @@ class MetaData(SchemaItem): def sorted_tables(self): ... def reflect( self, - bind: Incomplete | None = ..., - schema: Incomplete | None = ..., - views: bool = ..., - only: Incomplete | None = ..., - extend_existing: bool = ..., - autoload_replace: bool = ..., - resolve_fks: bool = ..., + bind: Incomplete | None = None, + schema: Incomplete | None = None, + views: bool = False, + only: Incomplete | None = None, + extend_existing: bool = False, + autoload_replace: bool = True, + resolve_fks: bool = True, **dialect_kwargs, ) -> None: ... - def create_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create_all(self, bind: Incomplete | None = None, tables: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop_all(self, bind: Incomplete | None = None, tables: Incomplete | None = None, checkfirst: bool = True) -> None: ... class ThreadLocalMetaData(MetaData): __visit_name__: str @@ -353,8 +353,8 @@ class Computed(FetchedValue, SchemaItem): sqltext: Any persisted: Any column: Any - def __init__(self, sqltext, persisted: Incomplete | None = ...) -> None: ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def __init__(self, sqltext, persisted: Incomplete | None = None) -> None: ... + def copy(self, target_table: Incomplete | None = None, **kw): ... class Identity(IdentityOptions, FetchedValue, SchemaItem): __visit_name__: str @@ -363,16 +363,16 @@ class Identity(IdentityOptions, FetchedValue, SchemaItem): column: Any def __init__( self, - always: bool = ..., - on_null: Incomplete | None = ..., - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., + always: bool = False, + on_null: Incomplete | None = None, + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, ) -> None: ... def copy(self, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index eb24ab00c8f7..c9ddc58d3df7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -34,9 +34,9 @@ class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): class Selectable(ReturnsRows): __visit_name__: str is_selectable: bool - def lateral(self, name: Incomplete | None = ...): ... + def lateral(self, name: Incomplete | None = None): ... def replace_selectable(self, old, alias): ... - def corresponding_column(self, column, require_embedded: bool = ...): ... + def corresponding_column(self, column, require_embedded: bool = False): ... class HasPrefixes: def prefix_with(self, *expr, **kw) -> Self: ... @@ -45,20 +45,20 @@ class HasSuffixes: def suffix_with(self, *expr, **kw) -> Self: ... class HasHints: - def with_statement_hint(self, text, dialect_name: str = ...): ... - def with_hint(self, selectable, text: str, dialect_name: str = ...) -> Self: ... + def with_statement_hint(self, text, dialect_name: str = "*"): ... + def with_hint(self, selectable, text: str, dialect_name: str = "*") -> Self: ... class FromClause(roles.AnonymizedFromClauseRole, Selectable): __visit_name__: str named_with_column: bool schema: Any is_selectable: bool - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... - def join(self, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...): ... - def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ...): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... + def join(self, right, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False): ... + def outerjoin(self, right, onclause: Incomplete | None = None, full: bool = False): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... def table_valued(self): ... - def tablesample(self, sampling, name: Incomplete | None = ..., seed: Incomplete | None = ...): ... + def tablesample(self, sampling, name: Incomplete | None = None, seed: Incomplete | None = None): ... def is_derived_from(self, fromclause): ... @property def description(self): ... @@ -87,15 +87,15 @@ class Join(roles.DMLTableRole, FromClause): onclause: Any isouter: Any full: Any - def __init__(self, left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + def __init__(self, left, right, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> None: ... @property def description(self): ... def is_derived_from(self, fromclause): ... - def self_group(self, against: Incomplete | None = ...): ... - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def self_group(self, against: Incomplete | None = None): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... @property def bind(self): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... class NoInit: def __init__(self, *arg, **kw) -> None: ... @@ -118,9 +118,9 @@ class TableValuedAlias(Alias): __visit_name__: str @HasMemoized.memoized_attribute def column(self): ... - def alias(self, name: Incomplete | None = ...): ... # type: ignore[override] - def lateral(self, name: Incomplete | None = ...): ... - def render_derived(self, name: Incomplete | None = ..., with_types: bool = ...): ... + def alias(self, name: Incomplete | None = None): ... # type: ignore[override] + def lateral(self, name: Incomplete | None = None): ... + def render_derived(self, name: Incomplete | None = None, with_types: bool = False): ... class Lateral(AliasedReturnsRows): __visit_name__: str @@ -131,13 +131,13 @@ class TableSample(AliasedReturnsRows): class CTE(roles.DMLTableRole, roles.IsCTERole, Generative, HasPrefixes, HasSuffixes, AliasedReturnsRows): __visit_name__: str - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... def union(self, *other): ... def union_all(self, *other): ... class HasCTE(roles.HasCTERole): def add_cte(self, cte) -> None: ... - def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def cte(self, name: Incomplete | None = None, recursive: bool = False, nesting: bool = False): ... class Subquery(AliasedReturnsRows): __visit_name__: str @@ -169,9 +169,9 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause): @memoized_property def description(self): ... def append_column(self, c, **kw) -> None: ... - def insert(self, values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... - def update(self, whereclause: Incomplete | None = ..., values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... - def delete(self, whereclause: Incomplete | None = ..., **kwargs): ... + def insert(self, values: Incomplete | None = None, inline: bool = False, **kwargs): ... + def update(self, whereclause: Incomplete | None = None, values: Incomplete | None = None, inline: bool = False, **kwargs): ... + def delete(self, whereclause: Incomplete | None = None, **kwargs): ... class ForUpdateArg(ClauseElement): def __eq__(self, other): ... @@ -183,7 +183,12 @@ class ForUpdateArg(ClauseElement): key_share: Any of: Any def __init__( - self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + nowait: bool = False, + read: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> None: ... class Values(Generative, FromClause): @@ -193,7 +198,7 @@ class Values(Generative, FromClause): literal_binds: Any def __init__(self, *columns, **kw) -> None: ... def alias(self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] - def lateral(self, name: Incomplete | None = ...) -> Self: ... + def lateral(self, name: Incomplete | None = None) -> Self: ... def data(self, values) -> Self: ... class SelectBase( @@ -220,9 +225,9 @@ class SelectBase( def exists(self): ... def scalar_subquery(self): ... def label(self, name): ... - def lateral(self, name: Incomplete | None = ...): ... - def subquery(self, name: Incomplete | None = ...): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def lateral(self, name: Incomplete | None = None): ... + def subquery(self, name: Incomplete | None = None): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... class SelectStatementGrouping(GroupedElement, SelectBase): __visit_name__: str @@ -232,7 +237,7 @@ class SelectStatementGrouping(GroupedElement, SelectBase): def set_label_style(self, label_style): ... @property def select_statement(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def selected_columns(self): ... @@ -244,21 +249,26 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): def __init__( self, _label_style=..., - use_labels: bool = ..., - limit: Incomplete | None = ..., - offset: Incomplete | None = ..., - order_by: Incomplete | None = ..., - group_by: Incomplete | None = ..., - bind: Incomplete | None = ..., + use_labels: bool = False, + limit: Incomplete | None = None, + offset: Incomplete | None = None, + order_by: Incomplete | None = None, + group_by: Incomplete | None = None, + bind: Incomplete | None = None, ) -> None: ... def with_for_update( - self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + nowait: bool = False, + read: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> Self: ... def get_label_style(self): ... def set_label_style(self, style): ... def apply_labels(self): ... def limit(self, limit: Incomplete | None) -> Self: ... - def fetch(self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... + def fetch(self, count: Incomplete | None, with_ties: bool = False, percent: bool = False) -> Self: ... def offset(self, offset: Incomplete | None) -> Self: ... def slice(self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... def order_by(self, *clauses) -> Self: ... @@ -277,7 +287,7 @@ class CompoundSelect(HasCompileState, GenerativeSelect): keyword: Any selects: Any def __init__(self, keyword, *selects, **kwargs) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def is_derived_from(self, fromclause): ... @property def selected_columns(self): ... @@ -324,14 +334,14 @@ class Select( @classmethod def create_legacy_select( cls, - columns: Incomplete | None = ..., - whereclause: Incomplete | None = ..., - from_obj: Incomplete | None = ..., - distinct: bool = ..., - having: Incomplete | None = ..., - correlate: bool = ..., - prefixes: Incomplete | None = ..., - suffixes: Incomplete | None = ..., + columns: Incomplete | None = None, + whereclause: Incomplete | None = None, + from_obj: Incomplete | None = None, + distinct: bool = False, + having: Incomplete | None = None, + correlate: bool = True, + prefixes: Incomplete | None = None, + suffixes: Incomplete | None = None, **kwargs, ): ... def __init__(self) -> None: ... @@ -340,10 +350,10 @@ class Select( @property def column_descriptions(self): ... def from_statement(self, statement): ... - def join(self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin_from(self, from_, target, onclause: Incomplete | None = ..., full: bool = ...): ... - def join_from(self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin(self, target, onclause: Incomplete | None = ..., full: bool = ...): ... + def join(self, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... + def outerjoin_from(self, from_, target, onclause: Incomplete | None = None, full: bool = False): ... + def join_from(self, from_, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... + def outerjoin(self, target, onclause: Incomplete | None = None, full: bool = False): ... def get_final_froms(self): ... @property def froms(self): ... @@ -355,7 +365,7 @@ class Select( def get_children(self, **kwargs): ... def add_columns(self, *columns) -> Self: ... def column(self, column): ... - def reduce_columns(self, only_synonyms: bool = ...): ... + def reduce_columns(self, only_synonyms: bool = True): ... def with_only_columns(self, *columns, **kw) -> Self: ... @property def whereclause(self): ... @@ -367,7 +377,7 @@ class Select( def correlate_except(self, *fromclauses) -> Self: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def union(self, *other, **kwargs): ... def union_all(self, *other, **kwargs): ... def except_(self, *other, **kwargs): ... @@ -396,7 +406,7 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping): class Exists(UnaryExpression): inherit_cache: bool def __init__(self, *args, **kwargs) -> None: ... - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... def correlate(self, *fromclause): ... def correlate_except(self, *fromclause): ... def select_from(self, *froms): ... @@ -409,7 +419,7 @@ class TextualSelect(SelectBase): element: Any column_args: Any positional: Any - def __init__(self, text, columns, positional: bool = ...) -> None: ... + def __init__(self, text, columns, positional: bool = False) -> None: ... @HasMemoized.memoized_attribute def selected_columns(self): ... def bindparams(self, *binds, **bind_as_values) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index eef39d632164..1bdec2ced356 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -38,12 +38,12 @@ class String(Concatenable, TypeEngine): collation: Any def __init__( self, - length: Incomplete | None = ..., - collation: Incomplete | None = ..., - convert_unicode: bool = ..., - unicode_error: Incomplete | None = ..., - _warn_on_bytestring: bool = ..., - _expect_unicode: bool = ..., + length: Incomplete | None = None, + collation: Incomplete | None = None, + convert_unicode: bool = False, + unicode_error: Incomplete | None = None, + _warn_on_bytestring: bool = False, + _expect_unicode: bool = False, ) -> None: ... def literal_processor(self, dialect): ... def bind_processor(self, dialect): ... @@ -57,11 +57,11 @@ class Text(String): class Unicode(String): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class UnicodeText(Text): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class Integer(_LookupExpressionAdapter, TypeEngine): __visit_name__: str @@ -84,10 +84,10 @@ class Numeric(_LookupExpressionAdapter, TypeEngine): asdecimal: Any def __init__( self, - precision: Incomplete | None = ..., - scale: Incomplete | None = ..., - decimal_return_scale: Incomplete | None = ..., - asdecimal: bool = ..., + precision: Incomplete | None = None, + scale: Incomplete | None = None, + decimal_return_scale: Incomplete | None = None, + asdecimal: bool = True, ) -> None: ... def get_dbapi_type(self, dbapi): ... def literal_processor(self, dialect): ... @@ -103,14 +103,14 @@ class Float(Numeric): asdecimal: Any decimal_return_scale: Any def __init__( - self, precision: Incomplete | None = ..., asdecimal: bool = ..., decimal_return_scale: Incomplete | None = ... + self, precision: Incomplete | None = None, asdecimal: bool = False, decimal_return_scale: Incomplete | None = None ) -> None: ... def result_processor(self, dialect, coltype): ... class DateTime(_LookupExpressionAdapter, TypeEngine): __visit_name__: str timezone: Any - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... @property def python_type(self): ... @@ -124,14 +124,14 @@ class Date(_LookupExpressionAdapter, TypeEngine): class Time(_LookupExpressionAdapter, TypeEngine): __visit_name__: str timezone: Any - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... @property def python_type(self): ... class _Binary(TypeEngine): length: Any - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... def literal_processor(self, dialect): ... @property def python_type(self): ... @@ -142,7 +142,7 @@ class _Binary(TypeEngine): class LargeBinary(_Binary): __visit_name__: str - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... class SchemaType(SchemaEventTarget): name: Any @@ -151,19 +151,19 @@ class SchemaType(SchemaEventTarget): inherit_schema: Any def __init__( self, - name: Incomplete | None = ..., - schema: Incomplete | None = ..., - metadata: Incomplete | None = ..., - inherit_schema: bool = ..., - quote: Incomplete | None = ..., - _create_events: bool = ..., + name: Incomplete | None = None, + schema: Incomplete | None = None, + metadata: Incomplete | None = None, + inherit_schema: bool = False, + quote: Incomplete | None = None, + _create_events: bool = True, ) -> None: ... def copy(self, **kw): ... def adapt(self, impltype, **kw): ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... class Enum(Emulated, String, SchemaType): __visit_name__: str @@ -175,7 +175,7 @@ class Enum(Emulated, String, SchemaType): class Comparator(Concatenable.Comparator[Any]): ... comparator_factory: Any - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... def adapt_to_emulated(self, impltype, **kw): ... def adapt(self, impltype, **kw): ... def literal_processor(self, dialect): ... @@ -192,7 +192,7 @@ class PickleType(TypeDecorator): pickler: Any comparator: Any def __init__( - self, protocol=..., pickler: Incomplete | None = ..., comparator: Incomplete | None = ..., impl: Incomplete | None = ... + self, protocol=5, pickler: Incomplete | None = None, comparator: Incomplete | None = None, impl: Incomplete | None = None ) -> None: ... def __reduce__(self): ... def bind_processor(self, dialect): ... @@ -204,7 +204,7 @@ class Boolean(Emulated, TypeEngine, SchemaType): # type: ignore[misc] native: bool create_constraint: Any name: Any - def __init__(self, create_constraint: bool = ..., name: Incomplete | None = ..., _create_events: bool = ...) -> None: ... + def __init__(self, create_constraint: bool = False, name: Incomplete | None = None, _create_events: bool = True) -> None: ... @property def python_type(self): ... def literal_processor(self, dialect): ... @@ -222,7 +222,7 @@ class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc second_precision: Any day_precision: Any def __init__( - self, native: bool = ..., second_precision: Incomplete | None = ..., day_precision: Incomplete | None = ... + self, native: bool = True, second_precision: Incomplete | None = None, day_precision: Incomplete | None = None ) -> None: ... @property def python_type(self): ... @@ -235,7 +235,7 @@ class JSON(Indexable, TypeEngine): hashable: bool NULL: Any none_as_null: Any - def __init__(self, none_as_null: bool = ...) -> None: ... + def __init__(self, none_as_null: bool = False) -> None: ... class JSONElementType(TypeEngine): def string_bind_processor(self, dialect): ... @@ -253,7 +253,7 @@ class JSON(Indexable, TypeEngine): def as_string(self): ... def as_integer(self): ... def as_float(self): ... - def as_numeric(self, precision, scale, asdecimal: bool = ...): ... + def as_numeric(self, precision, scale, asdecimal: bool = True): ... def as_json(self): ... comparator_factory: Any @property @@ -271,14 +271,14 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): class Comparator(Indexable.Comparator[_T], Concatenable.Comparator[_T], Generic[_T]): def contains(self, *arg, **kw) -> ColumnOperators[_T]: ... - def any(self, other, operator: Incomplete | None = ...): ... - def all(self, other, operator: Incomplete | None = ...): ... + def any(self, other, operator: Incomplete | None = None): ... + def all(self, other, operator: Incomplete | None = None): ... comparator_factory: Any item_type: Any as_tuple: Any dimensions: Any def __init__( - self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + self, item_type, as_tuple: bool = False, dimensions: Incomplete | None = None, zero_indexes: bool = False ) -> None: ... @property def hashable(self): ... @@ -316,7 +316,7 @@ class BIGINT(BigInteger): class TIMESTAMP(DateTime): __visit_name__: str - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... class DATETIME(DateTime): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi index 0bd17128785e..1f496655bf0c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi @@ -152,7 +152,7 @@ class TraversalComparatorStrategy(InternalTraversal, util.MemoizedSlots): def compare_bindparam(self, left, right, **kw): ... class ColIdentityComparatorStrategy(TraversalComparatorStrategy): - def compare_column_element(self, left, right, use_proxies: bool = ..., equivalents=..., **kw): ... + def compare_column_element(self, left, right, use_proxies: bool = True, equivalents=(), **kw): ... def compare_column(self, left, right, **kw): ... def compare_label(self, left, right, **kw): ... def compare_table(self, left, right, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index af91551597c6..f5e384455101 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -44,11 +44,11 @@ class TypeEngine(Traversible): @property def python_type(self) -> None: ... def with_variant(self, type_, dialect_name): ... - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... def dialect_impl(self, dialect): ... def adapt(self, cls, **kw): ... def coerce_compared_value(self, op, value): ... - def compile(self, dialect: Incomplete | None = ...): ... + def compile(self, dialect: Incomplete | None = None): ... class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi index 8bf4c57f94a0..50e9b145af1f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi @@ -11,11 +11,11 @@ def find_left_clause_to_join_from(clauses, join_to, onclause): ... def visit_binary_product(fn, expr) -> None: ... def find_tables( clause, - check_columns: bool = ..., - include_aliases: bool = ..., - include_joins: bool = ..., - include_selects: bool = ..., - include_crud: bool = ..., + check_columns: bool = False, + include_aliases: bool = False, + include_joins: bool = False, + include_selects: bool = False, + include_crud: bool = False, ): ... def unwrap_order_by(clause): ... def unwrap_label_reference(element): ... @@ -35,23 +35,23 @@ class _repr_base: class _repr_row(_repr_base): row: Any max_chars: Any - def __init__(self, row, max_chars: int = ...) -> None: ... + def __init__(self, row, max_chars: int = 300) -> None: ... class _repr_params(_repr_base): params: Any ismulti: Any batches: Any max_chars: Any - def __init__(self, params, batches, max_chars: int = ..., ismulti: Incomplete | None = ...) -> None: ... + def __init__(self, params, batches, max_chars: int = 300, ismulti: Incomplete | None = None) -> None: ... def adapt_criterion_to_null(crit, nulls): ... -def splice_joins(left, right, stop_on: Incomplete | None = ...): ... +def splice_joins(left, right, stop_on: Incomplete | None = None): ... def reduce_columns(columns, *clauses, **kw): ... def criterion_as_pairs( expression, - consider_as_foreign_keys: Incomplete | None = ..., - consider_as_referenced_keys: Incomplete | None = ..., - any_operator: bool = ..., + consider_as_foreign_keys: Incomplete | None = None, + consider_as_referenced_keys: Incomplete | None = None, + any_operator: bool = False, ): ... class ClauseAdapter(visitors.ReplacingExternalTraversal): @@ -65,14 +65,14 @@ class ClauseAdapter(visitors.ReplacingExternalTraversal): def __init__( self, selectable, - equivalents: Incomplete | None = ..., - include_fn: Incomplete | None = ..., - exclude_fn: Incomplete | None = ..., - adapt_on_names: bool = ..., - anonymize_labels: bool = ..., - adapt_from_selectables: Incomplete | None = ..., + equivalents: Incomplete | None = None, + include_fn: Incomplete | None = None, + exclude_fn: Incomplete | None = None, + adapt_on_names: bool = False, + anonymize_labels: bool = False, + adapt_from_selectables: Incomplete | None = None, ) -> None: ... - def replace(self, col, _include_singleton_constants: bool = ...): ... + def replace(self, col, _include_singleton_constants: bool = False): ... class ColumnAdapter(ClauseAdapter): columns: Any @@ -81,14 +81,14 @@ class ColumnAdapter(ClauseAdapter): def __init__( self, selectable, - equivalents: Incomplete | None = ..., - adapt_required: bool = ..., - include_fn: Incomplete | None = ..., - exclude_fn: Incomplete | None = ..., - adapt_on_names: bool = ..., - allow_label_resolve: bool = ..., - anonymize_labels: bool = ..., - adapt_from_selectables: Incomplete | None = ..., + equivalents: Incomplete | None = None, + adapt_required: bool = False, + include_fn: Incomplete | None = None, + exclude_fn: Incomplete | None = None, + adapt_on_names: bool = False, + allow_label_resolve: bool = True, + anonymize_labels: bool = False, + adapt_from_selectables: Incomplete | None = None, ) -> None: ... class _IncludeExcludeMapping: diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi index 398dee26ef9a..e8378c67ddc0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -5,7 +5,7 @@ class TraversibleType(type): class Traversible(metaclass=TraversibleType): def __class_getitem__(cls, key): ... - def get_children(self, omit_attrs=..., **kw): ... + def get_children(self, omit_attrs=(), **kw): ... class _InternalTraversalType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi index e8366e9068ce..0d2920e93a3a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi @@ -8,27 +8,27 @@ def expect_deprecated_20(*messages, **kw): ... def emits_warning_on(db, *messages): ... def uses_deprecated(*messages): ... def global_cleanup_assertions() -> None: ... -def eq_regex(a, b, msg: Incomplete | None = ...) -> None: ... -def eq_(a, b, msg: Incomplete | None = ...) -> None: ... -def ne_(a, b, msg: Incomplete | None = ...) -> None: ... -def le_(a, b, msg: Incomplete | None = ...) -> None: ... -def is_instance_of(a, b, msg: Incomplete | None = ...) -> None: ... -def is_none(a, msg: Incomplete | None = ...) -> None: ... -def is_not_none(a, msg: Incomplete | None = ...) -> None: ... -def is_true(a, msg: Incomplete | None = ...) -> None: ... -def is_false(a, msg: Incomplete | None = ...) -> None: ... -def is_(a, b, msg: Incomplete | None = ...) -> None: ... -def is_not(a, b, msg: Incomplete | None = ...) -> None: ... +def eq_regex(a, b, msg: Incomplete | None = None) -> None: ... +def eq_(a, b, msg: Incomplete | None = None) -> None: ... +def ne_(a, b, msg: Incomplete | None = None) -> None: ... +def le_(a, b, msg: Incomplete | None = None) -> None: ... +def is_instance_of(a, b, msg: Incomplete | None = None) -> None: ... +def is_none(a, msg: Incomplete | None = None) -> None: ... +def is_not_none(a, msg: Incomplete | None = None) -> None: ... +def is_true(a, msg: Incomplete | None = None) -> None: ... +def is_false(a, msg: Incomplete | None = None) -> None: ... +def is_(a, b, msg: Incomplete | None = None) -> None: ... +def is_not(a, b, msg: Incomplete | None = None) -> None: ... is_not_ = is_not -def in_(a, b, msg: Incomplete | None = ...) -> None: ... -def not_in(a, b, msg: Incomplete | None = ...) -> None: ... +def in_(a, b, msg: Incomplete | None = None) -> None: ... +def not_in(a, b, msg: Incomplete | None = None) -> None: ... not_in_ = not_in -def startswith_(a, fragment, msg: Incomplete | None = ...) -> None: ... -def eq_ignore_whitespace(a, b, msg: Incomplete | None = ...) -> None: ... +def startswith_(a, fragment, msg: Incomplete | None = None) -> None: ... +def eq_ignore_whitespace(a, b, msg: Incomplete | None = None) -> None: ... def assert_raises(except_cls, callable_, *args, **kw): ... def assert_raises_context_ok(except_cls, callable_, *args, **kw): ... def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): ... @@ -37,8 +37,8 @@ def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs class _ErrorContainer: error: Incomplete -def expect_raises(except_cls, check_context: bool = ...): ... -def expect_raises_message(except_cls, msg, check_context: bool = ...): ... +def expect_raises(except_cls, check_context: bool = True): ... +def expect_raises_message(except_cls, msg, check_context: bool = True): ... class AssertsCompiledSQL: test_statement: Incomplete @@ -47,29 +47,29 @@ class AssertsCompiledSQL: self, clause, result, - params: Incomplete | None = ..., - checkparams: Incomplete | None = ..., - for_executemany: bool = ..., - check_literal_execute: Incomplete | None = ..., - check_post_param: Incomplete | None = ..., - dialect: Incomplete | None = ..., - checkpositional: Incomplete | None = ..., - check_prefetch: Incomplete | None = ..., - use_default_dialect: bool = ..., - allow_dialect_select: bool = ..., - supports_default_values: bool = ..., - supports_default_metavalue: bool = ..., - literal_binds: bool = ..., - render_postcompile: bool = ..., - schema_translate_map: Incomplete | None = ..., - render_schema_translate: bool = ..., - default_schema_name: Incomplete | None = ..., - from_linting: bool = ..., - check_param_order: bool = ..., + params: Incomplete | None = None, + checkparams: Incomplete | None = None, + for_executemany: bool = False, + check_literal_execute: Incomplete | None = None, + check_post_param: Incomplete | None = None, + dialect: Incomplete | None = None, + checkpositional: Incomplete | None = None, + check_prefetch: Incomplete | None = None, + use_default_dialect: bool = False, + allow_dialect_select: bool = False, + supports_default_values: bool = True, + supports_default_metavalue: bool = True, + literal_binds: bool = False, + render_postcompile: bool = False, + schema_translate_map: Incomplete | None = None, + render_schema_translate: bool = False, + default_schema_name: Incomplete | None = None, + from_linting: bool = False, + check_param_order: bool = True, ) -> None: ... class ComparesTables: - def assert_tables_equal(self, table, reflected_table, strict_types: bool = ...) -> None: ... + def assert_tables_equal(self, table, reflected_table, strict_types: bool = False) -> None: ... def assert_types_base(self, c1, c2) -> None: ... class AssertsExecutionResults: @@ -77,7 +77,7 @@ class AssertsExecutionResults: def assert_list(self, result, class_, list_) -> None: ... def assert_row(self, class_, rowobj, desc) -> None: ... def assert_unordered_result(self, result, cls, *expected): ... - def sql_execution_asserter(self, db: Incomplete | None = ...): ... + def sql_execution_asserter(self, db: Incomplete | None = None): ... def assert_sql_execution(self, db, callable_, *rules): ... def assert_sql(self, db, callable_, rules): ... def assert_sql_count(self, db, callable_, count) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi index c02391805e7c..c7534746d038 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi @@ -14,7 +14,7 @@ class CursorSQL(SQLMatchRule): statement: Any params: Any consume_statement: Any - def __init__(self, statement, params: Incomplete | None = ..., consume_statement: bool = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = None, consume_statement: bool = True) -> None: ... errormessage: Any is_consumed: bool def process_statement(self, execute_observed) -> None: ... @@ -23,7 +23,7 @@ class CompiledSQL(SQLMatchRule): statement: Any params: Any dialect: Any - def __init__(self, statement, params: Incomplete | None = ..., dialect: str = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = None, dialect: str = "default") -> None: ... is_consumed: bool errormessage: Any def process_statement(self, execute_observed) -> None: ... @@ -33,7 +33,7 @@ class RegexSQL(CompiledSQL): orig_regex: Any params: Any dialect: Any - def __init__(self, regex, params: Incomplete | None = ..., dialect: str = ...) -> None: ... + def __init__(self, regex, params: Incomplete | None = None, dialect: str = "default") -> None: ... class DialectSQL(CompiledSQL): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi index 4f0abf91803a..1ef8da6dba4c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi @@ -30,7 +30,7 @@ def assert_conns_closed(fn, *args, **kw) -> None: ... def rollback_open_connections(fn, *args, **kw) -> None: ... def close_first(fn, *args, **kw) -> None: ... def close_open_connections(fn, *args, **kw) -> None: ... -def all_dialects(exclude: Incomplete | None = ...) -> None: ... +def all_dialects(exclude: Incomplete | None = None) -> None: ... class ReconnectFixture: dbapi: Any @@ -39,34 +39,34 @@ class ReconnectFixture: def __init__(self, dbapi) -> None: ... def __getattr__(self, key: str): ... def connect(self, *args, **kwargs): ... - def shutdown(self, stop: bool = ...) -> None: ... + def shutdown(self, stop: bool = False) -> None: ... def restart(self) -> None: ... -def reconnecting_engine(url: Incomplete | None = ..., options: Incomplete | None = ...): ... +def reconnecting_engine(url: Incomplete | None = None, options: Incomplete | None = None): ... @overload def testing_engine( # type: ignore[misc] - url: URL | str | None = ..., - options: Mapping[str, Any] | None = ..., - future: bool | None = ..., - asyncio: Literal[False] = ..., - transfer_staticpool: bool = ..., + url: URL | str | None = None, + options: Mapping[str, Any] | None = None, + future: bool | None = None, + asyncio: Literal[False] = False, + transfer_staticpool: bool = False, ) -> Engine: ... @overload def testing_engine( - url: URL | str | None = ..., - options: Mapping[str, Any] | None = ..., - future: bool | None = ..., - asyncio: Literal[True] = ..., - transfer_staticpool: bool = ..., + url: URL | str | None = None, + options: Mapping[str, Any] | None = None, + future: bool | None = None, + asyncio: Literal[True] = True, + transfer_staticpool: bool = False, ) -> AsyncEngine: ... -def mock_engine(dialect_name: Incomplete | None = ...): ... +def mock_engine(dialect_name: Incomplete | None = None): ... class DBAPIProxyCursor: engine: Any connection: Any cursor: Any def __init__(self, engine, conn, *args, **kwargs) -> None: ... - def execute(self, stmt, parameters: Incomplete | None = ..., **kw): ... + def execute(self, stmt, parameters: Incomplete | None = None, **kw): ... def executemany(self, stmt, params, **kw): ... def __iter__(self): ... def __getattr__(self, key: str): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi index 7041a0266bc8..f9956ef44058 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from typing import Any -def skip_if(predicate, reason: Incomplete | None = ...): ... -def fails_if(predicate, reason: Incomplete | None = ...): ... +def skip_if(predicate, reason: Incomplete | None = None): ... +def fails_if(predicate, reason: Incomplete | None = None): ... class compound: fails: Any @@ -22,17 +22,17 @@ class compound: def requires_tag(tagname): ... def tags(tagnames): ... -def only_if(predicate, reason: Incomplete | None = ...): ... -def succeeds_if(predicate, reason: Incomplete | None = ...): ... +def only_if(predicate, reason: Incomplete | None = None): ... +def succeeds_if(predicate, reason: Incomplete | None = None): ... class Predicate: @classmethod - def as_predicate(cls, predicate, description: Incomplete | None = ...): ... + def as_predicate(cls, predicate, description: Incomplete | None = None): ... class BooleanPredicate(Predicate): value: Any description: Any - def __init__(self, value, description: Incomplete | None = ...) -> None: ... + def __init__(self, value, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... class SpecPredicate(Predicate): @@ -41,7 +41,7 @@ class SpecPredicate(Predicate): spec: Any description: Any def __init__( - self, db, op: Incomplete | None = ..., spec: Incomplete | None = ..., description: Incomplete | None = ... + self, db, op: Incomplete | None = None, spec: Incomplete | None = None, description: Incomplete | None = None ) -> None: ... def __call__(self, config): ... @@ -51,30 +51,30 @@ class LambdaPredicate(Predicate): kw: Any description: Any def __init__( - self, lambda_, description: Incomplete | None = ..., args: Incomplete | None = ..., kw: Incomplete | None = ... + self, lambda_, description: Incomplete | None = None, args: Incomplete | None = None, kw: Incomplete | None = None ): ... def __call__(self, config): ... class NotPredicate(Predicate): predicate: Any description: Any - def __init__(self, predicate, description: Incomplete | None = ...) -> None: ... + def __init__(self, predicate, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... class OrPredicate(Predicate): predicates: Any description: Any - def __init__(self, predicates, description: Incomplete | None = ...) -> None: ... + def __init__(self, predicates, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... def db_spec(*dbs): ... def open(): ... def closed(): ... -def fails(reason: Incomplete | None = ...): ... +def fails(reason: Incomplete | None = None): ... def future(fn, *arg): ... -def fails_on(db, reason: Incomplete | None = ...): ... +def fails_on(db, reason: Incomplete | None = None): ... def fails_on_everything_except(*dbs): ... -def skip(db, reason: Incomplete | None = ...): ... -def only_on(dbs, reason: Incomplete | None = ...): ... -def exclude(db, op, spec, reason: Incomplete | None = ...): ... +def skip(db, reason: Incomplete | None = None): ... +def only_on(dbs, reason: Incomplete | None = None): ... +def exclude(db, op, spec, reason: Incomplete | None = None): ... def against(config, *queries): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi index 5d3f8927da9f..c2aa3d0d0525 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi @@ -9,7 +9,7 @@ class ProfileStatsFile: data: Any dump: Any sort: Any - def __init__(self, filename, sort: str = ..., dump: Incomplete | None = ...): ... + def __init__(self, filename, sort: str = "cumulative", dump: Incomplete | None = None): ... @property def platform_key(self): ... def has_stats(self): ... @@ -17,5 +17,5 @@ class ProfileStatsFile: def reset_count(self) -> None: ... def replace(self, callcount) -> None: ... -def function_call_count(variance: float = ..., times: int = ..., warmup: int = ...): ... -def count_functions(variance: float = ...) -> None: ... +def function_call_count(variance: float = 0.05, times: int = 1, warmup: int = 0): ... +def count_functions(variance: float = 0.05) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi index 0da8a3883e94..907653ac540f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi @@ -2,10 +2,10 @@ from _typeshed import Incomplete from typing import Any def non_refcount_gc_collect(*args) -> None: ... # only present on Python implementations with non-refcount gc -def gc_collect(generation: int = ...) -> None: ... +def gc_collect(generation: int = 2) -> None: ... def lazy_gc() -> None: ... def picklers(): ... -def random_choices(population, k: int = ...): ... +def random_choices(population, k: int = 1): ... def round_decimal(value, prec): ... class RandomSet(set[Any]): @@ -26,7 +26,7 @@ def provide_metadata(fn, *args, **kw): ... def flag_combinations(*combinations): ... def lambda_combinations(lambda_arg_sets, **kw): ... def resolve_lambda(__fn, **kw): ... -def metadata_fixture(ddl: str = ...): ... +def metadata_fixture(ddl: str = "function"): ... def force_drop_names(*names): ... class adict(dict[Any, Any]): @@ -35,5 +35,5 @@ class adict(dict[Any, Any]): get_all: Any def drop_all_tables_from_metadata(metadata, engine_or_connection) -> None: ... -def drop_all_tables(engine, inspector, schema: Incomplete | None = ..., include_names: Incomplete | None = ...) -> None: ... +def drop_all_tables(engine, inspector, schema: Incomplete | None = None, include_names: Incomplete | None = None) -> None: ... def teardown_events(event_cls): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi index 9aa4255ceaf6..7c72efd57763 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi @@ -4,4 +4,4 @@ class SATestSuiteWarning(sa_exc.SAWarning): ... def warn_test_suite(message) -> None: ... def setup_filters() -> None: ... -def assert_warnings(fn, warning_msgs, regex: bool = ...): ... +def assert_warnings(fn, warning_msgs, regex: bool = False): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 20f5cf724e21..7fde0fc12e9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -68,11 +68,11 @@ class ImmutableProperties(ImmutableContainer, Properties[_T], Generic[_T]): ... OrderedDict = dict -def sort_dictionary(d, key: Incomplete | None = ...): ... +def sort_dictionary(d, key: Incomplete | None = None): ... class OrderedSet(set[_T], Generic[_T]): @overload - def __init__(self, d: None = ...) -> None: ... + def __init__(self, d: None = None) -> None: ... @overload def __init__(self, d: Iterable[_T]) -> None: ... def add(self, element: _T) -> None: ... @@ -101,7 +101,7 @@ class OrderedSet(set[_T], Generic[_T]): __isub__ = difference_update # type: ignore[assignment] class IdentitySet: - def __init__(self, iterable: Incomplete | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = None) -> None: ... def add(self, value) -> None: ... def __contains__(self, value): ... def remove(self, value) -> None: ... @@ -140,14 +140,14 @@ class IdentitySet: def __hash__(self) -> int: ... class WeakSequence: - def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ...) -> None: ... + def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ()) -> None: ... def append(self, item) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, index): ... class OrderedIdentitySet(IdentitySet): - def __init__(self, iterable: Incomplete | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = None) -> None: ... class PopulateDict(dict[Any, Any]): creator: Any @@ -168,28 +168,28 @@ column_dict = dict # or pyright complains ordered_column_set = OrderedSet[_T] # noqa: Y026 -def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = ...) -> list[_T]: ... +def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = None) -> list[_T]: ... class UniqueAppender: data: Any - def __init__(self, data, via: Incomplete | None = ...) -> None: ... + def __init__(self, data, via: Incomplete | None = None) -> None: ... def append(self, item) -> None: ... def __iter__(self): ... def coerce_generator_arg(arg): ... -def to_list(x, default: Incomplete | None = ...): ... +def to_list(x, default: Incomplete | None = None): ... def has_intersection(set_, iterable): ... def to_set(x): ... def to_column_set(x): ... -def update_copy(d, _new: Incomplete | None = ..., **kw): ... +def update_copy(d, _new: Incomplete | None = None, **kw): ... def flatten_iterator(x) -> None: ... class LRUCache(dict[Any, Any]): capacity: Any threshold: Any size_alert: Any - def __init__(self, capacity: int = ..., threshold: float = ..., size_alert: Incomplete | None = ...) -> None: ... - def get(self, key, default: Incomplete | None = ...): ... + def __init__(self, capacity: int = 100, threshold: float = 0.5, size_alert: Incomplete | None = None) -> None: ... + def get(self, key, default: Incomplete | None = None): ... def __getitem__(self, key): ... def values(self): ... def setdefault(self, key, value): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi index 502245182610..4a8d24e50ee1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi @@ -8,7 +8,7 @@ from .langhelpers import memoized_property def is_exit_exception(e): ... def await_only(awaitable: Coroutine[Any, Any, Any]) -> Any: ... def await_fallback(awaitable: Coroutine[Any, Any, Any]) -> Any: ... -async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = ..., **kwargs) -> Any: ... +async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = False, **kwargs) -> Any: ... class AsyncAdaptedLock: @memoized_property diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi index eaabad39009d..f1e73ecf3a88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi @@ -3,7 +3,7 @@ from typing import Any class _ModuleRegistry: module_registry: Any prefix: Any - def __init__(self, prefix: str = ...) -> None: ... + def __init__(self, prefix: str = "sqlalchemy.") -> None: ... def preload_module(self, *deps): ... def import_prefix(self, path) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index 77dfab5c9664..02ce27adc2f5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -59,7 +59,7 @@ class FullArgSpec(NamedTuple): class nullcontext: enter_result: Any - def __init__(self, enter_result: Incomplete | None = ...) -> None: ... + def __init__(self, enter_result: Incomplete | None = None) -> None: ... def __enter__(self): ... def __exit__(self, *excinfo: Unused) -> None: ... @@ -86,18 +86,18 @@ def b64encode(x): ... def decode_backslashreplace(text, encoding): ... def cmp(a, b): ... def raise_( - exception, with_traceback: Incomplete | None = ..., replace_context: Incomplete | None = ..., from_: bool = ... + exception, with_traceback: Incomplete | None = None, replace_context: Incomplete | None = None, from_: bool = False ) -> None: ... def u(s): ... def ue(s): ... def inspect_formatargspec( args, - varargs: Incomplete | None = ..., - varkw: Incomplete | None = ..., - defaults: Incomplete | None = ..., - kwonlyargs=..., - kwonlydefaults=..., - annotations=..., + varargs: Incomplete | None = None, + varkw: Incomplete | None = None, + defaults: Incomplete | None = None, + kwonlyargs=(), + kwonlydefaults={}, + annotations={}, formatarg=..., formatvarargs=..., formatvarkw=..., @@ -107,6 +107,6 @@ def inspect_formatargspec( ): ... def dataclass_fields(cls): ... def local_dataclass_fields(cls): ... -def raise_from_cause(exception, exc_info: Incomplete | None = ...) -> None: ... -def reraise(tp, value, tb: Incomplete | None = ..., cause: Incomplete | None = ...) -> None: ... +def raise_from_cause(exception, exc_info: Incomplete | None = None) -> None: ... +def reraise(tp, value, tb: Incomplete | None = None, cause: Incomplete | None = None) -> None: ... def with_metaclass(meta, *bases, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi index ca733b24aff0..139b2b3ad029 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi @@ -8,18 +8,20 @@ from .langhelpers import ( SQLALCHEMY_WARN_20: bool -def warn_deprecated(msg, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def warn_deprecated_20(msg, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def deprecated_cls(version, message, constructor: str = ...): ... -def deprecated_20_cls(clsname, alternative: Incomplete | None = ..., constructor: str = ..., becomes_legacy: bool = ...): ... +def warn_deprecated(msg, version, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def warn_deprecated_limited(msg, args, version, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def warn_deprecated_20(msg, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def deprecated_cls(version, message, constructor: str = "__init__"): ... +def deprecated_20_cls( + clsname, alternative: Incomplete | None = None, constructor: str = "__init__", becomes_legacy: bool = False +): ... def deprecated( version, - message: Incomplete | None = ..., - add_deprecation_to_docstring: bool = ..., - warning: Incomplete | None = ..., - enable_warnings: bool = ..., + message: Incomplete | None = None, + add_deprecation_to_docstring: bool = True, + warning: Incomplete | None = None, + enable_warnings: bool = True, ): ... def moved_20(message, **kw): ... -def deprecated_20(api_name, alternative: Incomplete | None = ..., becomes_legacy: bool = ..., **kw): ... +def deprecated_20(api_name, alternative: Incomplete | None = None, becomes_legacy: bool = False, **kw): ... def deprecated_params(**specs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 9391fb90829a..a1a933f9cdde 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -12,7 +12,7 @@ def md5_hex(x): ... class safe_reraise: warn_only: Any - def __init__(self, warn_only: bool = ...) -> None: ... + def __init__(self, warn_only: bool = False) -> None: ... def __enter__(self) -> None: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None @@ -25,34 +25,34 @@ def method_is_overridden(instance_or_cls, against_method): ... def decode_slice(slc): ... def map_bits(fn, n) -> None: ... def decorator(target): ... -def public_factory(target, location, class_location: Incomplete | None = ...): ... +def public_factory(target, location, class_location: Incomplete | None = None): ... class PluginLoader: group: Any impls: Any auto_fn: Any - def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... + def __init__(self, group, auto_fn: Incomplete | None = None) -> None: ... def clear(self) -> None: ... def load(self, name): ... def register(self, name, modulepath, objname) -> None: ... -def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... +def get_cls_kwargs(cls, _set: Incomplete | None = None): ... def get_func_kwargs(func): ... -def get_callable_argspec(fn, no_self: bool = ..., _is_init: bool = ...): ... -def format_argspec_plus(fn, grouped: bool = ...): ... -def format_argspec_init(method, grouped: bool = ...): ... +def get_callable_argspec(fn, no_self: bool = False, _is_init: bool = False): ... +def format_argspec_plus(fn, grouped: bool = True): ... +def format_argspec_init(method, grouped: bool = True): ... def create_proxy_methods( - target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=..., methods=..., attributes=... + target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=(), methods=(), attributes=() ): ... def getargspec_init(method): ... def unbound_method_to_callable(func_or_cls): ... -def generic_repr(obj, additional_kw=..., to_inspect: Incomplete | None = ..., omit_kwarg=...): ... +def generic_repr(obj, additional_kw=(), to_inspect: Incomplete | None = None, omit_kwarg=()): ... class portable_instancemethod: target: Any name: Any kwargs: Any - def __init__(self, meth, kwargs=...) -> None: ... + def __init__(self, meth, kwargs=()) -> None: ... def __call__(self, *arg, **kw): ... def class_hierarchy(cls): ... @@ -60,19 +60,19 @@ def iterate_attributes(cls) -> None: ... def monkeypatch_proxied_specials( into_cls, from_cls, - skip: Incomplete | None = ..., - only: Incomplete | None = ..., - name: str = ..., - from_instance: Incomplete | None = ..., + skip: Incomplete | None = None, + only: Incomplete | None = None, + name: str = "self.proxy", + from_instance: Incomplete | None = None, ) -> None: ... def methods_equivalent(meth1, meth2): ... -def as_interface(obj, cls: Incomplete | None = ..., methods: Incomplete | None = ..., required: Incomplete | None = ...): ... +def as_interface(obj, cls: Incomplete | None = None, methods: Incomplete | None = None, required: Incomplete | None = None): ... class memoized_property(Generic[_R]): fget: Callable[..., _R] __doc__: str __name__: str - def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload def __get__(self, obj: None, cls: Unused) -> Self: ... @overload @@ -87,7 +87,7 @@ class HasMemoized: fget: Callable[..., _R] __doc__: str __name__: str - def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload def __get__(self, obj: None, cls: Unused) -> Self: ... @overload @@ -102,11 +102,11 @@ class MemoizedSlots: def asbool(obj): ... def bool_or_str(*text): ... def asint(value): ... -def coerce_kw_type(kw, key, type_, flexi_bool: bool = ..., dest: Incomplete | None = ...) -> None: ... +def coerce_kw_type(kw, key, type_, flexi_bool: bool = True, dest: Incomplete | None = None) -> None: ... def constructor_key(obj, cls): ... def constructor_copy(obj, cls, *args, **kw): ... def counter(): ... -def duck_type_collection(specimen, default: Incomplete | None = ...): ... +def duck_type_collection(specimen, default: Incomplete | None = None): ... def assert_arg_type(arg, argtype, name): ... def dictlike_iteritems(dictlike): ... @@ -134,28 +134,28 @@ class hybridmethod: class _symbol(int): def __new__( # noqa: Y034 # Excplicitely instanciates _symbol - self, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + self, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol - cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + cls, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... @classmethod - def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... + def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = False): ... def set_creation_order(instance) -> None: ... def warn_exception(func, *args, **kwargs): ... -def ellipses_string(value, len_: int = ...): ... +def ellipses_string(value, len_: int = 25): ... class _hash_limit_string(compat.text_type): def __new__(cls, value, num, args): ... def __hash__(self) -> int: ... def __eq__(self, other): ... -def warn(msg, code: Incomplete | None = ...) -> None: ... +def warn(msg, code: Incomplete | None = None) -> None: ... def warn_limited(msg, args) -> None: ... def only_once(fn, retry_on_exception): ... def chop_traceback(tb, exclude_prefix=..., exclude_suffix=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi b/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi index 7a26c25d72c7..852018369726 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi @@ -9,27 +9,27 @@ class Queue: not_empty: Any not_full: Any use_lifo: Any - def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def __init__(self, maxsize: int = 0, use_lifo: bool = False) -> None: ... def qsize(self): ... def empty(self): ... def full(self): ... - def put(self, item, block: bool = ..., timeout: Incomplete | None = ...) -> None: ... + def put(self, item, block: bool = True, timeout: Incomplete | None = None) -> None: ... def put_nowait(self, item): ... - def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def get(self, block: bool = True, timeout: Incomplete | None = None): ... def get_nowait(self): ... class AsyncAdaptedQueue: await_: Any use_lifo: Any maxsize: Any - def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def __init__(self, maxsize: int = 0, use_lifo: bool = False) -> None: ... def empty(self): ... def full(self): ... def qsize(self): ... def put_nowait(self, item): ... - def put(self, item, block: bool = ..., timeout: Incomplete | None = ...): ... + def put(self, item, block: bool = True, timeout: Incomplete | None = None): ... def get_nowait(self): ... - def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def get(self, block: bool = True, timeout: Incomplete | None = None): ... class FallbackAsyncAdaptedQueue(AsyncAdaptedQueue): await_: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi b/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi index 04428e1ba790..7f54e1a0574c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi @@ -1,3 +1,3 @@ def sort_as_subsets(tuples, allitems) -> None: ... -def sort(tuples, allitems, deterministic_order: bool = ...) -> None: ... +def sort(tuples, allitems, deterministic_order: bool = True) -> None: ... def find_cycles(tuples, allitems): ... From 88cc97887005a780754aadeb5554da1f836c8399 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 31 Mar 2023 15:31:39 -0400 Subject: [PATCH 20/25] Ran stubdefaulter before test --- .../SQLAlchemy/sqlalchemy/cimmutabledict.pyi | 2 +- .../sqlalchemy/connectors/mxodbc.pyi | 4 +- .../sqlalchemy/connectors/pyodbc.pyi | 2 +- .../sqlalchemy/dialects/firebird/base.pyi | 28 +-- .../sqlalchemy/dialects/firebird/fdb.pyi | 2 +- .../dialects/firebird/kinterbasdb.pyi | 4 +- .../sqlalchemy/dialects/mssql/base.pyi | 32 +-- .../sqlalchemy/dialects/mssql/mxodbc.pyi | 2 +- .../sqlalchemy/dialects/mssql/pyodbc.pyi | 4 +- .../sqlalchemy/dialects/mysql/aiomysql.pyi | 8 +- .../sqlalchemy/dialects/mysql/asyncmy.pyi | 8 +- .../sqlalchemy/dialects/mysql/base.pyi | 46 ++-- .../dialects/mysql/mariadbconnector.pyi | 4 +- .../sqlalchemy/dialects/mysql/mysqldb.pyi | 4 +- .../sqlalchemy/dialects/mysql/oursql.pyi | 16 +- .../sqlalchemy/dialects/mysql/pymysql.pyi | 2 +- .../sqlalchemy/dialects/mysql/types.pyi | 58 ++--- .../sqlalchemy/dialects/oracle/base.pyi | 48 ++-- .../sqlalchemy/dialects/oracle/cx_oracle.pyi | 18 +- .../sqlalchemy/dialects/postgresql/array.pyi | 4 +- .../dialects/postgresql/asyncpg.pyi | 10 +- .../sqlalchemy/dialects/postgresql/base.pyi | 74 +++--- .../sqlalchemy/dialects/postgresql/dml.pyi | 30 ++- .../sqlalchemy/dialects/postgresql/ext.pyi | 2 +- .../sqlalchemy/dialects/postgresql/hstore.pyi | 2 +- .../sqlalchemy/dialects/postgresql/json.pyi | 2 +- .../sqlalchemy/dialects/postgresql/pg8000.pyi | 12 +- .../dialects/postgresql/psycopg2.pyi | 16 +- .../sqlalchemy/dialects/sqlite/aiosqlite.pyi | 8 +- .../sqlalchemy/dialects/sqlite/base.pyi | 36 +-- .../sqlalchemy/dialects/sqlite/dml.pyi | 20 +- .../sqlalchemy/dialects/sybase/base.pyi | 20 +- .../sqlalchemy/dialects/sybase/pysybase.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/engine/base.pyi | 48 ++-- stubs/SQLAlchemy/sqlalchemy/engine/create.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi | 24 +- .../SQLAlchemy/sqlalchemy/engine/default.pyi | 32 +-- .../sqlalchemy/engine/interfaces.pyi | 42 ++-- .../sqlalchemy/engine/reflection.pyi | 32 +-- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 42 ++-- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 38 ++-- stubs/SQLAlchemy/sqlalchemy/event/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/event/registry.pyi | 9 +- stubs/SQLAlchemy/sqlalchemy/exc.pyi | 26 +-- .../sqlalchemy/ext/associationproxy.pyi | 28 +-- .../sqlalchemy/ext/asyncio/base.pyi | 2 +- .../sqlalchemy/ext/asyncio/engine.pyi | 26 +-- .../sqlalchemy/ext/asyncio/result.pyi | 20 +- .../sqlalchemy/ext/asyncio/scoping.pyi | 34 +-- .../sqlalchemy/ext/asyncio/session.pyi | 40 ++-- stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi | 20 +- stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi | 6 +- .../sqlalchemy/ext/horizontal_shard.pyi | 8 +- stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi | 2 +- .../sqlalchemy/ext/instrumentation.pyi | 6 +- .../sqlalchemy/ext/orderinglist.pyi | 6 +- .../SQLAlchemy/sqlalchemy/ext/serializer.pyi | 8 +- stubs/SQLAlchemy/sqlalchemy/future/engine.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/inspection.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/attributes.pyi | 72 +++--- stubs/SQLAlchemy/sqlalchemy/orm/base.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/clsregistry.pyi | 4 +- .../SQLAlchemy/sqlalchemy/orm/collections.pyi | 18 +- stubs/SQLAlchemy/sqlalchemy/orm/context.pyi | 12 +- stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 42 ++-- stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi | 2 +- .../sqlalchemy/orm/descriptor_props.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi | 18 +- stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi | 4 +- .../sqlalchemy/orm/instrumentation.pyi | 24 +- .../SQLAlchemy/sqlalchemy/orm/interfaces.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi | 26 +-- stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi | 62 +++--- .../sqlalchemy/orm/path_registry.pyi | 2 +- .../SQLAlchemy/sqlalchemy/orm/persistence.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 32 +-- .../sqlalchemy/orm/relationships.pyi | 106 ++++----- stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi | 60 ++--- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 104 ++++----- .../SQLAlchemy/sqlalchemy/orm/strategies.pyi | 14 +- .../sqlalchemy/orm/strategy_options.pyi | 12 +- .../SQLAlchemy/sqlalchemy/orm/unitofwork.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/orm/util.pyi | 89 ++++---- stubs/SQLAlchemy/sqlalchemy/pool/base.pyi | 24 +- stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/processors.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 10 +- stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi | 186 ++++++++-------- stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi | 56 ++--- stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi | 40 ++-- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 108 ++++----- stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi | 22 +- stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi | 30 +-- stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi | 62 +++--- stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi | 210 +++++++++--------- .../SQLAlchemy/sqlalchemy/sql/selectable.pyi | 117 +++++----- stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi | 70 +++--- .../SQLAlchemy/sqlalchemy/sql/traversals.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/sql/util.pyi | 52 ++--- stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi | 2 +- .../sqlalchemy/testing/assertions.pyi | 76 +++---- .../sqlalchemy/testing/assertsql.pyi | 6 +- .../SQLAlchemy/sqlalchemy/testing/engines.pyi | 30 +-- .../sqlalchemy/testing/exclusions.pyi | 30 +-- .../sqlalchemy/testing/profiling.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/testing/util.pyi | 8 +- .../sqlalchemy/testing/warnings.pyi | 2 +- .../sqlalchemy/util/_collections.pyi | 22 +- .../sqlalchemy/util/_concurrency_py3k.pyi | 2 +- .../SQLAlchemy/sqlalchemy/util/_preloaded.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/util/compat.pyi | 20 +- .../sqlalchemy/util/deprecations.pyi | 22 +- .../sqlalchemy/util/langhelpers.pyi | 48 ++-- stubs/SQLAlchemy/sqlalchemy/util/queue.pyi | 12 +- .../sqlalchemy/util/topological.pyi | 2 +- 122 files changed, 1572 insertions(+), 1527 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi b/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi index 9883315dce8d..1a1a3006afc3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/cimmutabledict.pyi @@ -13,7 +13,7 @@ class immutabledict(dict[_KT, _VT], Generic[_KT, _VT]): @overload def union(self, __dict: dict[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... @overload - def union(self, __dict: None = ..., **kw: SupportsKeysAndGetItem[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... + def union(self, __dict: None = None, **kw: SupportsKeysAndGetItem[_KT2, _VT2]) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... def merge_with( self, *args: SupportsKeysAndGetItem[_KT | _KT2, _VT2] | Iterable[tuple[_KT2, _VT2]] | None ) -> immutabledict[_KT | _KT2, _VT | _VT2]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi index 350b3df4aa52..3bf803352a7f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/connectors/mxodbc.pyi @@ -13,5 +13,5 @@ class MxODBCConnector(Connector): def on_connect(self): ... def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi index b0b7ce25d32e..7210734f90c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/connectors/pyodbc.pyi @@ -13,7 +13,7 @@ class PyODBCConnector(Connector): default_paramstyle: str use_setinputsizes: bool pyodbc_driver_name: Any - def __init__(self, supports_unicode_binds: Incomplete | None = ..., use_setinputsizes: bool = ..., **kw) -> None: ... + def __init__(self, supports_unicode_binds: Incomplete | None = None, use_setinputsizes: bool = False, **kw) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi index 8a323c6b427d..83dea8caaaa8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/base.pyi @@ -21,15 +21,15 @@ RESERVED_WORDS: Any class _StringType(sqltypes.String): charset: Any - def __init__(self, charset: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, charset: Incomplete | None = None, **kw) -> None: ... class VARCHAR(_StringType, sqltypes.VARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class CHAR(_StringType, sqltypes.CHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class _FBDateTime(sqltypes.DateTime): def bind_processor(self, dialect): ... @@ -51,7 +51,7 @@ class FBCompiler(compiler.SQLCompiler): def visit_startswith_op_binary(self, binary, operator, **kw): ... def visit_not_startswith_op_binary(self, binary, operator, **kw): ... def visit_mod_binary(self, binary, operator, **kw): ... - def visit_alias(self, alias, asfrom: bool = ..., **kwargs): ... # type: ignore[override] + def visit_alias(self, alias, asfrom: bool = False, **kwargs): ... # type: ignore[override] def visit_substring_func(self, func, **kw): ... def visit_length_func(self, function, **kw): ... visit_char_length_func: Any @@ -96,13 +96,13 @@ class FBDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... implicit_returning: Any def initialize(self, connection) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_column_sequence(self, connection, table_name, column_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi index 4bc56c5a6659..c2c7a025a351 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/fdb.pyi @@ -2,7 +2,7 @@ from .kinterbasdb import FBDialect_kinterbasdb class FBDialect_fdb(FBDialect_kinterbasdb): supports_statement_cache: bool - def __init__(self, enable_rowcount: bool = ..., retaining: bool = ..., **kwargs) -> None: ... + def __init__(self, enable_rowcount: bool = True, retaining: bool = False, **kwargs) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi index 163d5214b2d3..8416a63aac5a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/firebird/kinterbasdb.pyi @@ -26,11 +26,11 @@ class FBDialect_kinterbasdb(FBDialect): concurrency_level: Any retaining: Any def __init__( - self, type_conv: int = ..., concurrency_level: int = ..., enable_rowcount: bool = ..., retaining: bool = ..., **kwargs + self, type_conv: int = 200, concurrency_level: int = 1, enable_rowcount: bool = True, retaining: bool = False, **kwargs ) -> None: ... @classmethod def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... def create_connect_args(self, url): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi index 81b0d9b00848..2e5674285663 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/base.pyi @@ -45,7 +45,7 @@ class _MSDate(sqltypes.Date): class TIME(sqltypes.TIME): precision: Any - def __init__(self, precision: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, precision: Incomplete | None = None, **kwargs) -> None: ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -65,12 +65,12 @@ class SMALLDATETIME(_DateTimeBase, sqltypes.DateTime): class DATETIME2(_DateTimeBase, sqltypes.DateTime): __visit_name__: str precision: Any - def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, precision: Incomplete | None = None, **kw) -> None: ... class DATETIMEOFFSET(_DateTimeBase, sqltypes.DateTime): __visit_name__: str precision: Any - def __init__(self, precision: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, precision: Incomplete | None = None, **kw) -> None: ... class _UnicodeLiteral: def literal_processor(self, dialect): ... @@ -82,7 +82,7 @@ class TIMESTAMP(sqltypes._Binary): __visit_name__: str length: Any convert_int: Any - def __init__(self, convert_int: bool = ...) -> None: ... + def __init__(self, convert_int: bool = False) -> None: ... def result_processor(self, dialect, coltype): ... class ROWVERSION(TIMESTAMP): @@ -99,7 +99,7 @@ class VARBINARY(sqltypes.VARBINARY, sqltypes.LargeBinary): @overload def __init__(self, *, filestream: Literal[True]) -> None: ... @overload - def __init__(self, length: Incomplete | None = ..., filestream: Literal[False] = ...) -> None: ... + def __init__(self, length: Incomplete | None = None, filestream: Literal[False] = False) -> None: ... class IMAGE(sqltypes.LargeBinary): __visit_name__: str @@ -248,7 +248,7 @@ class MSSQLStrictCompiler(MSSQLCompiler): class MSDDLCompiler(compiler.DDLCompiler): def get_column_specification(self, column, **kwargs): ... - def visit_create_index(self, create, include_schema: bool = ...): ... # type: ignore[override] + def visit_create_index(self, create, include_schema: bool = False): ... # type: ignore[override] def visit_drop_index(self, drop): ... def visit_primary_key_constraint(self, constraint): ... def visit_unique_constraint(self, constraint): ... @@ -259,7 +259,7 @@ class MSDDLCompiler(compiler.DDLCompiler): class MSIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any def __init__(self, dialect) -> None: ... - def quote_schema(self, schema, force: Incomplete | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = None): ... class MSDialect(default.DefaultDialect): name: str @@ -293,15 +293,15 @@ class MSDialect(default.DefaultDialect): isolation_level: Any def __init__( self, - query_timeout: Incomplete | None = ..., - use_scope_identity: bool = ..., - schema_name: str = ..., - isolation_level: Incomplete | None = ..., - deprecate_large_types: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - legacy_schema_aliasing: Incomplete | None = ..., - ignore_no_transaction_on_rollback: bool = ..., + query_timeout: Incomplete | None = None, + use_scope_identity: bool = True, + schema_name: str = "dbo", + isolation_level: Incomplete | None = None, + deprecate_large_types: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + legacy_schema_aliasing: Incomplete | None = None, + ignore_no_transaction_on_rollback: bool = False, **opts, ) -> None: ... def do_savepoint(self, connection, name) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi index ee58d3dec742..2f0a14ffaab6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/mxodbc.pyi @@ -22,6 +22,6 @@ class MSDialect_mxodbc(MxODBCConnector, MSDialect): supports_statement_cache: bool colspecs: Any description_encoding: Any - def __init__(self, description_encoding: Incomplete | None = ..., **params) -> None: ... + def __init__(self, description_encoding: Incomplete | None = None, **params) -> None: ... dialect = MSDialect_mxodbc diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi index fed71eaeb278..70e6e362b54d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi @@ -37,9 +37,9 @@ class MSDialect_pyodbc(PyODBCConnector, MSDialect): description_encoding: Any use_scope_identity: Any fast_executemany: Any - def __init__(self, description_encoding: Incomplete | None = ..., fast_executemany: bool = ..., **params) -> None: ... + def __init__(self, description_encoding: Incomplete | None = None, fast_executemany: bool = False, **params) -> None: ... def on_connect(self): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor): ... dialect = MSDialect_pyodbc diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi index 3dc245d014bb..a91b28976d81 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/aiomysql.pyi @@ -19,12 +19,12 @@ class AsyncAdapt_aiomysql_cursor: @property def lastrowid(self): ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...): ... + def execute(self, operation, parameters: Incomplete | None = None): ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): @@ -33,7 +33,7 @@ class AsyncAdapt_aiomysql_ss_cursor(AsyncAdapt_aiomysql_cursor): def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiomysql_connection(AdaptedConnection): @@ -43,7 +43,7 @@ class AsyncAdapt_aiomysql_connection(AdaptedConnection): def ping(self, reconnect): ... def character_set_name(self): ... def autocommit(self, value) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi index f1dd233fa74c..1661a2922cab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/asyncmy.pyi @@ -21,12 +21,12 @@ class AsyncAdapt_asyncmy_cursor: @property def lastrowid(self): ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...): ... + def execute(self, operation, parameters: Incomplete | None = None): ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): @@ -35,7 +35,7 @@ class AsyncAdapt_asyncmy_ss_cursor(AsyncAdapt_asyncmy_cursor): def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_asyncmy_connection(AdaptedConnection): @@ -45,7 +45,7 @@ class AsyncAdapt_asyncmy_connection(AdaptedConnection): def ping(self, reconnect): ... def character_set_name(self): ... def autocommit(self, value) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi index 93a266921203..cae8666749fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/base.pyi @@ -90,13 +90,13 @@ class MySQLCompiler(compiler.SQLCompiler): def visit_mysql_match(self, element, **kw): ... def visit_match_op_binary(self, binary, operator, **kw): ... def get_from_hint_text(self, table, text): ... - def visit_typeclause(self, typeclause, type_: Incomplete | None = ..., **kw): ... + def visit_typeclause(self, typeclause, type_: Incomplete | None = None, **kw): ... def visit_cast(self, cast, **kw): ... def render_literal_value(self, value, type_): ... def visit_true(self, element, **kw): ... def visit_false(self, element, **kw): ... def get_select_precolumns(self, select, **kw): ... - def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ... + def visit_join(self, join, asfrom: bool = False, from_linter: Incomplete | None = None, **kwargs): ... def for_update_clause(self, select, **kw): ... def limit_clause(self, select, **kw): ... def update_limit_clause(self, update_stmt): ... @@ -162,7 +162,7 @@ class MySQLTypeCompiler(compiler.GenericTypeCompiler): class MySQLIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any - def __init__(self, dialect, server_ansiquotes: bool = ..., **kw) -> None: ... + def __init__(self, dialect, server_ansiquotes: bool = False, **kw) -> None: ... class MariaDBIdentifierPreparer(MySQLIdentifierPreparer): reserved_words: Any @@ -200,10 +200,10 @@ class MySQLDialect(default.DefaultDialect): isolation_level: Any def __init__( self, - isolation_level: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - is_mariadb: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + is_mariadb: Incomplete | None = None, **kwargs, ) -> None: ... def on_connect(self): ... @@ -211,27 +211,27 @@ class MySQLDialect(default.DefaultDialect): def get_isolation_level(self, connection): ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection): ... def is_disconnect(self, e, connection, cursor): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... identifier_preparer: Any def initialize(self, connection) -> None: ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... class _DecodingRow: rowproxy: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi index 0735fb75a28e..b4ab06a53fea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mariadbconnector.pyi @@ -30,7 +30,7 @@ class MySQLDialect_mariadbconnector(MySQLDialect): def create_connect_args(self, url): ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... dialect = MySQLDialect_mariadbconnector diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi index f9b6d148956d..8c0bff8fab9f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/mysqldb.pyi @@ -27,7 +27,7 @@ class MySQLDialect_mysqldb(MySQLDialect): def dbapi(cls): ... def on_connect(self): ... def do_ping(self, dbapi_connection): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def create_connect_args(self, url, _translate_args: Incomplete | None = None): ... dialect = MySQLDialect_mysqldb diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi index 1bc65d97b235..fa7ea6fbe59d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/oursql.pyi @@ -21,17 +21,17 @@ class MySQLDialect_oursql(MySQLDialect): colspecs: Any @classmethod def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def do_begin(self, connection) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... def initialize(self, connection): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi index 4554ebfe81ae..cf2e137c6926 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pymysql.pyi @@ -14,7 +14,7 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): def supports_server_side_cursors(self): ... @classmethod def dbapi(cls): ... - def create_connect_args(self, url, _translate_args: Incomplete | None = ...): ... + def create_connect_args(self, url, _translate_args: Incomplete | None = None): ... def is_disconnect(self, e, connection, cursor): ... dialect = MySQLDialect_pymysql diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index b68d8692a766..49252518bf6b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -6,17 +6,17 @@ from ...sql import sqltypes class _NumericType: unsigned: Any zerofill: Any - def __init__(self, unsigned: bool = ..., zerofill: bool = ..., **kw) -> None: ... + def __init__(self, unsigned: bool = False, zerofill: bool = False, **kw) -> None: ... class _FloatType(_NumericType, sqltypes.Float): scale: Any def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class _IntegerType(_NumericType, sqltypes.Integer): display_width: Any - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class _StringType(sqltypes.String): charset: Any @@ -26,12 +26,12 @@ class _StringType(sqltypes.String): national: Any def __init__( self, - charset: Incomplete | None = ..., - collation: Incomplete | None = ..., - ascii: bool = ..., - binary: bool = ..., - unicode: bool = ..., - national: bool = ..., + charset: Incomplete | None = None, + collation: Incomplete | None = None, + ascii: bool = False, + binary: bool = False, + unicode: bool = False, + national: bool = False, **kw, ) -> None: ... @@ -41,84 +41,84 @@ class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore[misc] # i class NUMERIC(_NumericType, sqltypes.NUMERIC): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class DECIMAL(_NumericType, sqltypes.DECIMAL): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class DOUBLE(_FloatType): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class REAL(_FloatType, sqltypes.REAL): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = True, **kw ) -> None: ... class FLOAT(_FloatType, sqltypes.FLOAT): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: bool = ..., **kw + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: bool = False, **kw ) -> None: ... def bind_processor(self, dialect) -> None: ... class INTEGER(_IntegerType, sqltypes.INTEGER): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class BIGINT(_IntegerType, sqltypes.BIGINT): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class MEDIUMINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class TINYINT(_IntegerType): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class SMALLINT(_IntegerType, sqltypes.SMALLINT): __visit_name__: str - def __init__(self, display_width: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, display_width: Incomplete | None = None, **kw) -> None: ... class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... def result_processor(self, dialect, coltype): ... class TIME(sqltypes.TIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... def result_processor(self, dialect, coltype): ... class TIMESTAMP(sqltypes.TIMESTAMP): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... class DATETIME(sqltypes.DATETIME): __visit_name__: str fsp: Any - def __init__(self, timezone: bool = ..., fsp: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, fsp: Incomplete | None = None) -> None: ... class YEAR(sqltypes.TypeEngine): __visit_name__: str display_width: Any - def __init__(self, display_width: Incomplete | None = ...) -> None: ... + def __init__(self, display_width: Incomplete | None = None) -> None: ... class TEXT(_StringType, sqltypes.TEXT): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, length: Incomplete | None = None, **kw) -> None: ... class TINYTEXT(_StringType): __visit_name__: str @@ -134,19 +134,19 @@ class LONGTEXT(_StringType): class VARCHAR(_StringType, sqltypes.VARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class CHAR(_StringType, sqltypes.CHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class NVARCHAR(_StringType, sqltypes.NVARCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class NCHAR(_StringType, sqltypes.NCHAR): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class TINYBLOB(sqltypes._Binary): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi index 8d1b1cb82286..2a90fcf552f3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/base.pyi @@ -34,7 +34,7 @@ NVARCHAR2 = NVARCHAR class NUMBER(sqltypes.Numeric, sqltypes.Integer): __visit_name__: str def __init__( - self, precision: Incomplete | None = ..., scale: Incomplete | None = ..., asdecimal: Incomplete | None = ... + self, precision: Incomplete | None = None, scale: Incomplete | None = None, asdecimal: Incomplete | None = None ) -> None: ... def adapt(self, impltype): ... @@ -60,8 +60,8 @@ class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str day_precision: Any second_precision: Any - def __init__(self, day_precision: Incomplete | None = ..., second_precision: Incomplete | None = ...) -> None: ... - def as_generic(self, allow_nulltype: bool = ...): ... + def __init__(self, day_precision: Incomplete | None = None, second_precision: Incomplete | None = None) -> None: ... + def as_generic(self, allow_nulltype: bool = False): ... def coerce_compared_value(self, op, value): ... class ROWID(sqltypes.TypeEngine): @@ -113,7 +113,7 @@ class OracleCompiler(compiler.SQLCompiler): def visit_function(self, func, **kw): ... def visit_table_valued_column(self, element, **kw): ... def default_from(self): ... - def visit_join(self, join, from_linter: Incomplete | None = ..., **kwargs): ... # type: ignore[override] + def visit_join(self, join, from_linter: Incomplete | None = None, **kwargs): ... # type: ignore[override] def visit_outer_join_column(self, vc, **kw): ... def visit_sequence(self, seq, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... @@ -178,11 +178,11 @@ class OracleDialect(default.DefaultDialect): exclude_tablespaces: Any def __init__( self, - use_ansi: bool = ..., - optimize_limits: bool = ..., - use_binds_for_limits: Incomplete | None = ..., - use_nchar_for_unicode: bool = ..., - exclude_tablespaces=..., + use_ansi: bool = True, + optimize_limits: bool = False, + use_binds_for_limits: Incomplete | None = None, + use_nchar_for_unicode: bool = False, + exclude_tablespaces=("SYSTEM", "SYSAUX"), **kwargs, ) -> None: ... implicit_returning: Any @@ -191,28 +191,30 @@ class OracleDialect(default.DefaultDialect): def get_isolation_level(self, connection) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def set_isolation_level(self, connection, level) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_temp_table_names(self, connection, **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_table_options(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_table_comment( - self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw ): ... def get_indexes( - self, connection, table_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw ): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_view_definition( - self, connection, view_name, schema: Incomplete | None = ..., resolve_synonyms: bool = ..., dblink: str = ..., **kw + self, connection, view_name, schema: Incomplete | None = None, resolve_synonyms: bool = False, dblink: str = "", **kw + ): ... + def get_check_constraints( + self, connection, table_name, schema: Incomplete | None = None, include_all: bool = False, **kw ): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., include_all: bool = ..., **kw): ... class _OuterJoinColumn(ClauseElement): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi index 8d0d03defaf2..c7fed1770d45 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/oracle/cx_oracle.pyi @@ -99,12 +99,12 @@ class OracleDialect_cx_oracle(OracleDialect): cx_oracle_ver: Any def __init__( self, - auto_convert_lobs: bool = ..., - coerce_to_unicode: bool = ..., - coerce_to_decimal: bool = ..., - arraysize: int = ..., - encoding_errors: Incomplete | None = ..., - threaded: Incomplete | None = ..., + auto_convert_lobs: bool = True, + coerce_to_unicode: bool = True, + coerce_to_decimal: bool = True, + arraysize: int = 50, + encoding_errors: Incomplete | None = None, + threaded: Incomplete | None = None, **kwargs, ): ... @classmethod @@ -116,11 +116,11 @@ class OracleDialect_cx_oracle(OracleDialect): def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... def create_xid(self): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... def do_recover_twophase(self, connection) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi index 114a9c1bd0a1..bfa94d1b135d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/array.pyi @@ -12,7 +12,7 @@ class array(expression.ClauseList, expression.ColumnElement[_Any]): inherit_cache: bool type: _Any def __init__(self, clauses, **kw) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... CONTAINS: _Any CONTAINED_BY: _Any @@ -29,7 +29,7 @@ class ARRAY(sqltypes.ARRAY): dimensions: _Any zero_indexes: _Any def __init__( - self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + self, item_type, as_tuple: bool = False, dimensions: Incomplete | None = None, zero_indexes: bool = False ) -> None: ... @property def hashable(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi index 7d938c0b9642..cb20a7df1818 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/asyncpg.pyi @@ -87,12 +87,12 @@ class AsyncAdapt_asyncpg_cursor: rowcount: int def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... - def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = None) -> None: ... def executemany(self, operation, seq_of_parameters): ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): @@ -102,7 +102,7 @@ class AsyncAdapt_asyncpg_ss_cursor(AsyncAdapt_asyncpg_cursor): def __aiter__(self): ... async def __anext__(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... def executemany(self, operation, seq_of_parameters) -> None: ... @@ -112,13 +112,13 @@ class AsyncAdapt_asyncpg_connection(AdaptedConnection): isolation_level: str readonly: bool deferrable: bool - def __init__(self, dbapi, connection, prepared_statement_cache_size: int = ...) -> None: ... + def __init__(self, dbapi, connection, prepared_statement_cache_size: int = 100) -> None: ... @property def autocommit(self): ... @autocommit.setter def autocommit(self, value) -> None: ... def set_isolation_level(self, level) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def rollback(self) -> None: ... def commit(self) -> None: ... def close(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index 68745b9cce6c..e90a536325c8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -60,21 +60,21 @@ class REGCLASS(sqltypes.TypeEngine): class TIMESTAMP(sqltypes.TIMESTAMP): precision: Any - def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, precision: Incomplete | None = None) -> None: ... class TIME(sqltypes.TIME): precision: Any - def __init__(self, timezone: bool = ..., precision: Incomplete | None = ...) -> None: ... + def __init__(self, timezone: bool = False, precision: Incomplete | None = None) -> None: ... class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): __visit_name__: str native: bool precision: Any fields: Any - def __init__(self, precision: Incomplete | None = ..., fields: Incomplete | None = ...) -> None: ... + def __init__(self, precision: Incomplete | None = None, fields: Incomplete | None = None) -> None: ... @classmethod def adapt_emulated_to_native(cls, interval, **kw): ... - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... @property def python_type(self): ... def coerce_compared_value(self, op, value): ... @@ -85,14 +85,14 @@ class BIT(sqltypes.TypeEngine): __visit_name__: str length: Any varying: Any - def __init__(self, length: Incomplete | None = ..., varying: bool = ...) -> None: ... + def __init__(self, length: Incomplete | None = None, varying: bool = False) -> None: ... PGBit = BIT class UUID(sqltypes.TypeEngine): __visit_name__: str as_uuid: Any - def __init__(self, as_uuid: bool = ...) -> None: ... + def __init__(self, as_uuid: bool = False) -> None: ... def coerce_compared_value(self, op, value): ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... @@ -108,17 +108,17 @@ class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore[misc] # def __init__(self, *enums, **kw) -> None: ... @classmethod def adapt_emulated_to_native(cls, impl, **kw): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... class EnumGenerator(DDLBase): checkfirst: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... class EnumDropper(DDLBase): checkfirst: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, **kwargs) -> None: ... def visit_enum(self, enum) -> None: ... class _ColonCast(elements.Cast): @@ -135,8 +135,8 @@ class PGCompiler(compiler.SQLCompiler): def visit_colon_cast(self, element, **kw): ... def visit_array(self, element, **kw): ... def visit_slice(self, element, **kw): ... - def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... - def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = ..., **kw): ... + def visit_json_getitem_op_binary(self, binary, operator, _cast_applied: bool = False, **kw): ... + def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied: bool = False, **kw): ... def visit_getitem_binary(self, binary, operator, **kw): ... def visit_aggregate_order_by(self, element, **kw): ... def visit_match_op_binary(self, binary, operator, **kw): ... @@ -197,7 +197,7 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_TSTZRANGE(self, type_, **kw): ... def visit_datetime(self, type_, **kw): ... def visit_enum(self, type_, **kw): ... - def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = ..., **kw): ... + def visit_ENUM(self, type_, identifier_preparer: Incomplete | None = None, **kw): ... def visit_TIMESTAMP(self, type_, **kw): ... def visit_TIME(self, type_, **kw): ... def visit_INTERVAL(self, type_, **kw): ... @@ -209,13 +209,13 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): class PGIdentifierPreparer(compiler.IdentifierPreparer): reserved_words: Any - def format_type(self, type_, use_schema: bool = ...): ... + def format_type(self, type_, use_schema: bool = True): ... class PGInspector(reflection.Inspector): - def get_table_oid(self, table_name, schema: Incomplete | None = ...): ... - def get_enums(self, schema: Incomplete | None = ...): ... - def get_foreign_table_names(self, schema: Incomplete | None = ...): ... - def get_view_names(self, schema: Incomplete | None = ..., include=...): ... + def get_table_oid(self, table_name, schema: Incomplete | None = None): ... + def get_enums(self, schema: Incomplete | None = None): ... + def get_foreign_table_names(self, schema: Incomplete | None = None): ... + def get_view_names(self, schema: Incomplete | None = None, include=("plain", "materialized")): ... class CreateEnumType(_CreateDropBase): __visit_name__: str @@ -275,9 +275,9 @@ class PGDialect(default.DefaultDialect): reflection_options: Any def __init__( self, - isolation_level: Incomplete | None = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... @@ -290,25 +290,25 @@ class PGDialect(default.DefaultDialect): def get_deferrable(self, connection) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection): ... def has_schema(self, connection, schema): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def has_type(self, connection, type_name, schema: Incomplete | None = ...): ... - def get_table_oid(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None): ... # type: ignore[override] + def has_type(self, connection, type_name, schema: Incomplete | None = None): ... + def get_table_oid(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., include=..., **kw): ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, include=("plain", "materialized"), **kw): ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_foreign_keys( - self, connection, table_name, schema: Incomplete | None = ..., postgresql_ignore_search_path: bool = ..., **kw + self, connection, table_name, schema: Incomplete | None = None, postgresql_ignore_search_path: bool = False, **kw ): ... def get_indexes(self, connection, table_name, schema, **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi index 8bfa11366da5..9d73ebd0499c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/dml.pyi @@ -12,14 +12,17 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - constraint: Incomplete | None = ..., - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... def on_conflict_do_nothing( - self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + self, + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, ) -> None: ... insert: Any @@ -30,7 +33,10 @@ class OnConflictClause(ClauseElement): inferred_target_elements: Any inferred_target_whereclause: Any def __init__( - self, constraint: Incomplete | None = ..., index_elements: Incomplete | None = ..., index_where: Incomplete | None = ... + self, + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, ) -> None: ... class OnConflictDoNothing(OnConflictClause): @@ -42,9 +48,9 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - constraint: Incomplete | None = ..., - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + constraint: Incomplete | None = None, + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi index c9e682f0cf83..834e86264141 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/ext.pyi @@ -11,7 +11,7 @@ class aggregate_order_by(expression.ColumnElement[Any]): type: Any order_by: Any def __init__(self, target, *order_by) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def get_children(self, **kwargs): ... class ExcludeConstraint(ColumnCollectionConstraint): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi index 683f84ff75be..936c78c68ebe 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi @@ -7,7 +7,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): __visit_name__: str hashable: bool text_type: Any - def __init__(self, text_type: Incomplete | None = ...) -> None: ... + def __init__(self, text_type: Incomplete | None = None) -> None: ... class Comparator(sqltypes.Indexable.Comparator[Any], sqltypes.Concatenable.Comparator[Any]): def has_key(self, other): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi index 5f4aa5492037..0621b3e95953 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/json.pyi @@ -9,7 +9,7 @@ class JSONPathType(sqltypes.JSON.JSONPathType): class JSON(sqltypes.JSON): astext_type: Any - def __init__(self, none_as_null: bool = ..., astext_type: Incomplete | None = ...) -> None: ... + def __init__(self, none_as_null: bool = False, astext_type: Incomplete | None = None) -> None: ... class Comparator(sqltypes.JSON.Comparator): @property diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi index e7e9d9f71e1a..5d923063a0ec 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/pg8000.pyi @@ -83,14 +83,14 @@ class ServerSideCursor: def rowcount(self): ... @property def description(self): ... - def execute(self, operation, args=..., stream: Incomplete | None = ...): ... + def execute(self, operation, args=(), stream: Incomplete | None = None): ... def executemany(self, operation, param_sets): ... def fetchone(self): ... - def fetchmany(self, num: Incomplete | None = ...): ... + def fetchmany(self, num: Incomplete | None = None): ... def fetchall(self): ... def close(self) -> None: ... def setinputsizes(self, *sizes) -> None: ... - def setoutputsize(self, size, column: Incomplete | None = ...) -> None: ... + def setoutputsize(self, size, column: Incomplete | None = None) -> None: ... class PGCompiler_pg8000(PGCompiler): def visit_mod_binary(self, binary, operator, **kw): ... @@ -112,7 +112,7 @@ class PGDialect_pg8000(PGDialect): description_encoding: Any colspecs: Any client_encoding: Any - def __init__(self, client_encoding: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, client_encoding: Incomplete | None = None, **kwargs) -> None: ... @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... @@ -126,8 +126,8 @@ class PGDialect_pg8000(PGDialect): def do_set_input_sizes(self, cursor, list_of_tuples, context) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection): ... def on_connect(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi index 9305ed47e9fb..d80b3f47112c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/psycopg2.pyi @@ -69,13 +69,13 @@ class PGDialect_psycopg2(PGDialect): executemany_values_page_size: Any def __init__( self, - use_native_unicode: bool = ..., - client_encoding: Incomplete | None = ..., - use_native_hstore: bool = ..., - use_native_uuid: bool = ..., - executemany_mode: str = ..., - executemany_batch_page_size: int = ..., - executemany_values_page_size: int = ..., + use_native_unicode: bool = True, + client_encoding: Incomplete | None = None, + use_native_hstore: bool = True, + use_native_uuid: bool = True, + executemany_mode: str = "values_only", + executemany_batch_page_size: int = 100, + executemany_values_page_size: int = 1000, **kwargs, ) -> None: ... def initialize(self, connection) -> None: ... @@ -88,7 +88,7 @@ class PGDialect_psycopg2(PGDialect): def get_deferrable(self, connection): ... def do_ping(self, dbapi_connection): ... def on_connect(self): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def create_connect_args(self, url): ... def is_disconnect(self, e, connection, cursor): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi index 8d48580c102a..a4c15cb91385 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/aiosqlite.pyi @@ -14,12 +14,12 @@ class AsyncAdapt_aiosqlite_cursor: def __init__(self, adapt_connection) -> None: ... def close(self) -> None: ... lastrowid: int - def execute(self, operation, parameters: Incomplete | None = ...) -> None: ... + def execute(self, operation, parameters: Incomplete | None = None) -> None: ... def executemany(self, operation, seq_of_parameters) -> None: ... def setinputsizes(self, *inputsizes) -> None: ... def __iter__(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): @@ -27,7 +27,7 @@ class AsyncAdapt_aiosqlite_ss_cursor(AsyncAdapt_aiosqlite_cursor): def __init__(self, *arg, **kw) -> None: ... def close(self) -> None: ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def fetchall(self): ... class AsyncAdapt_aiosqlite_connection(AdaptedConnection): @@ -39,7 +39,7 @@ class AsyncAdapt_aiosqlite_connection(AdaptedConnection): @isolation_level.setter def isolation_level(self, value) -> None: ... def create_function(self, *args, **kw) -> None: ... - def cursor(self, server_side: bool = ...): ... + def cursor(self, server_side: bool = False): ... def execute(self, *args, **kw): ... def rollback(self) -> None: ... def commit(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi index ab1c8df9f3a9..135442bab1a7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/base.pyi @@ -23,7 +23,7 @@ class _SQliteJson(JSON): def result_processor(self, dialect, coltype): ... class _DateTimeMixin: - def __init__(self, storage_format: Incomplete | None = ..., regexp: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, storage_format: Incomplete | None = None, regexp: Incomplete | None = None, **kw) -> None: ... @property def format_is_text_affinity(self): ... def adapt(self, cls, **kw): ... @@ -76,7 +76,7 @@ class SQLiteDDLCompiler(compiler.DDLCompiler): def visit_column_check_constraint(self, constraint): ... def visit_foreign_key_constraint(self, constraint): ... def define_constraint_remote_table(self, constraint, table, preparer): ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ...): ... # type: ignore[override] + def visit_create_index(self, create, include_schema: bool = False, include_table_schema: bool = True): ... # type: ignore[override] def post_create_table(self, table): ... class SQLiteTypeCompiler(compiler.GenericTypeCompiler): @@ -115,27 +115,27 @@ class SQLiteDialect(default.DefaultDialect): native_datetime: Any def __init__( self, - isolation_level: Incomplete | None = ..., - native_datetime: bool = ..., - json_serializer: Incomplete | None = ..., - json_deserializer: Incomplete | None = ..., - _json_serializer: Incomplete | None = ..., - _json_deserializer: Incomplete | None = ..., + isolation_level: Incomplete | None = None, + native_datetime: bool = False, + json_serializer: Incomplete | None = None, + json_deserializer: Incomplete | None = None, + _json_serializer: Incomplete | None = None, + _json_deserializer: Incomplete | None = None, **kwargs, ) -> None: ... def set_isolation_level(self, connection, level) -> None: ... def get_isolation_level(self, connection): ... def on_connect(self): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... def get_temp_table_names(self, connection, **kw): ... def get_temp_view_names(self, connection, **kw): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi index 8982c9ada9d0..139c0f170a12 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sqlite/dml.pyi @@ -12,12 +12,12 @@ class Insert(StandardInsert): def excluded(self): ... def on_conflict_do_update( self, - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... - def on_conflict_do_nothing(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... + def on_conflict_do_nothing(self, index_elements: Incomplete | None = None, index_where: Incomplete | None = None) -> None: ... insert: Any @@ -26,7 +26,7 @@ class OnConflictClause(ClauseElement): constraint_target: Any inferred_target_elements: Any inferred_target_whereclause: Any - def __init__(self, index_elements: Incomplete | None = ..., index_where: Incomplete | None = ...) -> None: ... + def __init__(self, index_elements: Incomplete | None = None, index_where: Incomplete | None = None) -> None: ... class OnConflictDoNothing(OnConflictClause): __visit_name__: str @@ -37,8 +37,8 @@ class OnConflictDoUpdate(OnConflictClause): update_whereclause: Any def __init__( self, - index_elements: Incomplete | None = ..., - index_where: Incomplete | None = ..., - set_: Incomplete | None = ..., - where: Incomplete | None = ..., + index_elements: Incomplete | None = None, + index_where: Incomplete | None = None, + set_: Incomplete | None = None, + where: Incomplete | None = None, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi index e464a67f89a0..52533ce99fd4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/base.pyi @@ -76,7 +76,7 @@ ischema_names: Any class SybaseInspector(reflection.Inspector): def __init__(self, conn) -> None: ... - def get_table_id(self, table_name, schema: Incomplete | None = ...): ... + def get_table_id(self, table_name, schema: Incomplete | None = None): ... class SybaseExecutionContext(default.DefaultExecutionContext): def set_ddl_autocommit(self, connection, value) -> None: ... @@ -123,13 +123,13 @@ class SybaseDialect(default.DefaultDialect): def __init__(self, *args, **kwargs) -> None: ... max_identifier_length: int def initialize(self, connection) -> None: ... - def get_table_id(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_id(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw): ... def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw): ... - def has_table(self, connection, table_name, schema: Incomplete | None = ...): ... # type: ignore[override] + def get_table_names(self, connection, schema: Incomplete | None = None, **kw): ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw): ... + def has_table(self, connection, table_name, schema: Incomplete | None = None): ... # type: ignore[override] diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi index b66e7c0c0c7e..c57e68804360 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pysybase.pyi @@ -22,7 +22,7 @@ class SybaseDialect_pysybase(SybaseDialect): @classmethod def dbapi(cls): ... def create_connect_args(self, url): ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor): ... dialect = SybaseDialect_pysybase diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index 79013d653491..a4cdd5970106 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -31,13 +31,13 @@ class Connection(Connectable): def __init__( self, engine: Engine, - connection: DBAPIConnection | None = ..., - close_with_result: bool = ..., - _branch_from: Incomplete | None = ..., - _execution_options: Incomplete | None = ..., - _dispatch: Incomplete | None = ..., - _has_events: Incomplete | None = ..., - _allow_revalidate: bool = ..., + connection: DBAPIConnection | None = None, + close_with_result: bool = False, + _branch_from: Incomplete | None = None, + _execution_options: Incomplete | None = None, + _dispatch: Incomplete | None = None, + _has_events: Incomplete | None = None, + _allow_revalidate: bool = True, ) -> None: ... def schema_for_object(self, obj) -> str | None: ... def __enter__(self: Self) -> Self: ... @@ -57,15 +57,15 @@ class Connection(Connectable): def default_isolation_level(self): ... @property def info(self): ... - def connect(self, close_with_result: bool = ...): ... # type: ignore[override] - def invalidate(self, exception: Exception | None = ...) -> None: ... + def connect(self, close_with_result: bool = False): ... # type: ignore[override] + def invalidate(self, exception: Exception | None = None) -> None: ... def detach(self) -> None: ... def begin(self) -> Transaction: ... def begin_nested(self) -> Transaction | None: ... - def begin_twophase(self, xid: Incomplete | None = ...) -> TwoPhaseTransaction: ... + def begin_twophase(self, xid: Incomplete | None = None) -> TwoPhaseTransaction: ... def recover_twophase(self): ... - def rollback_prepared(self, xid, recover: bool = ...) -> None: ... - def commit_prepared(self, xid, recover: bool = ...) -> None: ... + def rollback_prepared(self, xid, recover: bool = False) -> None: ... + def commit_prepared(self, xid, recover: bool = False) -> None: ... def in_transaction(self) -> bool: ... def in_nested_transaction(self) -> bool: ... def get_transaction(self) -> Transaction | None: ... @@ -81,7 +81,7 @@ class Connection(Connectable): @overload def execute(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params) -> CursorResult: ... def exec_driver_sql( - self, statement: str, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ... + self, statement: str, parameters: Incomplete | None = None, execution_options: Incomplete | None = None ): ... def transaction(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... def run_callable(self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... @@ -156,11 +156,11 @@ class Engine(Connectable, Identified): pool: Pool, dialect: Dialect, url: str | URL, - logging_name: str | None = ..., - echo: _EchoFlag = ..., - query_cache_size: int = ..., - execution_options: Mapping[str, Any] | None = ..., - hide_parameters: bool = ..., + logging_name: str | None = None, + echo: _EchoFlag = None, + query_cache_size: int = 500, + execution_options: Mapping[str, Any] | None = None, + hide_parameters: bool = False, ) -> None: ... @property def engine(self) -> Engine: ... @@ -172,7 +172,7 @@ class Engine(Connectable, Identified): def name(self) -> str: ... @property def driver(self): ... - def dispose(self, close: bool = ...) -> None: ... + def dispose(self, close: bool = True) -> None: ... class _trans_ctx: conn: Connection @@ -184,7 +184,7 @@ class Engine(Connectable, Identified): self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def begin(self, close_with_result: bool = ...) -> _trans_ctx: ... + def begin(self, close_with_result: bool = False) -> _trans_ctx: ... def transaction( self, callable_: Callable[Concatenate[Connection, _P], _T], *args: _P.args, **kwargs: _P.kwargs ) -> _T | None: ... @@ -197,10 +197,10 @@ class Engine(Connectable, Identified): def scalar(self, statement: _Executable, *multiparams: Mapping[str, Any], **params: Any) -> Any: ... @overload def scalar(self, statement: str, *multiparams: Any | tuple[Any, ...] | Mapping[str, Any], **params: Any) -> Any: ... - def connect(self, close_with_result: bool = ...) -> Connection: ... # type: ignore[override] - def table_names(self, schema: Incomplete | None = ..., connection: Connection | None = ...): ... - def has_table(self, table_name: str, schema: Incomplete | None = ...) -> bool: ... - def raw_connection(self, _connection: Connection | None = ...) -> DBAPIConnection: ... + def connect(self, close_with_result: bool = False) -> Connection: ... # type: ignore[override] + def table_names(self, schema: Incomplete | None = None, connection: Connection | None = None): ... + def has_table(self, table_name: str, schema: Incomplete | None = None) -> bool: ... + def raw_connection(self, _connection: Connection | None = None) -> DBAPIConnection: ... class OptionEngineMixin: url: URL diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi index 97070a374a09..ae20f2002a80 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/create.pyi @@ -17,6 +17,6 @@ def create_engine( ) -> FutureEngine: ... @overload def create_engine( - url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = ..., **kwargs + url: URL | str, *, module: Incomplete | None = ..., enable_from_linting: bool = ..., future: Literal[False] = False, **kwargs ) -> Engine: ... -def engine_from_config(configuration: Mapping[str, Any], prefix: str = ..., **kwargs) -> Engine: ... +def engine_from_config(configuration: Mapping[str, Any], prefix: str = "sqlalchemy.", **kwargs) -> Engine: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi index b9787943cbec..c5e8f76fafc9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/cursor.pyi @@ -27,16 +27,16 @@ class ResultFetchStrategy: def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...) -> None: ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...) -> None: ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False) -> None: ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None) -> None: ... def fetchall(self, result) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... class NoCursorFetchStrategy(ResultFetchStrategy): def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class NoCursorDQLFetchStrategy(NoCursorFetchStrategy): ... @@ -47,33 +47,33 @@ class CursorFetchStrategy(ResultFetchStrategy): def hard_close(self, result, dbapi_cursor) -> None: ... def handle_exception(self, result, dbapi_cursor, err) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class BufferedRowCursorFetchStrategy(CursorFetchStrategy): def __init__( - self, dbapi_cursor, execution_options, growth_factor: int = ..., initial_buffer: Incomplete | None = ... + self, dbapi_cursor, execution_options, growth_factor: int = 5, initial_buffer: Incomplete | None = None ) -> None: ... @classmethod def create(cls, result): ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class FullyBufferedCursorFetchStrategy(CursorFetchStrategy): alternate_cursor_description: Any def __init__( - self, dbapi_cursor, alternate_description: Incomplete | None = ..., initial_buffer: Incomplete | None = ... + self, dbapi_cursor, alternate_description: Incomplete | None = None, initial_buffer: Incomplete | None = None ) -> None: ... def yield_per(self, result, dbapi_cursor, num) -> None: ... def soft_close(self, result, dbapi_cursor) -> None: ... def hard_close(self, result, dbapi_cursor) -> None: ... - def fetchone(self, result, dbapi_cursor, hard_close: bool = ...): ... - def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = ...): ... + def fetchone(self, result, dbapi_cursor, hard_close: bool = False): ... + def fetchmany(self, result, dbapi_cursor, size: Incomplete | None = None): ... def fetchall(self, result, dbapi_cursor): ... class _NoResultMetaData(ResultMetaData): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi index 1e872b1aa8bb..2bfb752ef92e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/default.pyi @@ -90,17 +90,17 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] compiler_linting: Any def __init__( self, - convert_unicode: bool = ..., - encoding: str = ..., - paramstyle: Incomplete | None = ..., - dbapi: Incomplete | None = ..., - implicit_returning: Incomplete | None = ..., - case_sensitive: bool = ..., - supports_native_boolean: Incomplete | None = ..., - max_identifier_length: Incomplete | None = ..., - label_length: Incomplete | None = ..., - compiler_linting=..., - server_side_cursors: bool = ..., + convert_unicode: bool = False, + encoding: str = "utf-8", + paramstyle: Incomplete | None = None, + dbapi: Incomplete | None = None, + implicit_returning: Incomplete | None = None, + case_sensitive: bool = True, + supports_native_boolean: Incomplete | None = None, + max_identifier_length: Incomplete | None = None, + label_length: Incomplete | None = None, + compiler_linting=0, + server_side_cursors: bool = False, **kwargs, ) -> None: ... @property @@ -117,7 +117,7 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def on_connect(self) -> None: ... def get_default_isolation_level(self, dbapi_conn): ... def type_descriptor(self, typeobj): ... - def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...): ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = None): ... def validate_identifier(self, ident) -> None: ... def connect(self, *cargs, **cparams): ... def create_connect_args(self, url): ... @@ -132,9 +132,9 @@ class DefaultDialect(interfaces.Dialect): # type: ignore[misc] def do_savepoint(self, connection, name) -> None: ... def do_rollback_to_savepoint(self, connection, name) -> None: ... def do_release_savepoint(self, connection, name) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, context: Incomplete | None = ...) -> None: ... # type: ignore[override] + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute_no_params(self, cursor, statement, context: Incomplete | None = None) -> None: ... # type: ignore[override] def is_disconnect(self, e, connection, cursor): ... def reset_isolation_level(self, dbapi_conn) -> None: ... def normalize_name(self, name): ... @@ -217,6 +217,6 @@ class DefaultExecutionContext(interfaces.ExecutionContext): def inserted_primary_key_rows(self): ... def lastrow_has_defaults(self): ... current_parameters: Any - def get_current_parameters(self, isolate_multiinsert_groups: bool = ...): ... + def get_current_parameters(self, isolate_multiinsert_groups: bool = True): ... def get_insert_default(self, column): ... def get_update_default(self, column): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi index da4597688e56..714002b31458 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/interfaces.pyi @@ -54,24 +54,24 @@ class Dialect: # as abstract. @classmethod def type_descriptor(cls, typeobj) -> None: ... - def get_columns(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_temp_table_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_sequence_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_temp_view_names(self, connection, schema: Incomplete | None = ..., **kw) -> None: ... - def get_view_definition(self, connection, view_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_indexes(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_check_constraints(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def get_table_comment(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... + def get_columns(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_pk_constraint(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_foreign_keys(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_table_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_temp_table_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_view_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_sequence_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_temp_view_names(self, connection, schema: Incomplete | None = None, **kw) -> None: ... + def get_view_definition(self, connection, view_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_indexes(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_unique_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_check_constraints(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def get_table_comment(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... def normalize_name(self, name) -> None: ... def denormalize_name(self, name) -> None: ... - def has_table(self, connection, table_name, schema: Incomplete | None = ..., **kw) -> None: ... - def has_index(self, connection, table_name, index_name, schema: Incomplete | None = ...) -> None: ... - def has_sequence(self, connection, sequence_name, schema: Incomplete | None = ..., **kw) -> None: ... + def has_table(self, connection, table_name, schema: Incomplete | None = None, **kw) -> None: ... + def has_index(self, connection, table_name, index_name, schema: Incomplete | None = None) -> None: ... + def has_sequence(self, connection, sequence_name, schema: Incomplete | None = None, **kw) -> None: ... def do_begin(self, dbapi_connection) -> None: ... def do_rollback(self, dbapi_connection) -> None: ... def do_commit(self, dbapi_connection) -> None: ... @@ -84,12 +84,12 @@ class Dialect: def do_release_savepoint(self, connection, name) -> None: ... def do_begin_twophase(self, connection, xid) -> None: ... def do_prepare_twophase(self, connection, xid) -> None: ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...) -> None: ... + def do_rollback_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... + def do_commit_twophase(self, connection, xid, is_prepared: bool = True, recover: bool = False) -> None: ... def do_recover_twophase(self, connection) -> None: ... - def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... - def do_execute_no_params(self, cursor, statement, parameters, context: Incomplete | None = ...) -> None: ... + def do_executemany(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... + def do_execute_no_params(self, cursor, statement, parameters, context: Incomplete | None = None) -> None: ... def is_disconnect(self, e, connection, cursor) -> None: ... def connect(self, *cargs, **cparams) -> DBAPIConnection: ... def reset_isolation_level(self, dbapi_conn) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi index 350ba42ee0df..242cf7868d78 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/reflection.pyi @@ -9,24 +9,24 @@ class Inspector: @property def default_schema_name(self): ... def get_schema_names(self): ... - def get_table_names(self, schema: Incomplete | None = ...): ... - def has_table(self, table_name, schema: Incomplete | None = ...): ... - def has_sequence(self, sequence_name, schema: Incomplete | None = ...): ... - def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = ...): ... + def get_table_names(self, schema: Incomplete | None = None): ... + def has_table(self, table_name, schema: Incomplete | None = None): ... + def has_sequence(self, sequence_name, schema: Incomplete | None = None): ... + def get_sorted_table_and_fkc_names(self, schema: Incomplete | None = None): ... def get_temp_table_names(self): ... def get_temp_view_names(self): ... - def get_table_options(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_view_names(self, schema: Incomplete | None = ...): ... - def get_sequence_names(self, schema: Incomplete | None = ...): ... - def get_view_definition(self, view_name, schema: Incomplete | None = ...): ... - def get_columns(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_pk_constraint(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_foreign_keys(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_indexes(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_unique_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_table_comment(self, table_name, schema: Incomplete | None = ..., **kw): ... - def get_check_constraints(self, table_name, schema: Incomplete | None = ..., **kw): ... + def get_table_options(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_view_names(self, schema: Incomplete | None = None): ... + def get_sequence_names(self, schema: Incomplete | None = None): ... + def get_view_definition(self, view_name, schema: Incomplete | None = None): ... + def get_columns(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_pk_constraint(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_foreign_keys(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_indexes(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_unique_constraints(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_table_comment(self, table_name, schema: Incomplete | None = None, **kw): ... + def get_check_constraints(self, table_name, schema: Incomplete | None = None, **kw): ... def reflecttable(self, *args, **kwargs): ... def reflect_table( - self, table, include_columns, exclude_columns=..., resolve_fks: bool = ..., _extend_on: Incomplete | None = ... + self, table, include_columns, exclude_columns=(), resolve_fks: bool = True, _extend_on: Incomplete | None = None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index e98cba7da3ff..05097cadfebb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -21,14 +21,14 @@ class SimpleResultMetaData(ResultMetaData): def __init__( self, keys, - extra: Incomplete | None = ..., - _processors: Incomplete | None = ..., - _tuplefilter: Incomplete | None = ..., - _translated_indexes: Incomplete | None = ..., - _unique_filters: Incomplete | None = ..., + extra: Incomplete | None = None, + _processors: Incomplete | None = None, + _tuplefilter: Incomplete | None = None, + _translated_indexes: Incomplete | None = None, + _unique_filters: Incomplete | None = None, ) -> None: ... -def result_tuple(fields, extra: Incomplete | None = ...): ... +def result_tuple(fields, extra: Incomplete | None = None): ... class ResultInternal(InPlaceGenerative): ... @@ -41,16 +41,16 @@ class Result(_WithKeys, ResultInternal): @property def closed(self): ... def yield_per(self: Self, num: int) -> Self: ... - def unique(self: Self, strategy: Incomplete | None = ...) -> Self: ... + def unique(self: Self, strategy: Incomplete | None = None) -> Self: ... def columns(self, *col_expressions): ... - def scalars(self, index: int = ...) -> ScalarResult: ... + def scalars(self, index: int = 0) -> ScalarResult: ... def mappings(self) -> MappingResult: ... def __iter__(self): ... def __next__(self): ... - def partitions(self, size: int | None = ...) -> Generator[list[Row], None, None]: ... + def partitions(self, size: int | None = None) -> Generator[list[Row], None, None]: ... def fetchall(self) -> list[Row]: ... def fetchone(self) -> Row | None: ... - def fetchmany(self, size: int | None = ...) -> list[Row]: ... + def fetchmany(self, size: int | None = None) -> list[Row]: ... def all(self) -> list[Row]: ... def first(self) -> Row | None: ... def one_or_none(self) -> Row | None: ... @@ -69,10 +69,10 @@ class FilterResult(ResultInternal): class ScalarResult(FilterResult): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... - def partitions(self, size: Incomplete | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = None): ... + def partitions(self, size: Incomplete | None = None) -> None: ... def fetchall(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -82,12 +82,12 @@ class ScalarResult(FilterResult): class MappingResult(_WithKeys, FilterResult): def __init__(self, result) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - def partitions(self, size: Incomplete | None = ...) -> None: ... + def partitions(self, size: Incomplete | None = None) -> None: ... def fetchall(self): ... def fetchone(self): ... - def fetchmany(self, size: Incomplete | None = ...): ... + def fetchmany(self, size: Incomplete | None = None): ... def all(self): ... def __iter__(self): ... def __next__(self): ... @@ -106,7 +106,9 @@ class FrozenResult: class IteratorResult(Result): iterator: Any raw: Any - def __init__(self, cursor_metadata, iterator, raw: Incomplete | None = ..., _source_supports_scalars: bool = ...) -> None: ... + def __init__( + self, cursor_metadata, iterator, raw: Incomplete | None = None, _source_supports_scalars: bool = False + ) -> None: ... @property def closed(self): ... @@ -121,9 +123,9 @@ class ChunkedIteratorResult(IteratorResult): self, cursor_metadata, chunks, - source_supports_scalars: bool = ..., - raw: Incomplete | None = ..., - dynamic_yield_per: bool = ..., + source_supports_scalars: bool = False, + raw: Incomplete | None = None, + dynamic_yield_per: bool = False, ) -> None: ... class MergedResult(IteratorResult): diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 04a8ab923ae8..5ce97d688fd6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -24,31 +24,33 @@ class URL(_URLTuple): def create( cls, drivername: str, - username: str | None = ..., - password: str | object | None = ..., # object that produces a password when called with str() - host: str | None = ..., - port: int | None = ..., - database: str | None = ..., + username: str | None = None, + password: str | object | None = None, # object that produces a password when called with str() + host: str | None = None, + port: int | None = None, + database: str | None = None, query: _Query | None = ..., ) -> URL: ... def set( self: Self, - drivername: str | None = ..., - username: str | None = ..., - password: str | object | None = ..., - host: str | None = ..., - port: int | None = ..., - database: str | None = ..., - query: _Query | None = ..., + drivername: str | None = None, + username: str | None = None, + password: str | object | None = None, + host: str | None = None, + port: int | None = None, + database: str | None = None, + query: _Query | None = None, + ) -> Self: ... + def update_query_string(self: Self, query_string: str, append: bool = False) -> Self: ... + def update_query_pairs(self: Self, key_value_pairs: Iterable[tuple[str, str]], append: bool = False) -> Self: ... + def update_query_dict( + self: Self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = False ) -> Self: ... - def update_query_string(self: Self, query_string: str, append: bool = ...) -> Self: ... - def update_query_pairs(self: Self, key_value_pairs: Iterable[tuple[str, str]], append: bool = ...) -> Self: ... - def update_query_dict(self: Self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = ...) -> Self: ... def difference_update_query(self, names: Iterable[str]) -> URL: ... @property def normalized_query(self) -> immutabledict[str, tuple[str, ...]]: ... - def __to_string__(self, hide_password: bool = ...) -> str: ... - def render_as_string(self, hide_password: bool = ...) -> str: ... + def __to_string__(self, hide_password: bool = True) -> str: ... + def render_as_string(self, hide_password: bool = True) -> str: ... def __copy__(self: Self) -> Self: ... def __deepcopy__(self: Self, memo: object) -> Self: ... def __hash__(self) -> int: ... @@ -57,6 +59,6 @@ class URL(_URLTuple): def get_backend_name(self) -> str: ... def get_driver_name(self) -> str: ... def get_dialect(self) -> type[Dialect]: ... - def translate_connect_args(self, names: list[str] | None = ..., **kw: str) -> dict[str, Any]: ... + def translate_connect_args(self, names: list[str] | None = None, **kw: str) -> dict[str, Any]: ... def make_url(name_or_url: str | URL) -> URL: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi index d968c86e5ddd..d367033311fb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/base.pyi @@ -5,7 +5,7 @@ class _UnpickleDispatch: def __call__(self, _instance_cls): ... class _Dispatch: - def __init__(self, parent, instance_cls: Incomplete | None = ...) -> None: ... + def __init__(self, parent, instance_cls: Incomplete | None = None) -> None: ... def __getattr__(self, name: str): ... def __reduce__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi b/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi index f513b9664f50..616d3d784803 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/registry.pyi @@ -8,14 +8,19 @@ class _EventKey: fn_key: Any fn_wrap: Any dispatch_target: Any - def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = ...) -> None: ... + def __init__(self, target, identifier, fn, dispatch_target, _fn_wrap: Incomplete | None = None) -> None: ... def with_wrapper(self, fn_wrap): ... def with_dispatch_target(self, dispatch_target): ... def listen(self, *args, **kw) -> None: ... def remove(self) -> None: ... def contains(self): ... def base_listen( - self, propagate: bool = ..., insert: bool = ..., named: bool = ..., retval: Incomplete | None = ..., asyncio: bool = ... + self, + propagate: bool = False, + insert: bool = False, + named: bool = False, + retval: Incomplete | None = None, + asyncio: bool = False, ) -> None: ... def append_to_list(self, owner, list_): ... def remove_from_list(self, owner, list_) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/exc.pyi b/stubs/SQLAlchemy/sqlalchemy/exc.pyi index 30dba09fc49b..876de1270d83 100644 --- a/stubs/SQLAlchemy/sqlalchemy/exc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/exc.pyi @@ -22,7 +22,7 @@ class AmbiguousForeignKeysError(ArgumentError): ... class CircularDependencyError(SQLAlchemyError): cycles: Any edges: Any - def __init__(self, message, cycles, edges, msg: Incomplete | None = ..., code: Incomplete | None = ...) -> None: ... + def __init__(self, message, cycles, edges, msg: Incomplete | None = None, code: Incomplete | None = None) -> None: ... def __reduce__(self): ... class CompileError(SQLAlchemyError): ... @@ -32,7 +32,7 @@ class UnsupportedCompilationError(CompileError): compiler: Any element_type: Any message: str | None - def __init__(self, compiler, element_type, message: str | None = ...) -> None: ... + def __init__(self, compiler, element_type, message: str | None = None) -> None: ... def __reduce__(self): ... class IdentifierError(SQLAlchemyError): ... @@ -88,9 +88,9 @@ class StatementError(SQLAlchemyError): statement, params, orig, - hide_parameters: bool = ..., - code: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + code: Incomplete | None = None, + ismulti: Incomplete | None = None, ) -> None: ... def add_detail(self, msg) -> None: ... def __reduce__(self): ... @@ -104,10 +104,10 @@ class DBAPIError(StatementError): params, orig, dbapi_base_err, - hide_parameters: bool = ..., - connection_invalidated: bool = ..., - dialect: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + connection_invalidated: bool = False, + dialect: Incomplete | None = None, + ismulti: Incomplete | None = None, ): ... def __reduce__(self): ... connection_invalidated: Any @@ -116,10 +116,10 @@ class DBAPIError(StatementError): statement, params, orig, - hide_parameters: bool = ..., - connection_invalidated: bool = ..., - code: Incomplete | None = ..., - ismulti: Incomplete | None = ..., + hide_parameters: bool = False, + connection_invalidated: bool = False, + code: Incomplete | None = None, + ismulti: Incomplete | None = None, ) -> None: ... class InterfaceError(DBAPIError): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi index a3ebf8f728b8..a0b57ebcb686 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -25,17 +25,17 @@ class AssociationProxy(interfaces.InspectionAttrInfo): self, target_collection, attr, - creator: Incomplete | None = ..., - getset_factory: Incomplete | None = ..., - proxy_factory: Incomplete | None = ..., - proxy_bulk_set: Incomplete | None = ..., - info: Incomplete | None = ..., - cascade_scalar_deletes: bool = ..., + creator: Incomplete | None = None, + getset_factory: Incomplete | None = None, + proxy_factory: Incomplete | None = None, + proxy_bulk_set: Incomplete | None = None, + info: Incomplete | None = None, + cascade_scalar_deletes: bool = False, ) -> None: ... def __get__(self, obj, class_): ... def __set__(self, obj, values) -> None: ... def __delete__(self, obj) -> None: ... - def for_class(self, class_, obj: Incomplete | None = ...): ... + def for_class(self, class_, obj: Incomplete | None = None): ... class AssociationProxyInstance: parent: Any @@ -62,15 +62,15 @@ class AssociationProxyInstance: def get(self, obj): ... def set(self, obj, values) -> None: ... def delete(self, obj) -> None: ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... class AmbiguousAssociationProxyInstance(AssociationProxyInstance): def get(self, obj): ... def __eq__(self, obj): ... def __ne__(self, obj): ... - def any(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... - def has(self, criterion: Incomplete | None = ..., **kwargs) -> None: ... + def any(self, criterion: Incomplete | None = None, **kwargs) -> None: ... + def has(self, criterion: Incomplete | None = None, **kwargs) -> None: ... class ObjectAssociationProxyInstance(AssociationProxyInstance): def contains(self, obj): ... @@ -113,7 +113,7 @@ class _AssociationList(_AssociationCollection): def count(self, value): ... def extend(self, values) -> None: ... def insert(self, index, value) -> None: ... - def pop(self, index: int = ...): ... + def pop(self, index: int = -1): ... def remove(self, value) -> None: ... def reverse(self) -> None: ... def sort(self) -> None: ... @@ -150,8 +150,8 @@ class _AssociationDict(_AssociationCollection): def __gt__(self, other): ... def __ge__(self, other): ... def __cmp__(self, other): ... - def get(self, key, default: Incomplete | None = ...): ... - def setdefault(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... + def setdefault(self, key, default: Incomplete | None = None): ... def keys(self): ... def items(self): ... def values(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi index 04c653395972..423346b6de9a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/base.pyi @@ -4,7 +4,7 @@ class ReversibleProxy: ... class StartableContext(ABC, metaclass=ABCMeta): @abstractmethod - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... def __await__(self): ... async def __aenter__(self): ... @abstractmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi index fd7d37add7e0..396f4a09dcb6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/engine.pyi @@ -4,7 +4,7 @@ from typing import Any from .base import ProxyComparable, StartableContext def create_async_engine(*arg, **kw) -> AsyncEngine: ... -def async_engine_from_config(configuration, prefix: str = ..., **kwargs) -> AsyncEngine: ... +def async_engine_from_config(configuration, prefix: str = "sqlalchemy.", **kwargs) -> AsyncEngine: ... class AsyncConnectable: dispatch: Incomplete @@ -13,8 +13,8 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): engine: Any sync_engine: Any sync_connection: Any - def __init__(self, async_engine, sync_connection: Incomplete | None = ...) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + def __init__(self, async_engine, sync_connection: Incomplete | None = None) -> None: ... + async def start(self, is_ctxmanager: bool = False): ... @property def connection(self) -> None: ... async def get_raw_connection(self): ... @@ -22,7 +22,7 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): def info(self): ... def begin(self): ... def begin_nested(self): ... - async def invalidate(self, exception: Incomplete | None = ...): ... + async def invalidate(self, exception: Incomplete | None = None): ... async def get_isolation_level(self): ... async def set_isolation_level(self): ... def in_transaction(self): ... @@ -33,12 +33,12 @@ class AsyncConnection(ProxyComparable, StartableContext, AsyncConnectable): async def commit(self) -> None: ... async def rollback(self) -> None: ... async def close(self) -> None: ... - async def exec_driver_sql(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def stream(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def execute(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def scalar(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... - async def stream_scalars(self, statement, parameters: Incomplete | None = ..., execution_options=...): ... + async def exec_driver_sql(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def stream(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def execute(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def scalar(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def scalars(self, statement, parameters: Incomplete | None = None, execution_options=...): ... + async def stream_scalars(self, statement, parameters: Incomplete | None = None, execution_options=...): ... async def run_sync(self, fn, *arg, **kw): ... def __await__(self): ... async def __aexit__(self, type_, value, traceback) -> None: ... @@ -56,7 +56,7 @@ class AsyncEngine(ProxyComparable, AsyncConnectable): conn: Any def __init__(self, conn) -> None: ... transaction: Any - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__(self, type_, value, traceback) -> None: ... sync_engine: Any def __init__(self, sync_engine) -> None: ... @@ -84,7 +84,7 @@ class AsyncTransaction(ProxyComparable, StartableContext): connection: Any sync_transaction: Any nested: Any - def __init__(self, connection, nested: bool = ...) -> None: ... + def __init__(self, connection, nested: bool = False) -> None: ... @property def is_valid(self): ... @property @@ -92,5 +92,5 @@ class AsyncTransaction(ProxyComparable, StartableContext): async def close(self) -> None: ... async def rollback(self) -> None: ... async def commit(self) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__(self, type_, value, traceback) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi index 95894e42707d..6afa6ed6993a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/result.pyi @@ -8,11 +8,11 @@ class AsyncCommon(FilterResult): class AsyncResult(AsyncCommon): def __init__(self, real_result) -> None: ... def keys(self): ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchone(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -23,15 +23,15 @@ class AsyncResult(AsyncCommon): async def one(self): ... async def scalar(self): ... async def freeze(self): ... - def scalars(self, index: int = ...): ... + def scalars(self, index: int = 0): ... def mappings(self): ... class AsyncScalarResult(AsyncCommon): def __init__(self, real_result, index) -> None: ... - def unique(self, strategy: Incomplete | None = ...): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + def unique(self, strategy: Incomplete | None = None): ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchall(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... @@ -42,12 +42,12 @@ class AsyncScalarResult(AsyncCommon): class AsyncMappingResult(AsyncCommon): def __init__(self, result) -> None: ... def keys(self): ... - def unique(self, strategy: Incomplete | None = ...): ... + def unique(self, strategy: Incomplete | None = None): ... def columns(self, *col_expressions): ... - async def partitions(self, size: Incomplete | None = ...) -> None: ... + async def partitions(self, size: Incomplete | None = None) -> None: ... async def fetchall(self): ... async def fetchone(self): ... - async def fetchmany(self, size: Incomplete | None = ...): ... + async def fetchmany(self, size: Incomplete | None = None): ... async def all(self): ... def __aiter__(self): ... async def __anext__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi index 948731bfd62c..3c203866cd46 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/scoping.pyi @@ -22,7 +22,7 @@ class async_scoped_session(ScopedSessionMixin): autoflush: Any def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -31,38 +31,40 @@ class async_scoped_session(ScopedSessionMixin): async def connection(self, **kw): ... async def delete(self, instance): ... async def execute( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - async def flush(self, objects: Incomplete | None = ...) -> None: ... + async def flush(self, objects: Incomplete | None = None) -> None: ... async def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, ): ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... - def is_modified(self, instance, include_collections: bool = ...): ... - async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... - async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... + def get_bind( + self, mapper: Incomplete | None = None, clause: Incomplete | None = None, bind: Incomplete | None = None, **kw + ): ... + def is_modified(self, instance, include_collections: bool = True): ... + async def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... + async def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None): ... async def rollback(self): ... async def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream_scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... @property def dirty(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index d2465948b322..505132ea4be9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -11,40 +11,42 @@ class AsyncSession(ReversibleProxy): sync_session_class: Any sync_session: Any def __init__( - self, bind: Incomplete | None = ..., binds: Incomplete | None = ..., sync_session_class: Incomplete | None = ..., **kw + self, bind: Incomplete | None = None, binds: Incomplete | None = None, sync_session_class: Incomplete | None = None, **kw ) -> None: ... - async def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...): ... + async def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None): ... async def run_sync(self, fn, *arg, **kw): ... async def execute( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, ): ... async def stream( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def stream_scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... async def delete(self, instance): ... - async def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... - async def flush(self, objects: Incomplete | None = ...) -> None: ... + async def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... + async def flush(self, objects: Incomplete | None = None) -> None: ... def get_transaction(self): ... def get_nested_transaction(self): ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ..., bind: Incomplete | None = ..., **kw): ... + def get_bind( + self, mapper: Incomplete | None = None, clause: Incomplete | None = None, bind: Incomplete | None = None, **kw + ): ... async def connection(self, **kw): ... def begin(self, **kw): ... def begin_nested(self, **kw): ... @@ -65,13 +67,13 @@ class AsyncSession(ReversibleProxy): def object_session(cls, instance): ... def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... def in_transaction(self): ... def in_nested_transaction(self): ... @property @@ -98,12 +100,12 @@ class AsyncSessionTransaction(ReversibleProxy, StartableContext): session: Any nested: Any sync_transaction: Any - def __init__(self, session, nested: bool = ...) -> None: ... + def __init__(self, session, nested: bool = False) -> None: ... @property def is_active(self): ... async def rollback(self) -> None: ... async def commit(self) -> None: ... - async def start(self, is_ctxmanager: bool = ...): ... + async def start(self, is_ctxmanager: bool = False): ... async def __aexit__(self, type_, value, traceback) -> None: ... def async_object_session(instance): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi index f17b2d3b60ae..47a5793cb398 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/automap.pyi @@ -12,16 +12,16 @@ class AutomapBase: @classmethod def prepare( cls, - autoload_with: Incomplete | None = ..., - engine: Incomplete | None = ..., - reflect: bool = ..., - schema: Incomplete | None = ..., - classname_for_table: Incomplete | None = ..., - collection_class: Incomplete | None = ..., - name_for_scalar_relationship: Incomplete | None = ..., - name_for_collection_relationship: Incomplete | None = ..., - generate_relationship: Incomplete | None = ..., + autoload_with: Incomplete | None = None, + engine: Incomplete | None = None, + reflect: bool = False, + schema: Incomplete | None = None, + classname_for_table: Incomplete | None = None, + collection_class: Incomplete | None = None, + name_for_scalar_relationship: Incomplete | None = None, + name_for_collection_relationship: Incomplete | None = None, + generate_relationship: Incomplete | None = None, reflection_options=..., ) -> None: ... -def automap_base(declarative_base: Incomplete | None = ..., **kw): ... +def automap_base(declarative_base: Incomplete | None = None, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi index dc5139effa64..95ac4b0d6dd2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/baked.pyi @@ -13,16 +13,16 @@ class Bakery: class BakedQuery: steps: Any - def __init__(self, bakery, initial_fn, args=...) -> None: ... + def __init__(self, bakery, initial_fn, args=()) -> None: ... @classmethod - def bakery(cls, size: int = ..., _size_alert: Incomplete | None = ...): ... + def bakery(cls, size: int = 200, _size_alert: Incomplete | None = None): ... def __iadd__(self, other): ... def __add__(self, other): ... def add_criteria(self, fn, *args): ... def with_criteria(self, fn, *args): ... def for_session(self, session): ... def __call__(self, session): ... - def spoil(self, full: bool = ...): ... + def spoil(self, full: bool = False): ... def to_query(self, query_or_session): ... class Result: diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi index 08a80eb03bce..b8355d51ced1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/horizontal_shard.pyi @@ -22,13 +22,13 @@ class ShardedSession(Session): self, shard_chooser, id_chooser, - execute_chooser: Incomplete | None = ..., - shards: Incomplete | None = ..., + execute_chooser: Incomplete | None = None, + shards: Incomplete | None = None, query_cls=..., **kwargs, ): ... def connection_callable( - self, mapper: Incomplete | None = ..., instance: Incomplete | None = ..., shard_id: Incomplete | None = ..., **kwargs + self, mapper: Incomplete | None = None, instance: Incomplete | None = None, shard_id: Incomplete | None = None, **kwargs ): ... - def get_bind(self, mapper: Incomplete | None = ..., shard_id: Incomplete | None = ..., instance: Incomplete | None = ..., clause: Incomplete | None = ..., **kw): ... # type: ignore[override] + def get_bind(self, mapper: Incomplete | None = None, shard_id: Incomplete | None = None, instance: Incomplete | None = None, clause: Incomplete | None = None, **kw): ... # type: ignore[override] def bind_shard(self, shard_id, bind) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi index eda35d683c6e..d9d20108f4ab 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/hybrid.pyi @@ -10,7 +10,7 @@ class hybrid_method(interfaces.InspectionAttrInfo): is_attribute: bool extension_type: Any func: Any - def __init__(self, func, expr: Incomplete | None = ...) -> None: ... + def __init__(self, func, expr: Incomplete | None = None) -> None: ... def __get__(self, instance, owner): ... expr: Any def expression(self, expr): ... @@ -27,11 +27,11 @@ class hybrid_property(interfaces.InspectionAttrInfo): def __init__( self, fget, - fset: Incomplete | None = ..., - fdel: Incomplete | None = ..., - expr: Incomplete | None = ..., - custom_comparator: Incomplete | None = ..., - update_expr: Incomplete | None = ..., + fset: Incomplete | None = None, + fdel: Incomplete | None = None, + expr: Incomplete | None = None, + custom_comparator: Incomplete | None = None, + update_expr: Incomplete | None = None, ) -> None: ... def __get__(self, instance, owner): ... def __set__(self, instance, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi index 1178ebd4fff4..8d34ff0db8b8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/indexable.pyi @@ -10,7 +10,7 @@ class index_property(hybrid_property): datatype: Any onebased: Any def __init__( - self, attr_name, index, default=..., datatype: Incomplete | None = ..., mutable: bool = ..., onebased: bool = ... + self, attr_name, index, default=..., datatype: Incomplete | None = None, mutable: bool = True, onebased: bool = True ): ... def fget(self, instance): ... def fset(self, instance, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi index d054f2def40d..d88af6e40c01 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/instrumentation.pyi @@ -39,7 +39,7 @@ class _ClassInstrumentationAdapter(ClassManager): def manage(self) -> None: ... def unregister(self) -> None: ... def manager_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def instrument_attribute(self, key, inst, propagated: bool = False) -> None: ... def post_configure_attribute(self, key) -> None: ... def install_descriptor(self, key, inst) -> None: ... def uninstall_descriptor(self, key) -> None: ... @@ -47,8 +47,8 @@ class _ClassInstrumentationAdapter(ClassManager): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def new_instance(self, state: Incomplete | None = ...): ... - def setup_instance(self, instance, state: Incomplete | None = ...): ... + def new_instance(self, state: Incomplete | None = None): ... + def setup_instance(self, instance, state: Incomplete | None = None): ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... def state_getter(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi index 7c86012baa48..bebca695be58 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/orderinglist.pyi @@ -1,20 +1,20 @@ from _typeshed import Incomplete from typing import Any -def ordering_list(attr, count_from: Incomplete | None = ..., **kw): ... +def ordering_list(attr, count_from: Incomplete | None = None, **kw): ... class OrderingList(list[Any]): ordering_attr: Any ordering_func: Any reorder_on_append: Any def __init__( - self, ordering_attr: Incomplete | None = ..., ordering_func: Incomplete | None = ..., reorder_on_append: bool = ... + self, ordering_attr: Incomplete | None = None, ordering_func: Incomplete | None = None, reorder_on_append: bool = False ) -> None: ... def reorder(self) -> None: ... def append(self, entity) -> None: ... def insert(self, index, entity) -> None: ... def remove(self, entity) -> None: ... - def pop(self, index: int = ...): ... # type: ignore[override] + def pop(self, index: int = -1): ... # type: ignore[override] def __setitem__(self, index, entity) -> None: ... def __delitem__(self, index) -> None: ... def __setslice__(self, start, end, values) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi index 4177beb2f2e5..3584cf3ebd4c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/serializer.pyi @@ -2,7 +2,9 @@ from _typeshed import Incomplete def Serializer(*args, **kw): ... def Deserializer( - file, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ... + file, metadata: Incomplete | None = None, scoped_session: Incomplete | None = None, engine: Incomplete | None = None +): ... +def dumps(obj, protocol=5): ... +def loads( + data, metadata: Incomplete | None = None, scoped_session: Incomplete | None = None, engine: Incomplete | None = None ): ... -def dumps(obj, protocol=...): ... -def loads(data, metadata: Incomplete | None = ..., scoped_session: Incomplete | None = ..., engine: Incomplete | None = ...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi b/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi index f1b3362d14dc..049185fd8048 100644 --- a/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/future/engine.pyi @@ -22,8 +22,8 @@ class Connection(_LegacyConnection): def commit(self) -> None: ... def rollback(self) -> None: ... def close(self) -> None: ... - def execute(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] - def scalar(self, statement, parameters: Incomplete | None = ..., execution_options: Incomplete | None = ...): ... # type: ignore[override] + def execute(self, statement, parameters: Incomplete | None = None, execution_options: Incomplete | None = None): ... # type: ignore[override] + def scalar(self, statement, parameters: Incomplete | None = None, execution_options: Incomplete | None = None): ... # type: ignore[override] class Engine(_LegacyEngine): transaction: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/inspection.pyi b/stubs/SQLAlchemy/sqlalchemy/inspection.pyi index d758818c57fc..3e92030a6f5d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/inspection.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/inspection.pyi @@ -1 +1 @@ -def inspect(subject, raiseerr: bool = ...): ... +def inspect(subject, raiseerr: bool = True): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index 8f99ae0f2dcd..1044d8394947 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -40,7 +40,7 @@ class InstanceLogger: def isEnabledFor(self, level): ... def getEffectiveLevel(self): ... -def instance_logger(instance: Identified, echoflag: _EchoFlag = ...) -> None: ... +def instance_logger(instance: Identified, echoflag: _EchoFlag = None) -> None: ... class echo_property: __doc__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi index 6e32aa68bacf..a0ba4126d5fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/__init__.pyi @@ -85,7 +85,7 @@ from .util import ( with_polymorphic as with_polymorphic, ) -def create_session(bind: Incomplete | None = ..., **kwargs): ... +def create_session(bind: Incomplete | None = None, **kwargs): ... with_loader_criteria: Any relationship: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi index 1c1c5d4ec9b0..c5097d7c825a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -59,10 +59,10 @@ class QueryableAttribute( class_, key, parententity, - impl: Incomplete | None = ..., - comparator: Incomplete | None = ..., - of_type: Incomplete | None = ..., - extra_criteria=..., + impl: Incomplete | None = None, + comparator: Incomplete | None = None, + of_type: Incomplete | None = None, + extra_criteria=(), ) -> None: ... def __reduce__(self): ... def get_history(self, instance, passive=...): ... @@ -79,7 +79,7 @@ class QueryableAttribute( def label(self, name): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... - def hasparent(self, state, optimistic: bool = ...): ... + def hasparent(self, state, optimistic: bool = False): ... def __getattr__(self, key: str): ... @memoized_property def property(self): ... @@ -139,17 +139,17 @@ class AttributeImpl: key, callable_, dispatch, - trackparent: bool = ..., - compare_function: Incomplete | None = ..., - active_history: bool = ..., - parent_token: Incomplete | None = ..., - load_on_unexpire: bool = ..., - send_modified_events: bool = ..., - accepts_scalar_loader: Incomplete | None = ..., + trackparent: bool = False, + compare_function: Incomplete | None = None, + active_history: bool = False, + parent_token: Incomplete | None = None, + load_on_unexpire: bool = True, + send_modified_events: bool = True, + accepts_scalar_loader: Incomplete | None = None, **kwargs, ) -> None: ... active_history: Any - def hasparent(self, state, optimistic: bool = ...): ... + def hasparent(self, state, optimistic: bool = False): ... def sethasparent(self, state, parent_state, value) -> None: ... def get_history(self, state, dict_, passive=...) -> None: ... def get_all_pending(self, state, dict_, passive=...) -> None: ... @@ -157,7 +157,9 @@ class AttributeImpl: def append(self, state, dict_, value, initiator, passive=...) -> None: ... def remove(self, state, dict_, value, initiator, passive=...) -> None: ... def pop(self, state, dict_, value, initiator, passive=...) -> None: ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def get_committed_value(self, state, dict_, passive=...): ... def set_committed_value(self, state, dict_, value): ... @@ -170,7 +172,9 @@ class ScalarAttributeImpl(AttributeImpl): def __init__(self, *arg, **kw) -> None: ... def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... @property @@ -184,7 +188,9 @@ class ScalarObjectAttributeImpl(ScalarAttributeImpl): def delete(self, state, dict_) -> None: ... def get_history(self, state, dict_, passive=...): ... def get_all_pending(self, state, dict_, passive=...): ... - def set(self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = ..., pop: bool = ...) -> None: ... + def set( + self, state, dict_, value, initiator, passive=..., check_old: Incomplete | None = None, pop: bool = False + ) -> None: ... def fire_remove_event(self, state, dict_, value, initiator) -> None: ... def fire_replace_event(self, state, dict_, value, previous, initiator): ... @@ -202,10 +208,10 @@ class CollectionAttributeImpl(AttributeImpl): key, callable_, dispatch, - typecallable: Incomplete | None = ..., - trackparent: bool = ..., - copy_function: Incomplete | None = ..., - compare_function: Incomplete | None = ..., + typecallable: Incomplete | None = None, + trackparent: bool = False, + copy_function: Incomplete | None = None, + compare_function: Incomplete | None = None, **kwargs, ) -> None: ... def get_history(self, state, dict_, passive=...): ... @@ -223,14 +229,14 @@ class CollectionAttributeImpl(AttributeImpl): state, dict_, value, - initiator: Incomplete | None = ..., + initiator: Incomplete | None = None, passive=..., - check_old: Incomplete | None = ..., - pop: bool = ..., - _adapt: bool = ..., + check_old: Incomplete | None = None, + pop: bool = False, + _adapt: bool = True, ) -> None: ... def set_committed_value(self, state, dict_, value): ... - def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... + def get_collection(self, state, dict_, user_data: Incomplete | None = None, passive=...): ... def backref_listeners(attribute, key, uselist): ... @@ -254,26 +260,26 @@ HISTORY_BLANK: Any def get_history(obj, key, passive=...): ... def get_state_history(state, key, passive=...): ... -def has_parent(cls, obj, key, optimistic: bool = ...): ... +def has_parent(cls, obj, key, optimistic: bool = False): ... def register_attribute(class_, key, **kw): ... def register_attribute_impl( class_, key, - uselist: bool = ..., - callable_: Incomplete | None = ..., - useobject: bool = ..., - impl_class: Incomplete | None = ..., - backref: Incomplete | None = ..., + uselist: bool = False, + callable_: Incomplete | None = None, + useobject: bool = False, + impl_class: Incomplete | None = None, + backref: Incomplete | None = None, **kw, ): ... def register_descriptor( - class_, key, comparator: Incomplete | None = ..., parententity: Incomplete | None = ..., doc: Incomplete | None = ... + class_, key, comparator: Incomplete | None = None, parententity: Incomplete | None = None, doc: Incomplete | None = None ): ... def unregister_attribute(class_, key) -> None: ... def init_collection(obj, key): ... def init_state_collection(state, dict_, key): ... def set_committed_value(instance, key, value) -> None: ... -def set_attribute(instance, key, value, initiator: Incomplete | None = ...) -> None: ... +def set_attribute(instance, key, value, initiator: Incomplete | None = None) -> None: ... def get_attribute(instance, key): ... def del_attribute(instance, key) -> None: ... def flag_modified(instance, key) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi index cd54836b2833..5ac8dc2d8d6f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/base.pyi @@ -55,7 +55,7 @@ def _is_mapped_class(entity): ... _state_mapper: Any -def class_mapper(class_, configure: bool = ...): ... +def class_mapper(class_, configure: bool = True): ... class InspectionAttr: is_selectable: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi index b21f02a3a35f..129b82fbbc6f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/clsregistry.pyi @@ -7,7 +7,7 @@ def remove_class(classname, cls, decl_class_registry) -> None: ... class _MultipleClassMarker: on_remove: Any contents: Any - def __init__(self, classes, on_remove: Incomplete | None = ...) -> None: ... + def __init__(self, classes, on_remove: Incomplete | None = None) -> None: ... def remove_item(self, cls) -> None: ... def __iter__(self): ... def attempt_get(self, path, key): ... @@ -48,5 +48,5 @@ class _class_resolver: arg: Any fallback: Any favor_tables: Any - def __init__(self, cls, prop, fallback, arg, favor_tables: bool = ...) -> None: ... + def __init__(self, cls, prop, fallback, arg, favor_tables: bool = False) -> None: ... def __call__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 8efe02c952a0..91d88b539fb2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -73,22 +73,22 @@ class CollectionAdapter: @property def data(self): ... def bulk_appender(self): ... - def append_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def append_with_event(self, item, initiator: Incomplete | None = None) -> None: ... def append_without_event(self, item) -> None: ... def append_multiple_without_event(self, items) -> None: ... def bulk_remover(self): ... - def remove_with_event(self, item, initiator: Incomplete | None = ...) -> None: ... + def remove_with_event(self, item, initiator: Incomplete | None = None) -> None: ... def remove_without_event(self, item) -> None: ... - def clear_with_event(self, initiator: Incomplete | None = ...) -> None: ... + def clear_with_event(self, initiator: Incomplete | None = None) -> None: ... def clear_without_event(self) -> None: ... def __iter__(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... - def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = ...): ... - def fire_append_event(self, item, initiator: Incomplete | None = ...): ... - def fire_remove_event(self, item, initiator: Incomplete | None = ...) -> None: ... - def fire_pre_remove_event(self, initiator: Incomplete | None = ...) -> None: ... + def fire_append_wo_mutation_event(self, item, initiator: Incomplete | None = None): ... + def fire_append_event(self, item, initiator: Incomplete | None = None): ... + def fire_remove_event(self, item, initiator: Incomplete | None = None) -> None: ... + def fire_pre_remove_event(self, initiator: Incomplete | None = None) -> None: ... class InstrumentedList(list[_T]): def append(self, item, _sa_initiator: Event | Literal[False] | None = None) -> None: ... @@ -112,8 +112,8 @@ class InstrumentedDict(dict[_KT, _VT]): ... class MappedCollection(dict[_KT, _VT]): keyfunc: Any def __init__(self, keyfunc) -> None: ... - def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... - def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = ...) -> None: ... + def set(self, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... + def remove(self, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... def __delitem__(self, key: _KT, _sa_initiatorEvent: Event | Literal[False] | None = None) -> None: ... def __setitem__(self, key: _KT, value: _VT, _sa_initiator: Event | Literal[False] | None = None) -> None: ... @overload diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index db3e6c479589..1e3a3e618a5a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -37,8 +37,8 @@ class QueryContext: params, session, load_options, - execution_options: Incomplete | None = ..., - bind_arguments: Incomplete | None = ..., + execution_options: Incomplete | None = None, + bind_arguments: Incomplete | None = None, ) -> None: ... class ORMCompileState(CompileState): @@ -144,8 +144,8 @@ class _BundleEntity(_QueryEntity): expr, entities_collection, is_current_entities: bool, - setup_entities: bool = ..., - parent_bundle: Incomplete | None = ..., + setup_entities: bool = True, + parent_bundle: Incomplete | None = None, ) -> None: ... @property def mapper(self): ... @@ -180,7 +180,7 @@ class _RawColumnEntity(_ColumnEntity): entities_collection, raw_column_index, is_current_entities: bool, - parent_bundle: Incomplete | None = ..., + parent_bundle: Incomplete | None = None, ) -> None: ... def corresponds_to(self, entity): ... def setup_compile_state(self, compile_state) -> None: ... @@ -202,7 +202,7 @@ class _ORMColumnEntity(_ColumnEntity): parententity, raw_column_index, is_current_entities: bool, - parent_bundle: Incomplete | None = ..., + parent_bundle: Incomplete | None = None, ) -> None: ... def corresponds_to(self, entity): ... def setup_compile_state(self, compile_state) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 671533116fc8..16bb37733e64 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -32,10 +32,10 @@ class DeclarativeMeta(type): def __setattr__(cls, key: str, value: Any) -> None: ... def __delattr__(cls, key: str) -> None: ... -def synonym_for(name, map_column: bool = ...): ... +def synonym_for(name, map_column: bool = False): ... class declared_attr(interfaces._MappedAttribute, property): - def __init__(self, fget, cascading: bool = ...) -> None: ... + def __init__(self, fget, cascading: bool = False) -> None: ... def __get__(self, self_, cls): ... @hybridproperty def cascading(self): ... @@ -48,23 +48,23 @@ class _stateful_declared_attr(declared_attr): def declarative_mixin(cls: _ClsT) -> _ClsT: ... @overload def declarative_base( - bind: Connectable | None = ..., - metadata: MetaData | None = ..., - mapper: Incomplete | None = ..., + bind: Connectable | None = None, + metadata: MetaData | None = None, + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", constructor: Callable[..., None] = ..., - class_registry: dict[str, type[Any]] | None = ..., + class_registry: dict[str, type[Any]] | None = None, ) -> type[_DeclarativeBase]: ... @overload def declarative_base( - bind: Connectable | None = ..., - metadata: MetaData | None = ..., - mapper: Incomplete | None = ..., + bind: Connectable | None = None, + metadata: MetaData | None = None, + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", constructor: Callable[..., None] = ..., - class_registry: dict[str, type[Any]] | None = ..., + class_registry: dict[str, type[Any]] | None = None, *, metaclass: _DeclarativeBaseMeta[_DeclT], ) -> _DeclT: ... @@ -85,25 +85,25 @@ class registry: constructor: Callable[..., None] def __init__( self, - metadata: MetaData | None = ..., - class_registry: dict[str, type[Any]] | None = ..., + metadata: MetaData | None = None, + class_registry: dict[str, type[Any]] | None = None, constructor: Callable[..., None] = ..., - _bind: Connectable | None = ..., + _bind: Connectable | None = None, ) -> None: ... @property def mappers(self) -> frozenset[Any]: ... - def configure(self, cascade: bool = ...) -> None: ... - def dispose(self, cascade: bool = ...) -> None: ... + def configure(self, cascade: bool = False) -> None: ... + def dispose(self, cascade: bool = False) -> None: ... @overload def generate_base( - self, mapper: Incomplete | None = ..., cls: type[Any] | tuple[type[Any], ...] = ..., name: str = ... + self, mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., name: str = "Base" ) -> type[_DeclarativeBase]: ... @overload def generate_base( self, - mapper: Incomplete | None = ..., + mapper: Incomplete | None = None, cls: type[Any] | tuple[type[Any], ...] = ..., - name: str = ..., + name: str = "Base", *, metaclass: _DeclarativeBaseMeta[_DeclT], ) -> _DeclT: ... @@ -125,7 +125,7 @@ class registry: self, *, mapper: Incomplete | None = ..., metaclass: _DeclarativeBaseMeta[_DeclT] ) -> Callable[[_ClsT], _ClsT | _DeclT | Any]: ... def map_declaratively(self, cls): ... - def map_imperatively(self, class_, local_table: Incomplete | None = ..., **kw): ... + def map_imperatively(self, class_, local_table: Incomplete | None = None, **kw): ... @overload def as_declarative( diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi index 9d5dbf1c0723..7aab93cf9046 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_base.pyi @@ -43,5 +43,5 @@ class _DeferredMapperConfig(_ClassScanMapperConfig): @classmethod def config_for_cls(cls, class_): ... @classmethod - def classes_for_base(cls, base_cls, sort: bool = ...): ... + def classes_for_base(cls, base_cls, sort: bool = True): ... def map(self, mapper_kw=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi index 636a70516bc6..bf249bc257ac 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/descriptor_props.pyi @@ -61,11 +61,11 @@ class SynonymProperty(DescriptorProperty): def __init__( self, name, - map_column: Incomplete | None = ..., - descriptor: Incomplete | None = ..., - comparator_factory: Incomplete | None = ..., - doc: Incomplete | None = ..., - info: Incomplete | None = ..., + map_column: Incomplete | None = None, + descriptor: Incomplete | None = None, + comparator_factory: Incomplete | None = None, + doc: Incomplete | None = None, + info: Incomplete | None = None, ) -> None: ... @property def uses_objects(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi index 40193a48f6be..6008d1d9f04a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi @@ -21,22 +21,22 @@ class DynamicAttributeImpl(attributes.AttributeImpl): target_mapper: Any query_class: Any def __init__( - self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = ..., **kw + self, class_, key, typecallable, dispatch, target_mapper, order_by, query_class: Incomplete | None = None, **kw ) -> None: ... def get(self, state, dict_, passive=...): ... - def get_collection(self, state, dict_, user_data: Incomplete | None = ..., passive=...): ... - def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... - def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = ...) -> None: ... + def get_collection(self, state, dict_, user_data: Incomplete | None = None, passive=...): ... + def fire_append_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = None) -> None: ... + def fire_remove_event(self, state, dict_, value, initiator, collection_history: Incomplete | None = None) -> None: ... def set( self, state, dict_, value, - initiator: Incomplete | None = ..., + initiator: Incomplete | None = None, passive=..., - check_old: Incomplete | None = ..., - pop: bool = ..., - _adapt: bool = ..., + check_old: Incomplete | None = None, + pop: bool = False, + _adapt: bool = True, ) -> None: ... def delete(self, *args, **kwargs) -> None: ... def set_committed_value(self, state, dict_, value) -> None: ... @@ -74,7 +74,7 @@ class CollectionHistory: unchanged_items: Any added_items: Any deleted_items: Any - def __init__(self, attr, state, apply_to: Incomplete | None = ...) -> None: ... + def __init__(self, attr, state, apply_to: Incomplete | None = None) -> None: ... @property def added_plus_unchanged(self): ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi index 9091e9694c89..1e4cf1b01419 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/evaluator.pyi @@ -11,7 +11,7 @@ class _NoObject(operators.ColumnOperators[Any]): class EvaluatorCompiler: target_cls: Any - def __init__(self, target_cls: Incomplete | None = ...) -> None: ... + def __init__(self, target_cls: Incomplete | None = None) -> None: ... def process(self, *clauses): ... def visit_grouping(self, clause): ... def visit_null(self, clause): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi index 384ffdf114cb..b589abf2f489 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/exc.pyi @@ -18,15 +18,15 @@ class DetachedInstanceError(sa_exc.SQLAlchemyError): code: str class UnmappedInstanceError(UnmappedError): - def __init__(self, obj, msg: Incomplete | None = ...) -> None: ... + def __init__(self, obj, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class UnmappedClassError(UnmappedError): - def __init__(self, cls, msg: Incomplete | None = ...) -> None: ... + def __init__(self, cls, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class ObjectDeletedError(sa_exc.InvalidRequestError): - def __init__(self, state, msg: Incomplete | None = ...) -> None: ... + def __init__(self, state, msg: Incomplete | None = None) -> None: ... def __reduce__(self): ... class UnmappedColumnError(sa_exc.InvalidRequestError): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi index 062e91c0c095..59f767906eed 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/identity.pyi @@ -10,7 +10,7 @@ class IdentityMap: def has_key(self, key): ... def popitem(self) -> None: ... def pop(self, key, *args) -> None: ... - def setdefault(self, key, default: Incomplete | None = ...) -> None: ... + def setdefault(self, key, default: Incomplete | None = None) -> None: ... def __len__(self) -> int: ... def copy(self) -> None: ... def __setitem__(self, key, value) -> None: ... @@ -22,7 +22,7 @@ class WeakInstanceDict(IdentityMap): def contains_state(self, state): ... def replace(self, state): ... def add(self, state): ... - def get(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... def items(self): ... def values(self): ... def __iter__(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi index 6990518ff8b6..430e622ddfea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -39,10 +39,10 @@ class ClassManager(HasMemoized, dict[Any, Any]): def state_getter(self): ... @hybridmethod def dict_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...) -> None: ... + def instrument_attribute(self, key, inst, propagated: bool = False) -> None: ... def subclass_managers(self, recursive) -> None: ... def post_configure_attribute(self, key) -> None: ... - def uninstrument_attribute(self, key, propagated: bool = ...) -> None: ... + def uninstrument_attribute(self, key, propagated: bool = False) -> None: ... def unregister(self) -> None: ... def install_descriptor(self, key, inst) -> None: ... def uninstall_descriptor(self, key) -> None: ... @@ -50,15 +50,15 @@ class ClassManager(HasMemoized, dict[Any, Any]): def uninstall_member(self, key) -> None: ... def instrument_collection_class(self, key, collection_class): ... def initialize_collection(self, key, state, factory): ... - def is_instrumented(self, key, search: bool = ...): ... + def is_instrumented(self, key, search: bool = False): ... def get_impl(self, key): ... @property def attributes(self): ... - def new_instance(self, state: Incomplete | None = ...): ... - def setup_instance(self, instance, state: Incomplete | None = ...) -> None: ... + def new_instance(self, state: Incomplete | None = None): ... + def setup_instance(self, instance, state: Incomplete | None = None) -> None: ... def teardown_instance(self, instance) -> None: ... def has_state(self, instance): ... - def has_parent(self, state, key, optimistic: bool = ...): ... + def has_parent(self, state, key, optimistic: bool = False): ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @@ -79,12 +79,12 @@ manager_of_class = base.manager_of_class def register_class( class_, - finalize: bool = ..., - mapper: Incomplete | None = ..., - registry: Incomplete | None = ..., - declarative_scan: Incomplete | None = ..., - expired_attribute_loader: Incomplete | None = ..., - init_method: Incomplete | None = ..., + finalize: bool = True, + mapper: Incomplete | None = None, + registry: Incomplete | None = None, + declarative_scan: Incomplete | None = None, + expired_attribute_loader: Incomplete | None = None, + init_method: Incomplete | None = None, ): ... def unregister_class(class_) -> None: ... def is_instrumented(instance, key): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi index 23d0010789e6..8a3c2e2983b0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/interfaces.pyi @@ -48,7 +48,7 @@ class MapperProperty(HasCacheKey, _MappedAttribute, InspectionAttr, util.Memoize info: Incomplete def setup(self, context, query_entity, path, adapter, **kwargs) -> None: ... def create_row_processor(self, context, query_entity, path, mapper, result, adapter, populators) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...): ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = None): ... parent: Any def set_parent(self, parent, init) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -66,7 +66,7 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): __visit_name__: str prop: Any property: Any - def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = ...) -> None: ... + def __init__(self, prop, parentmapper, adapt_to_entity: Incomplete | None = None) -> None: ... def __clause_element__(self) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @property @@ -81,8 +81,8 @@ class PropComparator(operators.ColumnOperators[_T], Generic[_T]): def of_type_op(a, class_): ... def of_type(self, class_): ... def and_(self, *criteria): ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... class StrategizedProperty(MapperProperty): inherit_cache: bool @@ -113,7 +113,7 @@ class CriteriaOption(CompileStateOption): class UserDefinedOption(ORMOption): propagate_to_loaders: bool payload: Any - def __init__(self, payload: Incomplete | None = ...) -> None: ... + def __init__(self, payload: Incomplete | None = None) -> None: ... class MapperOption(ORMOption): propagate_to_loaders: bool diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi index 8341245981e4..328b33ef126b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/loading.pyi @@ -2,18 +2,18 @@ from _typeshed import Incomplete from typing import Any def instances(cursor, context): ... -def merge_frozen_result(session, statement, frozen_result, load: bool = ...): ... -def merge_result(query, iterator, load: bool = ...): ... +def merge_frozen_result(session, statement, frozen_result, load: bool = True): ... +def merge_result(query, iterator, load: bool = True): ... def get_from_identity(session, mapper, key, passive): ... def load_on_ident( session, statement, key, - load_options: Incomplete | None = ..., - refresh_state: Incomplete | None = ..., - with_for_update: Incomplete | None = ..., - only_load_props: Incomplete | None = ..., - no_autoflush: bool = ..., + load_options: Incomplete | None = None, + refresh_state: Incomplete | None = None, + with_for_update: Incomplete | None = None, + only_load_props: Incomplete | None = None, + no_autoflush: bool = False, bind_arguments=..., execution_options=..., ): ... @@ -21,12 +21,12 @@ def load_on_pk_identity( session, statement, primary_key_identity, - load_options: Incomplete | None = ..., - refresh_state: Incomplete | None = ..., - with_for_update: Incomplete | None = ..., - only_load_props: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - no_autoflush: bool = ..., + load_options: Incomplete | None = None, + refresh_state: Incomplete | None = None, + with_for_update: Incomplete | None = None, + only_load_props: Incomplete | None = None, + identity_token: Incomplete | None = None, + no_autoflush: bool = False, bind_arguments=..., execution_options=..., ): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi index aac71f2c4c1d..7cc169c1c5a0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/mapper.pyi @@ -47,33 +47,33 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def __init__( self, class_, - local_table: Incomplete | None = ..., - properties: Incomplete | None = ..., - primary_key: Incomplete | None = ..., - non_primary: bool = ..., - inherits: Incomplete | None = ..., - inherit_condition: Incomplete | None = ..., - inherit_foreign_keys: Incomplete | None = ..., - always_refresh: bool = ..., - version_id_col: Incomplete | None = ..., - version_id_generator: Incomplete | None = ..., - polymorphic_on: Incomplete | None = ..., - _polymorphic_map: Incomplete | None = ..., - polymorphic_identity: Incomplete | None = ..., - concrete: bool = ..., - with_polymorphic: Incomplete | None = ..., - polymorphic_load: Incomplete | None = ..., - allow_partial_pks: bool = ..., - batch: bool = ..., - column_prefix: Incomplete | None = ..., - include_properties: Incomplete | None = ..., - exclude_properties: Incomplete | None = ..., - passive_updates: bool = ..., - passive_deletes: bool = ..., - confirm_deleted_rows: bool = ..., - eager_defaults: bool = ..., - legacy_is_orphan: bool = ..., - _compiled_cache_size: int = ..., + local_table: Incomplete | None = None, + properties: Incomplete | None = None, + primary_key: Incomplete | None = None, + non_primary: bool = False, + inherits: Incomplete | None = None, + inherit_condition: Incomplete | None = None, + inherit_foreign_keys: Incomplete | None = None, + always_refresh: bool = False, + version_id_col: Incomplete | None = None, + version_id_generator: Incomplete | None = None, + polymorphic_on: Incomplete | None = None, + _polymorphic_map: Incomplete | None = None, + polymorphic_identity: Incomplete | None = None, + concrete: bool = False, + with_polymorphic: Incomplete | None = None, + polymorphic_load: Incomplete | None = None, + allow_partial_pks: bool = True, + batch: bool = True, + column_prefix: Incomplete | None = None, + include_properties: Incomplete | None = None, + exclude_properties: Incomplete | None = None, + passive_updates: bool = True, + passive_deletes: bool = False, + confirm_deleted_rows: bool = True, + eager_defaults: bool = False, + legacy_is_orphan: bool = False, + _compiled_cache_size: int = 100, ): ... is_mapper: bool represents_outer_join: bool @@ -93,7 +93,7 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def add_properties(self, dict_of_properties) -> None: ... def add_property(self, key, prop) -> None: ... def has_property(self, key): ... - def get_property(self, key, _configure_mappers: bool = ...): ... + def get_property(self, key, _configure_mappers: bool = True): ... def get_property_by_column(self, column): ... @property def iterate_properties(self): ... @@ -127,11 +127,11 @@ class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHas def primary_mapper(self): ... @property def primary_base_mapper(self): ... - def identity_key_from_row(self, row, identity_token: Incomplete | None = ..., adapter: Incomplete | None = ...): ... - def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = ...): ... + def identity_key_from_row(self, row, identity_token: Incomplete | None = None, adapter: Incomplete | None = None): ... + def identity_key_from_primary_key(self, primary_key, identity_token: Incomplete | None = None): ... def identity_key_from_instance(self, instance): ... def primary_key_from_instance(self, instance): ... - def cascade_iterator(self, type_, state, halt_on: Incomplete | None = ...) -> None: ... + def cascade_iterator(self, type_, state, halt_on: Incomplete | None = None) -> None: ... class _OptGetColumnsNotAvailable(Exception): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi index 8d53184c6939..370731d649ac 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -15,7 +15,7 @@ class PathRegistry(HasCacheKey): def __ne__(self, other): ... def set(self, attributes, key, value) -> None: ... def setdefault(self, attributes, key, value) -> None: ... - def get(self, attributes, key, value: Incomplete | None = ...): ... + def get(self, attributes, key, value: Incomplete | None = None): ... def __len__(self) -> int: ... def __hash__(self) -> int: ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi index 31ed7e4a0a50..bf80b919d6b5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/persistence.pyi @@ -3,7 +3,7 @@ from typing import Any from ..sql.base import CompileState, Options from ..sql.dml import DeleteDMLState, InsertDMLState, UpdateDMLState -def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ... +def save_obj(base_mapper, states, uowtransaction, single: bool = False) -> None: ... def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ... def delete_obj(base_mapper, states, uowtransaction) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index 2931c39eb7ca..9c228941c633 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -20,11 +20,11 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi load_options: Any session: Any dispatch: Incomplete - def __init__(self, entities, session: Incomplete | None = ...) -> None: ... + def __init__(self, entities, session: Incomplete | None = None) -> None: ... @property def statement(self): ... - def subquery(self, name: str | None = ..., with_labels: bool = ..., reduce_columns: bool = ...): ... - def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def subquery(self, name: str | None = None, with_labels: bool = False, reduce_columns: bool = False): ... + def cte(self, name: Incomplete | None = None, recursive: bool = False, nesting: bool = False): ... def label(self, name): ... def as_scalar(self): ... def scalar_subquery(self): ... @@ -44,7 +44,7 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi @property def whereclause(self): ... def with_polymorphic( - self: Self, cls_or_mappers, selectable: Incomplete | None = ..., polymorphic_on: Incomplete | None = ... + self: Self, cls_or_mappers, selectable: Incomplete | None = None, polymorphic_on: Incomplete | None = None ) -> Self: ... def yield_per(self: Self, count) -> Self: ... def get(self, ident): ... @@ -53,8 +53,8 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def correlate(self: Self, *fromclauses) -> Self: ... def autoflush(self: Self, setting) -> Self: ... def populate_existing(self: Self) -> Self: ... - def with_parent(self, instance, property: Incomplete | None = ..., from_entity: Incomplete | None = ...): ... - def add_entity(self: Self, entity, alias: Incomplete | None = ...) -> Self: ... + def with_parent(self, instance, property: Incomplete | None = None, from_entity: Incomplete | None = None): ... + def add_entity(self: Self, entity, alias: Incomplete | None = None) -> Self: ... def with_session(self: Self, session) -> Self: ... def from_self(self, *entities): ... def values(self, *columns): ... @@ -68,11 +68,11 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def execution_options(self: Self, **kwargs) -> Self: ... def with_for_update( self: Self, - read: bool = ..., - nowait: bool = ..., - of: Incomplete | None = ..., - skip_locked: bool = ..., - key_share: bool = ..., + read: bool = False, + nowait: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> Self: ... def params(self: Self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... @@ -106,12 +106,14 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi def __iter__(self) -> Iterator[_T]: ... @property def column_descriptions(self): ... - def instances(self, result_proxy, context: Incomplete | None = ...): ... - def merge_result(self, iterator, load: bool = ...): ... + def instances(self, result_proxy, context: Incomplete | None = None): ... + def merge_result(self, iterator, load: bool = True): ... def exists(self): ... def count(self) -> int: ... - def delete(self, synchronize_session: _SynchronizeSessionArgument = ...) -> int: ... - def update(self, values, synchronize_session: _SynchronizeSessionArgument = ..., update_args: Incomplete | None = ...): ... + def delete(self, synchronize_session: _SynchronizeSessionArgument = "evaluate") -> int: ... + def update( + self, values, synchronize_session: _SynchronizeSessionArgument = "evaluate", update_args: Incomplete | None = None + ): ... class FromStatement(GroupedElement, SelectBase, Executable): __visit_name__: str diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi index 4c9e05d07664..b4608d3b342b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/relationships.pyi @@ -51,40 +51,40 @@ class RelationshipProperty(StrategizedProperty): def __init__( self, argument, - secondary: Incomplete | None = ..., - primaryjoin: Incomplete | None = ..., - secondaryjoin: Incomplete | None = ..., - foreign_keys: Incomplete | None = ..., - uselist: Incomplete | None = ..., - order_by: bool = ..., - backref: Incomplete | None = ..., - back_populates: Incomplete | None = ..., - overlaps: Incomplete | None = ..., - post_update: bool = ..., - cascade: bool = ..., - viewonly: bool = ..., - lazy: str = ..., - collection_class: Incomplete | None = ..., - passive_deletes=..., - passive_updates=..., - remote_side: Incomplete | None = ..., - enable_typechecks=..., - join_depth: Incomplete | None = ..., - comparator_factory: Incomplete | None = ..., - single_parent: bool = ..., - innerjoin: bool = ..., - distinct_target_key: Incomplete | None = ..., - doc: Incomplete | None = ..., - active_history=..., - cascade_backrefs=..., - load_on_pending: bool = ..., - bake_queries: bool = ..., - _local_remote_pairs: Incomplete | None = ..., - query_class: Incomplete | None = ..., - info: Incomplete | None = ..., - omit_join: Incomplete | None = ..., - sync_backref: Incomplete | None = ..., - _legacy_inactive_history_style: bool = ..., + secondary: Incomplete | None = None, + primaryjoin: Incomplete | None = None, + secondaryjoin: Incomplete | None = None, + foreign_keys: Incomplete | None = None, + uselist: Incomplete | None = None, + order_by: bool = False, + backref: Incomplete | None = None, + back_populates: Incomplete | None = None, + overlaps: Incomplete | None = None, + post_update: bool = False, + cascade: bool = False, + viewonly: bool = False, + lazy: str = "select", + collection_class: Incomplete | None = None, + passive_deletes=False, + passive_updates=True, + remote_side: Incomplete | None = None, + enable_typechecks=True, + join_depth: Incomplete | None = None, + comparator_factory: Incomplete | None = None, + single_parent: bool = False, + innerjoin: bool = False, + distinct_target_key: Incomplete | None = None, + doc: Incomplete | None = None, + active_history=False, + cascade_backrefs=True, + load_on_pending: bool = False, + bake_queries: bool = True, + _local_remote_pairs: Incomplete | None = None, + query_class: Incomplete | None = None, + info: Incomplete | None = None, + omit_join: Incomplete | None = None, + sync_backref: Incomplete | None = None, + _legacy_inactive_history_style: bool = False, ) -> None: ... def instrument_class(self, mapper) -> None: ... @@ -94,9 +94,9 @@ class RelationshipProperty(StrategizedProperty): self, prop, parentmapper, - adapt_to_entity: Incomplete | None = ..., - of_type: Incomplete | None = ..., - extra_criteria=..., + adapt_to_entity: Incomplete | None = None, + of_type: Incomplete | None = None, + extra_criteria=(), ) -> None: ... def adapt_to_entity(self, adapt_to_entity): ... @memoized_property @@ -109,8 +109,8 @@ class RelationshipProperty(StrategizedProperty): def in_(self, other) -> ColumnOperators[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] def __eq__(self, other): ... - def any(self, criterion: Incomplete | None = ..., **kwargs): ... - def has(self, criterion: Incomplete | None = ..., **kwargs): ... + def any(self, criterion: Incomplete | None = None, **kwargs): ... + def has(self, criterion: Incomplete | None = None, **kwargs): ... def contains(self, other, **kwargs) -> ColumnOperators[_T]: ... def __ne__(self, other) -> ColumnOperators[_T]: ... # type: ignore[override] @memoized_property @@ -119,7 +119,7 @@ class RelationshipProperty(StrategizedProperty): def merge( self, session, source_state, source_dict, dest_state, dest_dict, load, _recursive, _resolve_conflict_map ) -> None: ... - def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = ...) -> None: ... + def cascade_iterator(self, type_, state, dict_, visited_states, halt_on: Incomplete | None = None) -> None: ... @memoized_property def entity(self): ... @memoized_property @@ -151,17 +151,17 @@ class JoinCondition: child_persist_selectable, parent_local_selectable, child_local_selectable, - primaryjoin: Incomplete | None = ..., - secondary: Incomplete | None = ..., - secondaryjoin: Incomplete | None = ..., - parent_equivalents: Incomplete | None = ..., - child_equivalents: Incomplete | None = ..., - consider_as_foreign_keys: Incomplete | None = ..., - local_remote_pairs: Incomplete | None = ..., - remote_side: Incomplete | None = ..., - self_referential: bool = ..., - prop: Incomplete | None = ..., - support_sync: bool = ..., + primaryjoin: Incomplete | None = None, + secondary: Incomplete | None = None, + secondaryjoin: Incomplete | None = None, + parent_equivalents: Incomplete | None = None, + child_equivalents: Incomplete | None = None, + consider_as_foreign_keys: Incomplete | None = None, + local_remote_pairs: Incomplete | None = None, + remote_side: Incomplete | None = None, + self_referential: bool = False, + prop: Incomplete | None = None, + support_sync: bool = True, can_be_synced_fn=..., ): ... @property @@ -177,9 +177,9 @@ class JoinCondition: @memoized_property def foreign_key_columns(self): ... def join_targets( - self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = ..., extra_criteria=... + self, source_selectable, dest_selectable, aliased, single_crit: Incomplete | None = None, extra_criteria=() ): ... - def create_lazy_clause(self, reverse_direction: bool = ...): ... + def create_lazy_clause(self, reverse_direction: bool = False): ... class _ColInAnnotations: name: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi index 7a3555374768..4cb8f62cf56a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/scoping.pyi @@ -10,9 +10,9 @@ class ScopedSessionMixin: class scoped_session(ScopedSessionMixin): session_factory: Any registry: Any - def __init__(self, session_factory, scopefunc: Incomplete | None = ...) -> None: ... + def __init__(self, session_factory, scopefunc: Incomplete | None = None) -> None: ... def remove(self) -> None: ... - def query_property(self, query_cls: Incomplete | None = ...): ... + def query_property(self, query_cls: Incomplete | None = None): ... # dynamically proxied from class Session bind: Any identity_map: Any @@ -38,68 +38,68 @@ class scoped_session(ScopedSessionMixin): def object_session(cls, instance): ... def __contains__(self, instance): ... def __iter__(self): ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... - def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin(self, subtransactions: bool = False, nested: bool = False, _subtrans: bool = False): ... def begin_nested(self): ... def close(self) -> None: ... def commit(self) -> None: ... def connection( self, - bind_arguments: Incomplete | None = ..., - close_with_result: bool = ..., - execution_options: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + close_with_result: bool = False, + execution_options: Incomplete | None = None, **kw, ): ... def delete(self, instance) -> None: ... def execute( self, statement, - params: Incomplete | None = ..., + params: Incomplete | None = None, execution_options=..., - bind_arguments: Incomplete | None = ..., - _parent_execute_state: Incomplete | None = ..., - _add_event: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + _parent_execute_state: Incomplete | None = None, + _add_event: Incomplete | None = None, **kw, ): ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... def expunge(self, instance) -> None: ... def expunge_all(self) -> None: ... - def flush(self, objects: Incomplete | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = None) -> None: ... def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - execution_options: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, + execution_options: Incomplete | None = None, ): ... def get_bind( self, - mapper: Incomplete | None = ..., - clause: Incomplete | None = ..., - bind: Incomplete | None = ..., - _sa_skip_events: Incomplete | None = ..., - _sa_skip_for_implicit_returning: bool = ..., + mapper: Incomplete | None = None, + clause: Incomplete | None = None, + bind: Incomplete | None = None, + _sa_skip_events: Incomplete | None = None, + _sa_skip_for_implicit_returning: bool = False, ): ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... def bulk_save_objects( - self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + self, objects, return_defaults: bool = False, update_changed_only: bool = True, preserve_order: bool = True ): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = False, render_nulls: bool = False) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... def query(self, *entities, **kwargs): ... - def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None) -> None: ... def rollback(self) -> None: ... def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... ScopedSession = scoped_session diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index a5bc2eb9fab4..2953604558f5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -32,10 +32,10 @@ class ORMExecuteState(MemoizedSlots): ) -> None: ... def invoke_statement( self, - statement: Incomplete | None = ..., - params: Incomplete | None = ..., - execution_options: Incomplete | None = ..., - bind_arguments: Incomplete | None = ..., + statement: Incomplete | None = None, + params: Incomplete | None = None, + execution_options: Incomplete | None = None, + bind_arguments: Incomplete | None = None, ): ... @property def bind_mapper(self): ... @@ -70,16 +70,16 @@ class ORMExecuteState(MemoizedSlots): class SessionTransaction(TransactionalContext): session: Any nested: Any - def __init__(self, session, parent: Incomplete | None = ..., nested: bool = ..., autobegin: bool = ...) -> None: ... + def __init__(self, session, parent: Incomplete | None = None, nested: bool = False, autobegin: bool = False) -> None: ... @property def parent(self): ... @property def is_active(self): ... - def connection(self, bindkey, execution_options: Incomplete | None = ..., **kwargs): ... + def connection(self, bindkey, execution_options: Incomplete | None = None, **kwargs): ... def prepare(self) -> None: ... - def commit(self, _to_root: bool = ...): ... - def rollback(self, _capture_exception: bool = ..., _to_root: bool = ...): ... - def close(self, invalidate: bool = ...) -> None: ... + def commit(self, _to_root: bool = False): ... + def rollback(self, _capture_exception: bool = False, _to_root: bool = False): ... + def close(self, invalidate: bool = False) -> None: ... class Session(_SessionClassMethods): identity_map: Any @@ -94,16 +94,16 @@ class Session(_SessionClassMethods): dispatch: Incomplete def __init__( self, - bind: Incomplete | None = ..., - autoflush: bool = ..., - future: bool = ..., - expire_on_commit: bool = ..., - autocommit: bool = ..., - twophase: bool = ..., - binds: Incomplete | None = ..., - enable_baked_queries: bool = ..., - info: Incomplete | None = ..., - query_cls: Incomplete | None = ..., + bind: Incomplete | None = None, + autoflush: bool = True, + future: bool = False, + expire_on_commit: bool = True, + autocommit: bool = False, + twophase: bool = False, + binds: Incomplete | None = None, + enable_baked_queries: bool = True, + info: Incomplete | None = None, + query_cls: Incomplete | None = None, ) -> None: ... connection_callable: Any def __enter__(self: Self) -> Self: ... @@ -116,7 +116,7 @@ class Session(_SessionClassMethods): def get_nested_transaction(self): ... @memoized_property def info(self): ... - def begin(self, subtransactions: bool = ..., nested: bool = ..., _subtrans: bool = ...): ... + def begin(self, subtransactions: bool = False, nested: bool = False, _subtrans: bool = False): ... def begin_nested(self): ... def rollback(self) -> None: ... def commit(self) -> None: ... @@ -124,26 +124,26 @@ class Session(_SessionClassMethods): # TODO: bind_arguments could use a TypedDict def connection( self, - bind_arguments: Mapping[str, Any] | None = ..., - close_with_result: bool = ..., - execution_options: Mapping[str, Any] | None = ..., + bind_arguments: Mapping[str, Any] | None = None, + close_with_result: bool = False, + execution_options: Mapping[str, Any] | None = None, **kw: Any, ) -> Connection: ... def execute( self, statement, - params: Incomplete | None = ..., + params: Incomplete | None = None, execution_options=..., - bind_arguments: Incomplete | None = ..., - _parent_execute_state: Incomplete | None = ..., - _add_event: Incomplete | None = ..., + bind_arguments: Incomplete | None = None, + _parent_execute_state: Incomplete | None = None, + _add_event: Incomplete | None = None, **kw, ) -> Result: ... def scalar( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def scalars( - self, statement, params: Incomplete | None = ..., execution_options=..., bind_arguments: Incomplete | None = ..., **kw + self, statement, params: Incomplete | None = None, execution_options=..., bind_arguments: Incomplete | None = None, **kw ): ... def close(self) -> None: ... def invalidate(self) -> None: ... @@ -152,11 +152,11 @@ class Session(_SessionClassMethods): def bind_table(self, table, bind) -> None: ... def get_bind( self, - mapper: Incomplete | None = ..., - clause: Incomplete | None = ..., - bind: Incomplete | None = ..., - _sa_skip_events: Incomplete | None = ..., - _sa_skip_for_implicit_returning: bool = ..., + mapper: Incomplete | None = None, + clause: Incomplete | None = None, + bind: Incomplete | None = None, + _sa_skip_events: Incomplete | None = None, + _sa_skip_for_implicit_returning: bool = False, ): ... @overload def query(self, entities: Table, **kwargs: Any) -> Query[Any]: ... @@ -168,34 +168,34 @@ class Session(_SessionClassMethods): def query(self, *entities: type[_T], **kwargs: Any) -> Query[_T]: ... @property def no_autoflush(self) -> None: ... - def refresh(self, instance, attribute_names: Incomplete | None = ..., with_for_update: Incomplete | None = ...) -> None: ... + def refresh(self, instance, attribute_names: Incomplete | None = None, with_for_update: Incomplete | None = None) -> None: ... def expire_all(self) -> None: ... - def expire(self, instance, attribute_names: Incomplete | None = ...) -> None: ... + def expire(self, instance, attribute_names: Incomplete | None = None) -> None: ... def expunge(self, instance) -> None: ... - def add(self, instance, _warn: bool = ...) -> None: ... + def add(self, instance, _warn: bool = True) -> None: ... def add_all(self, instances) -> None: ... def delete(self, instance) -> None: ... def get( self, entity, ident, - options: Incomplete | None = ..., - populate_existing: bool = ..., - with_for_update: Incomplete | None = ..., - identity_token: Incomplete | None = ..., - execution_options: Incomplete | None = ..., + options: Incomplete | None = None, + populate_existing: bool = False, + with_for_update: Incomplete | None = None, + identity_token: Incomplete | None = None, + execution_options: Incomplete | None = None, ): ... - def merge(self, instance, load: bool = ..., options: Incomplete | None = ...): ... + def merge(self, instance, load: bool = True, options: Incomplete | None = None): ... def enable_relationship_loading(self, obj) -> None: ... def __contains__(self, instance): ... def __iter__(self): ... - def flush(self, objects: Incomplete | None = ...) -> None: ... + def flush(self, objects: Incomplete | None = None) -> None: ... def bulk_save_objects( - self, objects, return_defaults: bool = ..., update_changed_only: bool = ..., preserve_order: bool = ... + self, objects, return_defaults: bool = False, update_changed_only: bool = True, preserve_order: bool = True ): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...) -> None: ... + def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = False, render_nulls: bool = False) -> None: ... def bulk_update_mappings(self, mapper, mappings) -> None: ... - def is_modified(self, instance, include_collections: bool = ...): ... + def is_modified(self, instance, include_collections: bool = True): ... @property def is_active(self): ... @property @@ -210,12 +210,12 @@ class sessionmaker(_SessionClassMethods): class_: Any def __init__( self, - bind: Incomplete | None = ..., + bind: Incomplete | None = None, class_=..., - autoflush: bool = ..., - autocommit: bool = ..., - expire_on_commit: bool = ..., - info: Incomplete | None = ..., + autoflush: bool = True, + autocommit: bool = False, + expire_on_commit: bool = True, + info: Incomplete | None = None, **kw, ) -> None: ... def begin(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi index f4b9508149f5..7ca4a1c2dcf4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategies.pyi @@ -8,7 +8,7 @@ class UninstrumentedColumnLoader(LoaderStrategy): columns: Any def __init__(self, parent, strategy_key) -> None: ... def setup_query( - self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = ..., **kwargs + self, compile_state, query_entity, path, loadopt, adapter, column_collection: Incomplete | None = None, **kwargs ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -17,7 +17,7 @@ class ColumnLoader(LoaderStrategy): columns: Any is_composite: Any def __init__(self, parent, strategy_key) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = ..., **kwargs) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, check_for_adapt: bool = False, **kwargs) -> None: ... # type: ignore[override] is_class_level: bool def init_class_attribute(self, mapper) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... @@ -39,12 +39,12 @@ class DeferredColumnLoader(LoaderStrategy): def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... is_class_level: bool def init_class_attribute(self, mapper) -> None: ... - def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override] + def setup_query(self, compile_state, query_entity, path, loadopt, adapter, column_collection, memoized_populators, only_load_props: Incomplete | None = None, **kw) -> None: ... # type: ignore[override] class LoadDeferredColumns: key: Any raiseload: Any - def __init__(self, key, raiseload: bool = ...) -> None: ... + def __init__(self, key, raiseload: bool = False) -> None: ... def __call__(self, state, passive=...): ... class AbstractRelationshipLoader(LoaderStrategy): @@ -116,9 +116,9 @@ class JoinedLoader(AbstractRelationshipLoader): path, loadopt, adapter, - column_collection: Incomplete | None = ..., - parentmapper: Incomplete | None = ..., - chained_from_outerjoin: bool = ..., + column_collection: Incomplete | None = None, + parentmapper: Incomplete | None = None, + chained_from_outerjoin: bool = False, **kwargs, ) -> None: ... def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 3e1ee1b39f90..83b4b04ea941 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -19,22 +19,22 @@ class Load(Generative, LoaderOption): def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... def options(self: Self, *opts) -> Self: ... - def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = ...) -> Self: ... - def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = ..., opts_only: bool = ...) -> Self: ... + def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = True) -> Self: ... + def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = None, opts_only: bool = False) -> Self: ... def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... def set_class_strategy(self: Self, strategy, opts) -> Self: ... # Added dynamically at runtime - def contains_eager(loadopt: Self, attr, alias: Incomplete | None = ...) -> Self: ... + def contains_eager(loadopt: Self, attr, alias: Incomplete | None = None) -> Self: ... def load_only(loadopt: Self, *attrs) -> Self: ... - def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = ...) -> Self: ... + def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = None) -> Self: ... def subqueryload(loadopt: Self, attr) -> Self: ... def selectinload(loadopt: Self, attr) -> Self: ... def lazyload(loadopt: Self, attr) -> Self: ... def immediateload(loadopt: Self, attr) -> Self: ... def noload(loadopt: Self, attr) -> Self: ... - def raiseload(loadopt: Self, attr, sql_only: bool = ...) -> Self: ... + def raiseload(loadopt: Self, attr, sql_only: bool = False) -> Self: ... def defaultload(loadopt: Self, attr) -> Self: ... - def defer(loadopt: Self, key, raiseload: bool = ...) -> Self: ... + def defer(loadopt: Self, key, raiseload: bool = False) -> Self: ... def undefer(loadopt: Self, key) -> Self: ... def undefer_group(loadopt: Self, name) -> Self: ... def with_expression(loadopt: Self, key, expression) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi index 20de2df97427..26b13e383029 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/unitofwork.pyi @@ -26,11 +26,11 @@ class UOWTransaction: def register_object( self, state, - isdelete: bool = ..., - listonly: bool = ..., - cancel_delete: bool = ..., - operation: Incomplete | None = ..., - prop: Incomplete | None = ..., + isdelete: bool = False, + listonly: bool = False, + cancel_delete: bool = False, + operation: Incomplete | None = None, + prop: Incomplete | None = None, ): ... def register_post_update(self, state, post_update_cols) -> None: ... def filter_states_for_dep(self, dep, states): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi index b7c6fd4f7d78..cb7e9f809ea9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/util.pyi @@ -32,7 +32,7 @@ class CascadeOptions(frozenset[Any]): @classmethod def from_string(cls, arg): ... -def polymorphic_union(table_map, typecolname, aliasname: str = ..., cast_nulls: bool = ...): ... +def polymorphic_union(table_map, typecolname, aliasname: str = "p_union", cast_nulls: bool = True): ... def identity_key(*args, **kwargs): ... class ORMAdapter(sql_util.ColumnAdapter): @@ -41,10 +41,10 @@ class ORMAdapter(sql_util.ColumnAdapter): def __init__( self, entity, - equivalents: Incomplete | None = ..., - adapt_required: bool = ..., - allow_label_resolve: bool = ..., - anonymize_labels: bool = ..., + equivalents: Incomplete | None = None, + adapt_required: bool = False, + allow_label_resolve: bool = True, + anonymize_labels: bool = False, ) -> None: ... class AliasedClass: @@ -52,15 +52,15 @@ class AliasedClass: def __init__( self, mapped_class_or_ac, - alias: Incomplete | None = ..., - name: Incomplete | None = ..., - flat: bool = ..., - adapt_on_names: bool = ..., - with_polymorphic_mappers=..., - with_polymorphic_discriminator: Incomplete | None = ..., - base_alias: Incomplete | None = ..., - use_mapper_path: bool = ..., - represents_outer_join: bool = ..., + alias: Incomplete | None = None, + name: Incomplete | None = None, + flat: bool = False, + adapt_on_names: bool = False, + with_polymorphic_mappers=(), + with_polymorphic_discriminator: Incomplete | None = None, + base_alias: Incomplete | None = None, + use_mapper_path: bool = False, + represents_outer_join: bool = False, ) -> None: ... def __getattr__(self, key: str): ... @@ -110,29 +110,29 @@ class LoaderCriteriaOption(CriteriaOption): self, entity_or_base, where_criteria, - loader_only: bool = ..., - include_aliases: bool = ..., - propagate_to_loaders: bool = ..., - track_closure_variables: bool = ..., + loader_only: bool = False, + include_aliases: bool = False, + propagate_to_loaders: bool = True, + track_closure_variables: bool = True, ) -> None: ... def process_compile_state_replaced_entities(self, compile_state, mapper_entities): ... def process_compile_state(self, compile_state) -> None: ... def get_global_criteria(self, attributes) -> None: ... def aliased( - element, alias: Incomplete | None = ..., name: Incomplete | None = ..., flat: bool = ..., adapt_on_names: bool = ... + element, alias: Incomplete | None = None, name: Incomplete | None = None, flat: bool = False, adapt_on_names: bool = False ): ... def with_polymorphic( base, classes, - selectable: bool = ..., - flat: bool = ..., - polymorphic_on: Incomplete | None = ..., - aliased: bool = ..., - adapt_on_names: bool = ..., - innerjoin: bool = ..., - _use_mapper_path: bool = ..., - _existing_alias: Incomplete | None = ..., + selectable: bool = False, + flat: bool = False, + polymorphic_on: Incomplete | None = None, + aliased: bool = False, + adapt_on_names: bool = False, + innerjoin: bool = False, + _use_mapper_path: bool = False, + _existing_alias: Incomplete | None = None, ) -> AliasedClass: ... class Bundle(ORMColumnsClauseRole, SupportsCloneAnnotations, sql_base.MemoizedHasCacheKey, InspectionAttr): @@ -166,28 +166,35 @@ class _ORMJoin(expression.Join): self, left, right, - onclause: Incomplete | None = ..., - isouter: bool = ..., - full: bool = ..., - _left_memo: Incomplete | None = ..., - _right_memo: Incomplete | None = ..., - _extra_criteria=..., + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + _left_memo: Incomplete | None = None, + _right_memo: Incomplete | None = None, + _extra_criteria=(), ) -> None: ... def join( self, right, - onclause: Incomplete | None = ..., - isouter: bool = ..., - full: bool = ..., - join_to_left: Incomplete | None = ..., + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + join_to_left: Incomplete | None = None, + ): ... + def outerjoin( + self, right, onclause: Incomplete | None = None, full: bool = False, join_to_left: Incomplete | None = None ): ... - def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... def join( - left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ..., join_to_left: Incomplete | None = ... + left, + right, + onclause: Incomplete | None = None, + isouter: bool = False, + full: bool = False, + join_to_left: Incomplete | None = None, ): ... -def outerjoin(left, right, onclause: Incomplete | None = ..., full: bool = ..., join_to_left: Incomplete | None = ...): ... -def with_parent(instance, prop, from_entity: Incomplete | None = ...): ... +def outerjoin(left, right, onclause: Incomplete | None = None, full: bool = False, join_to_left: Incomplete | None = None): ... +def with_parent(instance, prop, from_entity: Incomplete | None = None): ... def has_identity(object_): ... def was_deleted(object_): ... def randomize_unitofwork() -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi index 3a8d01d616c3..0941b0c6b705 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/base.pyi @@ -30,14 +30,14 @@ class Pool(log.Identified): def __init__( self, creator: Callable[[], DBAPIConnection], - recycle: int = ..., - echo: Incomplete | None = ..., - logging_name: Incomplete | None = ..., - reset_on_return: bool = ..., - events: Incomplete | None = ..., - dialect: Incomplete | None = ..., - pre_ping: bool = ..., - _dispatch: Incomplete | None = ..., + recycle: int = -1, + echo: Incomplete | None = None, + logging_name: Incomplete | None = None, + reset_on_return: bool = True, + events: Incomplete | None = None, + dialect: Incomplete | None = None, + pre_ping: bool = False, + _dispatch: Incomplete | None = None, ) -> None: ... def recreate(self) -> None: ... def dispose(self) -> None: ... @@ -46,7 +46,7 @@ class Pool(log.Identified): class _ConnectionRecord: finalize_callback: Any - def __init__(self, pool, connect: bool = ...) -> None: ... + def __init__(self, pool, connect: bool = True) -> None: ... fresh: bool fairy_ref: Any starttime: Any @@ -63,13 +63,13 @@ class _ConnectionRecord: def record_info(self): ... @classmethod def checkout(cls, pool): ... - def checkin(self, _fairy_was_created: bool = ...) -> None: ... + def checkin(self, _fairy_was_created: bool = True) -> None: ... @property def in_use(self): ... @property def last_connect_time(self): ... def close(self) -> None: ... - def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = None, soft: bool = False) -> None: ... def get_connection(self): ... class _ConnectionFairy: @@ -87,7 +87,7 @@ class _ConnectionFairy: def info(self): ... @property def record_info(self): ... - def invalidate(self, e: Incomplete | None = ..., soft: bool = ...) -> None: ... + def invalidate(self, e: Incomplete | None = None, soft: bool = False) -> None: ... def cursor(self, *args, **kwargs): ... def __getattr__(self, key: str): ... def detach(self) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi index 9b3006621f31..aee3c588afe0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/pool/impl.pyi @@ -5,7 +5,7 @@ from .base import Pool class QueuePool(Pool): def __init__( - self, creator, pool_size: int = ..., max_overflow: int = ..., timeout: float = ..., use_lifo: bool = ..., **kw + self, creator, pool_size: int = 5, max_overflow: int = 10, timeout: float = 30.0, use_lifo: bool = False, **kw ) -> None: ... def recreate(self): ... def dispose(self) -> None: ... @@ -26,7 +26,7 @@ class NullPool(Pool): class SingletonThreadPool(Pool): size: Any - def __init__(self, creator, pool_size: int = ..., **kw) -> None: ... + def __init__(self, creator, pool_size: int = 5, **kw) -> None: ... def recreate(self): ... def dispose(self) -> None: ... def status(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/processors.pyi b/stubs/SQLAlchemy/sqlalchemy/processors.pyi index 2c74bf49992d..26ee40a7c386 100644 --- a/stubs/SQLAlchemy/sqlalchemy/processors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/processors.pyi @@ -2,6 +2,6 @@ from _typeshed import Incomplete def str_to_datetime_processor_factory(regexp, type_): ... def py_fallback(): ... -def to_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... -def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = ...): ... +def to_unicode_processor_factory(encoding, errors: Incomplete | None = None): ... +def to_conditional_unicode_processor_factory(encoding, errors: Incomplete | None = None): ... def to_decimal_processor_factory(target_class, scale): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index c3cf355234f3..343ec09b2b98 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -116,7 +116,7 @@ class SchemaVisitor(ClauseVisitor): __traverse_options__: Any class ColumnCollection: - def __init__(self, columns: Incomplete | None = ...) -> None: ... + def __init__(self, columns: Incomplete | None = None) -> None: ... def keys(self): ... def values(self): ... def items(self): ... @@ -128,7 +128,7 @@ class ColumnCollection: def __contains__(self, key): ... def compare(self, other): ... def __eq__(self, other): ... - def get(self, key, default: Incomplete | None = ...): ... + def get(self, key, default: Incomplete | None = None): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... def __setattr__(self, key: str, obj) -> None: ... @@ -136,13 +136,13 @@ class ColumnCollection: def remove(self, column) -> None: ... def update(self, iter_) -> None: ... __hash__: ClassVar[None] # type: ignore[assignment] - def add(self, column, key: Incomplete | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = None) -> None: ... def contains_column(self, col): ... def as_immutable(self): ... - def corresponding_column(self, column, require_embedded: bool = ...): ... + def corresponding_column(self, column, require_embedded: bool = False): ... class DedupeColumnCollection(ColumnCollection): - def add(self, column, key: Incomplete | None = ...) -> None: ... + def add(self, column, key: Incomplete | None = None) -> None: ... def extend(self, iter_) -> None: ... def remove(self, column) -> None: ... def replace(self, column) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi index 034252252300..605ed309ac66 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/coercions.pyi @@ -13,9 +13,9 @@ traversals: Any def expect( role, element, - apply_propagate_attrs: Incomplete | None = ..., - argname: Incomplete | None = ..., - post_inspect: bool = ..., + apply_propagate_attrs: Incomplete | None = None, + argname: Incomplete | None = None, + post_inspect: bool = False, **kw, ): ... def expect_as_key(role, element, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi index 567dac7559ff..6529843703e1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/compiler.pyi @@ -37,7 +37,7 @@ WARN_LINTING: Incomplete FROM_LINTING: Incomplete class FromLinter: - def lint(self, start: Incomplete | None = ...): ... + def lint(self, start: Incomplete | None = None): ... def warn(self) -> None: ... class Compiled: @@ -55,8 +55,8 @@ class Compiled: self, dialect, statement, - schema_translate_map: Incomplete | None = ..., - render_schema_translate: bool = ..., + schema_translate_map: Incomplete | None = None, + render_schema_translate: bool = False, compile_kwargs=..., ) -> None: ... def visit_unsupported_compilation(self, element, err) -> None: ... @@ -64,7 +64,7 @@ class Compiled: def sql_compiler(self) -> None: ... def process(self, obj, **kwargs): ... def construct_params( - self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... + self, params: Incomplete | None = None, extracted_parameters: Incomplete | None = None, escape_names: bool = True ) -> None: ... @property def params(self): ... @@ -80,7 +80,7 @@ class _CompileLabel(elements.ColumnElement[Incomplete]): __visit_name__: str element: Incomplete name: Incomplete - def __init__(self, col, name, alt_names=...) -> None: ... + def __init__(self, col, name, alt_names=()) -> None: ... @property def proxy_set(self): ... @property @@ -126,9 +126,9 @@ class SQLCompiler(Compiled): self, dialect, statement, - cache_key: Incomplete | None = ..., - column_keys: Incomplete | None = ..., - for_executemany: bool = ..., + cache_key: Incomplete | None = None, + column_keys: Incomplete | None = None, + for_executemany: bool = False, linting=..., **kwargs, ) -> None: ... @@ -139,27 +139,27 @@ class SQLCompiler(Compiled): def is_subquery(self): ... @property def sql_compiler(self): ... - def construct_params(self, params: Incomplete | None = ..., _group_number: Incomplete | None = ..., _check: bool = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ...): ... # type: ignore[override] + def construct_params(self, params: Incomplete | None = None, _group_number: Incomplete | None = None, _check: bool = True, extracted_parameters: Incomplete | None = None, escape_names: bool = True): ... # type: ignore[override] @property def params(self): ... def default_from(self): ... - def visit_grouping(self, grouping, asfrom: bool = ..., **kwargs): ... + def visit_grouping(self, grouping, asfrom: bool = False, **kwargs): ... def visit_select_statement_grouping(self, grouping, **kwargs): ... - def visit_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... - def visit_textual_label_reference(self, element, within_columns_clause: bool = ..., **kwargs): ... + def visit_label_reference(self, element, within_columns_clause: bool = False, **kwargs): ... + def visit_textual_label_reference(self, element, within_columns_clause: bool = False, **kwargs): ... def visit_label( self, label, - add_to_result_map: Incomplete | None = ..., - within_label_clause: bool = ..., - within_columns_clause: bool = ..., - render_label_as_label: Incomplete | None = ..., - result_map_targets=..., + add_to_result_map: Incomplete | None = None, + within_label_clause: bool = False, + within_columns_clause: bool = False, + render_label_as_label: Incomplete | None = None, + result_map_targets=(), **kw, ): ... def visit_lambda_element(self, element, **kw): ... def visit_column( - self, column, add_to_result_map: Incomplete | None = ..., include_table: bool = ..., result_map_targets=..., **kwargs + self, column, add_to_result_map: Incomplete | None = None, include_table: bool = True, result_map_targets=(), **kwargs ): ... def visit_collation(self, element, **kw): ... def visit_fromclause(self, fromclause, **kwargs): ... @@ -167,8 +167,8 @@ class SQLCompiler(Compiled): def visit_typeclause(self, typeclause, **kw): ... def post_process_text(self, text): ... def escape_literal_column(self, text): ... - def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = ..., **kw): ... - def visit_textual_select(self, taf, compound_index: Incomplete | None = ..., asfrom: bool = ..., **kw): ... + def visit_textclause(self, textclause, add_to_result_map: Incomplete | None = None, **kw): ... + def visit_textual_select(self, taf, compound_index: Incomplete | None = None, asfrom: bool = False, **kw): ... def visit_null(self, expr, **kw): ... def visit_true(self, expr, **kw): ... def visit_false(self, expr, **kw): ... @@ -182,13 +182,13 @@ class SQLCompiler(Compiled): def visit_funcfilter(self, funcfilter, **kwargs): ... def visit_extract(self, extract, **kwargs): ... def visit_scalar_function_column(self, element, **kw): ... - def visit_function(self, func, add_to_result_map: Incomplete | None = ..., **kwargs): ... + def visit_function(self, func, add_to_result_map: Incomplete | None = None, **kwargs): ... def visit_next_value_func(self, next_value, **kw): ... def visit_sequence(self, sequence, **kw) -> None: ... def function_argspec(self, func, **kwargs): ... compile_state: Incomplete - def visit_compound_select(self, cs, asfrom: bool = ..., compound_index: Incomplete | None = ..., **kwargs): ... - def visit_unary(self, unary, add_to_result_map: Incomplete | None = ..., result_map_targets=..., **kw): ... + def visit_compound_select(self, cs, asfrom: bool = False, compound_index: Incomplete | None = None, **kwargs): ... + def visit_unary(self, unary, add_to_result_map: Incomplete | None = None, result_map_targets=(), **kw): ... def visit_is_true_unary_operator(self, element, operator, **kw): ... def visit_is_false_unary_operator(self, element, operator, **kw): ... def visit_not_match_op_binary(self, binary, operator, **kw): ... @@ -198,10 +198,10 @@ class SQLCompiler(Compiled): def visit_binary( self, binary, - override_operator: Incomplete | None = ..., - eager_grouping: bool = ..., - from_linter: Incomplete | None = ..., - lateral_from_linter: Incomplete | None = ..., + override_operator: Incomplete | None = None, + eager_grouping: bool = False, + from_linter: Incomplete | None = None, + lateral_from_linter: Incomplete | None = None, **kw, ): ... def visit_function_as_comparison_op_binary(self, element, operator, **kw): ... @@ -227,24 +227,24 @@ class SQLCompiler(Compiled): def visit_bindparam( self, bindparam, - within_columns_clause: bool = ..., - literal_binds: bool = ..., - skip_bind_expression: bool = ..., - literal_execute: bool = ..., - render_postcompile: bool = ..., + within_columns_clause: bool = False, + literal_binds: bool = False, + skip_bind_expression: bool = False, + literal_execute: bool = False, + render_postcompile: bool = False, **kwargs, ): ... def render_literal_bindparam( - self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = ..., **kw + self, bindparam, render_literal_value=..., bind_expression_template: Incomplete | None = None, **kw ): ... def render_literal_value(self, value, type_): ... def bindparam_string( self, name, - positional_names: Incomplete | None = ..., - post_compile: bool = ..., - expanding: bool = ..., - escaped_from: Incomplete | None = ..., + positional_names: Incomplete | None = None, + post_compile: bool = False, + expanding: bool = False, + escaped_from: Incomplete | None = None, **kw, ): ... execution_options: Incomplete @@ -252,11 +252,11 @@ class SQLCompiler(Compiled): def visit_cte( self, cte, - asfrom: bool = ..., - ashint: bool = ..., - fromhints: Incomplete | None = ..., - visiting_cte: Incomplete | None = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + ashint: bool = False, + fromhints: Incomplete | None = None, + visiting_cte: Incomplete | None = None, + from_linter: Incomplete | None = None, **kwargs, ): ... def visit_table_valued_alias(self, element, **kw): ... @@ -264,20 +264,20 @@ class SQLCompiler(Compiled): def visit_alias( self, alias, - asfrom: bool = ..., - ashint: bool = ..., - iscrud: bool = ..., - fromhints: Incomplete | None = ..., - subquery: bool = ..., - lateral: bool = ..., - enclosing_alias: Incomplete | None = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + ashint: bool = False, + iscrud: bool = False, + fromhints: Incomplete | None = None, + subquery: bool = False, + lateral: bool = False, + enclosing_alias: Incomplete | None = None, + from_linter: Incomplete | None = None, **kwargs, ): ... def visit_subquery(self, subquery, **kw): ... def visit_lateral(self, lateral_, **kw): ... - def visit_tablesample(self, tablesample, asfrom: bool = ..., **kw): ... - def visit_values(self, element, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kw): ... + def visit_tablesample(self, tablesample, asfrom: bool = False, **kw): ... + def visit_values(self, element, asfrom: bool = False, from_linter: Incomplete | None = None, **kw): ... def get_render_as_alias_suffix(self, alias_name_text): ... def format_from_hint_text(self, sqltext, table, hint, iscrud): ... def get_select_hint_text(self, byfroms) -> None: ... @@ -288,13 +288,13 @@ class SQLCompiler(Compiled): def visit_select( self, select_stmt, - asfrom: bool = ..., - insert_into: bool = ..., - fromhints: Incomplete | None = ..., - compound_index: Incomplete | None = ..., - select_wraps_for: Incomplete | None = ..., - lateral: bool = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + insert_into: bool = False, + fromhints: Incomplete | None = None, + compound_index: Incomplete | None = None, + select_wraps_for: Incomplete | None = None, + lateral: bool = False, + from_linter: Incomplete | None = None, **kwargs, ): ... def get_cte_preamble(self, recursive): ... @@ -308,15 +308,15 @@ class SQLCompiler(Compiled): def visit_table( self, table, - asfrom: bool = ..., - iscrud: bool = ..., - ashint: bool = ..., - fromhints: Incomplete | None = ..., - use_schema: bool = ..., - from_linter: Incomplete | None = ..., + asfrom: bool = False, + iscrud: bool = False, + ashint: bool = False, + fromhints: Incomplete | None = None, + use_schema: bool = True, + from_linter: Incomplete | None = None, **kwargs, ): ... - def visit_join(self, join, asfrom: bool = ..., from_linter: Incomplete | None = ..., **kwargs): ... + def visit_join(self, join, asfrom: bool = False, from_linter: Incomplete | None = None, **kwargs): ... def visit_insert(self, insert_stmt, **kw): ... def update_limit_clause(self, update_stmt) -> None: ... def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... @@ -350,17 +350,17 @@ class DDLCompiler(Compiled): @memoized_property def type_compiler(self): ... def construct_params( - self, params: Incomplete | None = ..., extracted_parameters: Incomplete | None = ..., escape_names: bool = ... + self, params: Incomplete | None = None, extracted_parameters: Incomplete | None = None, escape_names: bool = True ) -> None: ... def visit_ddl(self, ddl, **kwargs): ... def visit_create_schema(self, create, **kw): ... def visit_drop_schema(self, drop, **kw): ... def visit_create_table(self, create, **kw): ... - def visit_create_column(self, create, first_pk: bool = ..., **kw): ... - def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = ..., **kw): ... + def visit_create_column(self, create, first_pk: bool = False, **kw): ... + def create_table_constraints(self, table, _include_foreign_key_constraints: Incomplete | None = None, **kw): ... def visit_drop_table(self, drop, **kw): ... def visit_drop_view(self, drop, **kw): ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ..., **kw): ... + def visit_create_index(self, create, include_schema: bool = False, include_table_schema: bool = True, **kw): ... def visit_drop_index(self, drop, **kw): ... def visit_add_constraint(self, create, **kw): ... def visit_set_table_comment(self, create, **kw): ... @@ -368,7 +368,7 @@ class DDLCompiler(Compiled): def visit_set_column_comment(self, create, **kw): ... def visit_drop_column_comment(self, drop, **kw): ... def get_identity_options(self, identity_options): ... - def visit_create_sequence(self, create, prefix: Incomplete | None = ..., **kw): ... + def visit_create_sequence(self, create, prefix: Incomplete | None = None, **kw): ... def visit_drop_sequence(self, drop, **kw): ... def visit_drop_constraint(self, drop, **kw): ... def get_column_specification(self, column, **kwargs): ... @@ -452,36 +452,36 @@ class IdentifierPreparer: def __init__( self, dialect, - initial_quote: str = ..., - final_quote: Incomplete | None = ..., - escape_quote: str = ..., - quote_case_sensitive_collations: bool = ..., - omit_schema: bool = ..., + initial_quote: str = '"', + final_quote: Incomplete | None = None, + escape_quote: str = '"', + quote_case_sensitive_collations: bool = True, + omit_schema: bool = False, ) -> None: ... def validate_sql_phrase(self, element, reg): ... def quote_identifier(self, value): ... - def quote_schema(self, schema, force: Incomplete | None = ...): ... - def quote(self, ident, force: Incomplete | None = ...): ... + def quote_schema(self, schema, force: Incomplete | None = None): ... + def quote(self, ident, force: Incomplete | None = None): ... def format_collation(self, collation_name): ... - def format_sequence(self, sequence, use_schema: bool = ...): ... - def format_label(self, label, name: Incomplete | None = ...): ... - def format_alias(self, alias, name: Incomplete | None = ...): ... - def format_savepoint(self, savepoint, name: Incomplete | None = ...): ... - def format_constraint(self, constraint, _alembic_quote: bool = ...): ... - def truncate_and_render_index_name(self, name, _alembic_quote: bool = ...): ... - def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = ...): ... + def format_sequence(self, sequence, use_schema: bool = True): ... + def format_label(self, label, name: Incomplete | None = None): ... + def format_alias(self, alias, name: Incomplete | None = None): ... + def format_savepoint(self, savepoint, name: Incomplete | None = None): ... + def format_constraint(self, constraint, _alembic_quote: bool = True): ... + def truncate_and_render_index_name(self, name, _alembic_quote: bool = True): ... + def truncate_and_render_constraint_name(self, name, _alembic_quote: bool = True): ... def format_index(self, index): ... - def format_table(self, table, use_schema: bool = ..., name: Incomplete | None = ...): ... + def format_table(self, table, use_schema: bool = True, name: Incomplete | None = None): ... def format_schema(self, name): ... - def format_label_name(self, name, anon_map: Incomplete | None = ...): ... + def format_label_name(self, name, anon_map: Incomplete | None = None): ... def format_column( self, column, - use_table: bool = ..., - name: Incomplete | None = ..., - table_name: Incomplete | None = ..., - use_schema: bool = ..., - anon_map: Incomplete | None = ..., + use_table: bool = False, + name: Incomplete | None = None, + table_name: Incomplete | None = None, + use_schema: bool = False, + anon_map: Incomplete | None = None, ): ... - def format_table_seq(self, table, use_schema: bool = ...): ... + def format_table_seq(self, table, use_schema: bool = True): ... def unformat_identifiers(self, identifiers): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi index 5d34ce026300..4749fedd2bba 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/ddl.pyi @@ -12,11 +12,11 @@ class DDLElement(roles.DDLRole, Executable, _DDLCompiles): on: Any dialect: Any callable_: Any - def execute(self, bind: Incomplete | None = ..., target: Incomplete | None = ...): ... # type: ignore[override] + def execute(self, bind: Incomplete | None = None, target: Incomplete | None = None): ... # type: ignore[override] def against(self, target) -> None: ... state: Any def execute_if( - self, dialect: Incomplete | None = ..., callable_: Incomplete | None = ..., state: Incomplete | None = ... + self, dialect: Incomplete | None = None, callable_: Incomplete | None = None, state: Incomplete | None = None ) -> None: ... def __call__(self, target, bind, **kw): ... bind: Any @@ -25,7 +25,7 @@ class DDL(DDLElement): __visit_name__: str statement: Any context: Any - def __init__(self, statement, context: Incomplete | None = ..., bind: Incomplete | None = ...) -> None: ... + def __init__(self, statement, context: Incomplete | None = None, bind: Incomplete | None = None) -> None: ... class _CreateDropBase(DDLElement): element: Any @@ -35,10 +35,10 @@ class _CreateDropBase(DDLElement): def __init__( self, element, - bind: Incomplete | None = ..., - if_exists: bool = ..., - if_not_exists: bool = ..., - _legacy_bind: Incomplete | None = ..., + bind: Incomplete | None = None, + if_exists: bool = False, + if_not_exists: bool = False, + _legacy_bind: Incomplete | None = None, ) -> None: ... @property def stringify_dialect(self): ... @@ -46,13 +46,13 @@ class _CreateDropBase(DDLElement): class CreateSchema(_CreateDropBase): __visit_name__: str quote: Any - def __init__(self, name, quote: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = None, **kw) -> None: ... class DropSchema(_CreateDropBase): __visit_name__: str quote: Any cascade: Any - def __init__(self, name, quote: Incomplete | None = ..., cascade: bool = ..., **kw) -> None: ... + def __init__(self, name, quote: Incomplete | None = None, cascade: bool = False, **kw) -> None: ... class CreateTable(_CreateDropBase): __visit_name__: str @@ -61,9 +61,9 @@ class CreateTable(_CreateDropBase): def __init__( self, element, - bind: Incomplete | None = ..., - include_foreign_key_constraints: Incomplete | None = ..., - if_not_exists: bool = ..., + bind: Incomplete | None = None, + include_foreign_key_constraints: Incomplete | None = None, + if_not_exists: bool = False, ) -> None: ... class _DropView(_CreateDropBase): @@ -76,7 +76,7 @@ class CreateColumn(_DDLCompiles): class DropTable(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_exists: bool = False) -> None: ... class CreateSequence(_CreateDropBase): __visit_name__: str @@ -86,11 +86,11 @@ class DropSequence(_CreateDropBase): class CreateIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_not_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_not_exists: bool = False) -> None: ... class DropIndex(_CreateDropBase): __visit_name__: str - def __init__(self, element, bind: Incomplete | None = ..., if_exists: bool = ...) -> None: ... + def __init__(self, element, bind: Incomplete | None = None, if_exists: bool = False) -> None: ... class AddConstraint(_CreateDropBase): __visit_name__: str @@ -99,7 +99,7 @@ class AddConstraint(_CreateDropBase): class DropConstraint(_CreateDropBase): __visit_name__: str cascade: Any - def __init__(self, element, cascade: bool = ..., **kw) -> None: ... + def __init__(self, element, cascade: bool = False, **kw) -> None: ... class SetTableComment(_CreateDropBase): __visit_name__: str @@ -123,18 +123,18 @@ class SchemaGenerator(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, tables: Incomplete | None = None, **kwargs) -> None: ... def visit_metadata(self, metadata) -> None: ... def visit_table( self, table, - create_ok: bool = ..., - include_foreign_key_constraints: Incomplete | None = ..., - _is_metadata_operation: bool = ..., + create_ok: bool = False, + include_foreign_key_constraints: Incomplete | None = None, + _is_metadata_operation: bool = False, ) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... - def visit_sequence(self, sequence, create_ok: bool = ...) -> None: ... - def visit_index(self, index, create_ok: bool = ...) -> None: ... + def visit_sequence(self, sequence, create_ok: bool = False) -> None: ... + def visit_index(self, index, create_ok: bool = False) -> None: ... class SchemaDropper(DDLBase): checkfirst: Any @@ -142,14 +142,14 @@ class SchemaDropper(DDLBase): preparer: Any dialect: Any memo: Any - def __init__(self, dialect, connection, checkfirst: bool = ..., tables: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, dialect, connection, checkfirst: bool = False, tables: Incomplete | None = None, **kwargs) -> None: ... def visit_metadata(self, metadata): ... - def visit_index(self, index, drop_ok: bool = ...) -> None: ... - def visit_table(self, table, drop_ok: bool = ..., _is_metadata_operation: bool = ..., _ignore_sequences=...) -> None: ... + def visit_index(self, index, drop_ok: bool = False) -> None: ... + def visit_table(self, table, drop_ok: bool = False, _is_metadata_operation: bool = False, _ignore_sequences=()) -> None: ... def visit_foreign_key_constraint(self, constraint) -> None: ... - def visit_sequence(self, sequence, drop_ok: bool = ...) -> None: ... + def visit_sequence(self, sequence, drop_ok: bool = False) -> None: ... -def sort_tables(tables, skip_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ...): ... +def sort_tables(tables, skip_fn: Incomplete | None = None, extra_dependencies: Incomplete | None = None): ... def sort_tables_and_constraints( - tables, filter_fn: Incomplete | None = ..., extra_dependencies: Incomplete | None = ..., _warn_for_cycles: bool = ... + tables, filter_fn: Incomplete | None = None, extra_dependencies: Incomplete | None = None, _warn_for_cycles: bool = False ): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi index 22b69ce3b220..518c88b8468f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/dml.pyi @@ -46,7 +46,7 @@ class UpdateBase(roles.DMLRole, HasCTE, HasCompileState, DialectKWArgs, HasPrefi def returning(self, *cols) -> None: ... @property def exported_columns(self): ... - def with_hint(self, text, selectable: Incomplete | None = ..., dialect_name: str = ...) -> None: ... + def with_hint(self, text, selectable: Incomplete | None = None, dialect_name: str = "*") -> None: ... @property def entity_description(self): ... @property @@ -68,16 +68,16 @@ class Insert(ValuesBase): def __init__( self, table, - values: Incomplete | None = ..., - inline: bool = ..., - bind: Incomplete | None = ..., - prefixes: Incomplete | None = ..., - returning: Incomplete | None = ..., - return_defaults: bool = ..., + values: Incomplete | None = None, + inline: bool = False, + bind: Incomplete | None = None, + prefixes: Incomplete | None = None, + returning: Incomplete | None = None, + return_defaults: bool = False, **dialect_kw, ) -> None: ... def inline(self) -> None: ... - def from_select(self, names, select, include_defaults: bool = ...) -> None: ... + def from_select(self, names, select, include_defaults: bool = True) -> None: ... class DMLWhereBase: def where(self, *whereclause) -> None: ... @@ -92,14 +92,14 @@ class Update(DMLWhereBase, ValuesBase): def __init__( self, table, - whereclause: Incomplete | None = ..., - values: Incomplete | None = ..., - inline: bool = ..., - bind: Incomplete | None = ..., - prefixes: Incomplete | None = ..., - returning: Incomplete | None = ..., - return_defaults: bool = ..., - preserve_parameter_order: bool = ..., + whereclause: Incomplete | None = None, + values: Incomplete | None = None, + inline: bool = False, + bind: Incomplete | None = None, + prefixes: Incomplete | None = None, + returning: Incomplete | None = None, + return_defaults: bool = False, + preserve_parameter_order: bool = False, **dialect_kw, ) -> None: ... def ordered_values(self, *args) -> None: ... @@ -112,9 +112,9 @@ class Delete(DMLWhereBase, UpdateBase): def __init__( self, table, - whereclause: Incomplete | None = ..., - bind: Incomplete | None = ..., - returning: Incomplete | None = ..., - prefixes: Incomplete | None = ..., + whereclause: Incomplete | None = None, + bind: Incomplete | None = None, + returning: Incomplete | None = None, + prefixes: Incomplete | None = None, **dialect_kw, ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index f5c67286b0fa..921c6ef2acaa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -13,9 +13,9 @@ from .visitors import Traversible _T = TypeVar("_T") def collate(expression, collation): ... -def between(expr, lower_bound, upper_bound, symmetric: bool = ...): ... -def literal(value, type_: Incomplete | None = ...): ... -def outparam(key, type_: Incomplete | None = ...): ... +def between(expr, lower_bound, upper_bound, symmetric: bool = False): ... +def literal(value, type_: Incomplete | None = None): ... +def outparam(key, type_: Incomplete | None = None): ... def not_(clause): ... class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCacheKey, HasCopyInternals, Traversible): @@ -31,8 +31,8 @@ class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCache def unique_params(self, *optionaldict, **kwargs): ... def params(self, *optionaldict, **kwargs): ... def compare(self, other, **kw): ... - def self_group(self, against: Incomplete | None = ...): ... - def compile(self, bind: Incomplete | None = ..., dialect: Incomplete | None = ..., **kw): ... + def self_group(self, against: Incomplete | None = None): ... + def compile(self, bind: Incomplete | None = None, dialect: Incomplete | None = None, **kw): ... def __invert__(self): ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @@ -56,7 +56,7 @@ class ColumnElement( primary_key: bool foreign_keys: Any key: Any - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute @@ -99,17 +99,17 @@ class BindParameter(roles.InElementRole, ColumnElement[_T], Generic[_T]): self, key, value=..., - type_: Incomplete | None = ..., - unique: bool = ..., + type_: Incomplete | None = None, + unique: bool = False, required=..., - quote: Incomplete | None = ..., - callable_: Incomplete | None = ..., - expanding: bool = ..., - isoutparam: bool = ..., - literal_execute: bool = ..., - _compared_to_operator: Incomplete | None = ..., - _compared_to_type: Incomplete | None = ..., - _is_crud: bool = ..., + quote: Incomplete | None = None, + callable_: Incomplete | None = None, + expanding: bool = False, + isoutparam: bool = False, + literal_execute: bool = False, + _compared_to_operator: Incomplete | None = None, + _compared_to_type: Incomplete | None = None, + _is_crud: bool = False, ) -> None: ... @property def effective_value(self): ... @@ -144,7 +144,7 @@ class TextClause( def type(self): ... @property def comparator(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Null(SingletonConstant, roles.ConstExprRole, ColumnElement[None]): __visit_name__: str @@ -171,7 +171,7 @@ class ClauseList(roles.InElementRole, roles.OrderByRole, roles.ColumnsClauseRole def __iter__(self): ... def __len__(self) -> int: ... def append(self, clause) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class BooleanClauseList(ClauseList, ColumnElement[Any]): __visit_name__: str @@ -181,7 +181,7 @@ class BooleanClauseList(ClauseList, ColumnElement[Any]): def and_(cls, *clauses): ... @classmethod def or_(cls, *clauses): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... and_: Any or_: Any @@ -190,7 +190,7 @@ class Tuple(ClauseList, ColumnElement[Any]): __visit_name__: str type: Any def __init__(self, *clauses, **kw) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Case(ColumnElement[Any]): __visit_name__: str @@ -200,7 +200,7 @@ class Case(ColumnElement[Any]): else_: Any def __init__(self, *whens, **kw) -> None: ... -def literal_column(text, type_: Incomplete | None = ...): ... +def literal_column(text, type_: Incomplete | None = None): ... class Cast(WrapsColumnExpression, ColumnElement[Any]): __visit_name__: str @@ -220,7 +220,7 @@ class TypeCoerce(WrapsColumnExpression, ColumnElement[Any]): def typed_expression(self): ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Extract(ColumnElement[Any]): __visit_name__: str @@ -249,12 +249,12 @@ class UnaryExpression(ColumnElement[Any]): def __init__( self, element, - operator: Incomplete | None = ..., - modifier: Incomplete | None = ..., - type_: Incomplete | None = ..., - wraps_column_expression: bool = ..., + operator: Incomplete | None = None, + modifier: Incomplete | None = None, + type_: Incomplete | None = None, + wraps_column_expression: bool = False, ) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class CollectionAggregate(UnaryExpression): inherit_cache: bool @@ -272,7 +272,7 @@ class AsBoolean(WrapsColumnExpression, UnaryExpression): def __init__(self, element, operator, negate) -> None: ... @property def wrapped_column_expression(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class BinaryExpression(ColumnElement[Any]): __visit_name__: str @@ -287,15 +287,15 @@ class BinaryExpression(ColumnElement[Any]): left, right, operator, - type_: Incomplete | None = ..., - negate: Incomplete | None = ..., - modifiers: Incomplete | None = ..., + type_: Incomplete | None = None, + negate: Incomplete | None = None, + modifiers: Incomplete | None = None, ) -> None: ... def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... @property def is_comparison(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Slice(ColumnElement[Any]): __visit_name__: str @@ -303,15 +303,15 @@ class Slice(ColumnElement[Any]): stop: Any step: Any type: Any - def __init__(self, start, stop, step, _name: Incomplete | None = ...) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def __init__(self, start, stop, step, _name: Incomplete | None = None) -> None: ... + def self_group(self, against: Incomplete | None = None): ... class IndexExpression(BinaryExpression): inherit_cache: bool class GroupedElement(ClauseElement): __visit_name__: str - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... class Grouping(GroupedElement, ColumnElement[Any]): element: Any @@ -332,10 +332,10 @@ class Over(ColumnElement[Any]): def __init__( self, element, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ) -> None: ... def __reduce__(self): ... @memoized_property @@ -349,10 +349,10 @@ class WithinGroup(ColumnElement[Any]): def __reduce__(self): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ): ... @memoized_property def type(self): ... @@ -365,12 +365,12 @@ class FunctionFilter(ColumnElement[Any]): def filter(self, *criterion): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - range_: Incomplete | None = ..., - rows: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + range_: Incomplete | None = None, + rows: Incomplete | None = None, ): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @memoized_property def type(self): ... @@ -378,13 +378,13 @@ class Label(roles.LabeledColumnExprRole, ColumnElement[Any]): __visit_name__: str name: Any key: Any - def __init__(self, name, element, type_: Incomplete | None = ...) -> None: ... + def __init__(self, name, element, type_: Incomplete | None = None) -> None: ... def __reduce__(self): ... @memoized_property def type(self): ... @HasMemoized.memoized_attribute def element(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def primary_key(self): ... @property @@ -407,9 +407,9 @@ class ColumnClause(roles.DDLReferredColumnRole, roles.LabeledColumnExprRole, rol key: Any type: Any def __init__( - self, text, type_: Incomplete | None = ..., is_literal: bool = ..., _selectable: Incomplete | None = ... + self, text, type_: Incomplete | None = None, is_literal: bool = False, _selectable: Incomplete | None = None ) -> None: ... - def get_children(self, column_tables: bool = ..., **kw): ... # type: ignore[override] + def get_children(self, column_tables: bool = False, **kw): ... # type: ignore[override] @property def entity_namespace(self): ... @@ -459,7 +459,7 @@ class AnnotatedColumnElement(Annotated): def info(self): ... class _truncated_label(quoted_name): - def __new__(cls, value, quote: Incomplete | None = ...): ... + def __new__(cls, value, quote: Incomplete | None = None): ... def __reduce__(self): ... def apply_map(self, map_): ... @@ -467,7 +467,7 @@ class conv(_truncated_label): ... class _anonymous_label(_truncated_label): @classmethod - def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = ..., sanitize_key: bool = ...): ... + def safe_construct(cls, seed, body, enclosing_label: Incomplete | None = None, sanitize_key: bool = False): ... def __add__(self, other): ... def __radd__(self, other): ... def apply_map(self, map_): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi index 893dba2467b6..0f5bf12baa0a 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/functions.pyi @@ -7,15 +7,15 @@ from .elements import BinaryExpression, ColumnElement, NamedColumn from .selectable import FromClause, TableValuedAlias from .visitors import TraversibleType -def register_function(identifier, fn, package: str = ...) -> None: ... +def register_function(identifier, fn, package: str = "_default") -> None: ... class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): # type: ignore[misc] packagenames: Incomplete clause_expr: Incomplete def __init__(self, *clauses, **kwargs) -> None: ... - def scalar_table_valued(self, name, type_: Incomplete | None = ...): ... + def scalar_table_valued(self, name, type_: Incomplete | None = None): ... def table_valued(self, *expr, **kw): ... - def column_valued(self, name: str | None = ..., joins_implicitly: bool = ...): ... + def column_valued(self, name: str | None = None, joins_implicitly: bool = False): ... @property def columns(self): ... @property @@ -24,20 +24,20 @@ class FunctionElement(Executable, ColumnElement[Any], FromClause, Generative): def clauses(self): ... def over( self, - partition_by: Incomplete | None = ..., - order_by: Incomplete | None = ..., - rows: Incomplete | None = ..., - range_: Incomplete | None = ..., + partition_by: Incomplete | None = None, + order_by: Incomplete | None = None, + rows: Incomplete | None = None, + range_: Incomplete | None = None, ): ... def within_group(self, *order_by): ... def filter(self, *criterion): ... def as_comparison(self, left_index, right_index): ... def within_group_type(self, within_group) -> None: ... - def alias(self, name: str | None = ..., joins_implicitly: bool = ...) -> TableValuedAlias: ... # type: ignore[override] + def alias(self, name: str | None = None, joins_implicitly: bool = False) -> TableValuedAlias: ... # type: ignore[override] def select(self): ... def scalar(self): ... def execute(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def entity_namespace(self): ... @@ -66,7 +66,7 @@ class ScalarFunctionColumn(NamedColumn): fn: Incomplete name: Incomplete type: Incomplete - def __init__(self, fn, name, type_: Incomplete | None = ...) -> None: ... + def __init__(self, fn, name, type_: Incomplete | None = None) -> None: ... class _FunctionGenerator: opts: Incomplete @@ -143,7 +143,7 @@ class random(GenericFunction): class count(GenericFunction): type: Incomplete inherit_cache: bool - def __init__(self, expression: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, expression: Incomplete | None = None, **kwargs) -> None: ... class current_date(AnsiFunction): type: Incomplete diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi index b6ada6db4382..49c91eefc3c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi @@ -17,12 +17,12 @@ class LambdaOptions(Options): def lambda_stmt( lmb, - enable_tracking: bool = ..., - track_closure_variables: bool = ..., - track_on: Incomplete | None = ..., - global_track_bound_values: bool = ..., - track_bound_values: bool = ..., - lambda_cache: Incomplete | None = ..., + enable_tracking: bool = True, + track_closure_variables: bool = True, + track_on: Incomplete | None = None, + global_track_bound_values: bool = True, + track_bound_values: bool = True, + lambda_cache: Incomplete | None = None, ): ... class LambdaElement(elements.ClauseElement): @@ -32,22 +32,22 @@ class LambdaElement(elements.ClauseElement): role: Incomplete tracker_key: Incomplete opts: Incomplete - def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = ...) -> None: ... + def __init__(self, fn, role, opts=..., apply_propagate_attrs: Incomplete | None = None) -> None: ... def __getattr__(self, key: str): ... class DeferredLambdaElement(LambdaElement): lambda_args: Incomplete - def __init__(self, fn, role, opts=..., lambda_args=...) -> None: ... + def __init__(self, fn, role, opts=..., lambda_args=()) -> None: ... class StatementLambdaElement(roles.AllowsLambdaRole, LambdaElement): def __add__(self, other): ... def add_criteria( self, other, - enable_tracking: bool = ..., - track_on: Incomplete | None = ..., - track_closure_variables: bool = ..., - track_bound_values: bool = ..., + enable_tracking: bool = True, + track_on: Incomplete | None = None, + track_closure_variables: bool = True, + track_bound_values: bool = True, ): ... def spoil(self): ... @@ -105,9 +105,9 @@ class PyWrapper(ColumnOperators[_T], Generic[_T]): fn, name, to_evaluate, - closure_index: Incomplete | None = ..., - getter: Incomplete | None = ..., - track_bound_values: bool = ..., + closure_index: Incomplete | None = None, + getter: Incomplete | None = None, + track_bound_values: bool = True, ) -> None: ... def __call__(self, *arg, **kw): ... def operate(self, op, *other, **kwargs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi index abfafe7c2e63..cb91ff53553d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/operators.pyi @@ -11,8 +11,8 @@ class Operators: def __and__(self, other): ... def __or__(self, other): ... def __invert__(self): ... - def op(self, opstring, precedence: int = ..., is_comparison: bool = ..., return_type: Incomplete | None = ...): ... - def bool_op(self, opstring, precedence: int = ...): ... + def op(self, opstring, precedence: int = 0, is_comparison: bool = False, return_type: Incomplete | None = None): ... + def bool_op(self, opstring, precedence: int = 0): ... def operate(self, op, *other, **kwargs): ... def reverse_operate(self, op, other, **kwargs): ... @@ -27,11 +27,11 @@ class custom_op: def __init__( self, opstring, - precedence: int = ..., - is_comparison: bool = ..., - return_type: Incomplete | None = ..., - natural_self_precedent: bool = ..., - eager_grouping: bool = ..., + precedence: int = 0, + is_comparison: bool = False, + return_type: Incomplete | None = None, + natural_self_precedent: bool = False, + eager_grouping: bool = False, ) -> None: ... def __eq__(self, other): ... def __hash__(self) -> int: ... @@ -55,15 +55,15 @@ class ColumnOperators(Operators, Generic[_T]): def __lshift__(self, other) -> ColumnOperators[_T]: ... def __rshift__(self, other) -> ColumnOperators[_T]: ... def concat(self, other: _T | ColumnOperators[_T] | None) -> ColumnOperators[_T]: ... - def like(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def ilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... + def like(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def ilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... def in_(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... def not_in(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... def notin_(self, other: Container[_T] | Iterable[_T]) -> ColumnOperators[_T]: ... - def not_like(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def notlike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def not_ilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... - def notilike(self, other: _T, escape: str | None = ...) -> ColumnOperators[_T]: ... + def not_like(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def notlike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def not_ilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... + def notilike(self, other: _T, escape: str | None = None) -> ColumnOperators[_T]: ... def is_(self, other: _T) -> ColumnOperators[_T]: ... def is_not(self, other: _T) -> ColumnOperators[_T]: ... def isnot(self, other: _T) -> ColumnOperators[_T]: ... @@ -71,8 +71,8 @@ class ColumnOperators(Operators, Generic[_T]): def endswith(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def contains(self, other: str, **kwargs) -> ColumnOperators[_T]: ... def match(self, other: str, **kwargs) -> ColumnOperators[_T]: ... - def regexp_match(self, pattern, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... - def regexp_replace(self, pattern, replacement, flags: Incomplete | None = ...) -> ColumnOperators[_T]: ... + def regexp_match(self, pattern, flags: Incomplete | None = None) -> ColumnOperators[_T]: ... + def regexp_replace(self, pattern, replacement, flags: Incomplete | None = None) -> ColumnOperators[_T]: ... def desc(self) -> ColumnOperators[_T]: ... def asc(self) -> ColumnOperators[_T]: ... def nulls_first(self) -> ColumnOperators[_T]: ... @@ -85,7 +85,7 @@ class ColumnOperators(Operators, Generic[_T]): def __rmul__(self, other) -> ColumnOperators[_T]: ... def __rdiv__(self, other) -> ColumnOperators[_T]: ... def __rmod__(self, other) -> ColumnOperators[_T]: ... - def between(self, cleft, cright, symmetric: bool = ...) -> ColumnOperators[_T]: ... + def between(self, cleft, cright, symmetric: bool = False) -> ColumnOperators[_T]: ... def distinct(self) -> ColumnOperators[_T]: ... def any_(self) -> ColumnOperators[_T]: ... def all_(self) -> ColumnOperators[_T]: ... @@ -123,18 +123,18 @@ isnot = is_not def collate(a, b): ... def op(a, opstring, b): ... -def like_op(a, b, escape: Incomplete | None = ...): ... -def not_like_op(a, b, escape: Incomplete | None = ...): ... +def like_op(a, b, escape: Incomplete | None = None): ... +def not_like_op(a, b, escape: Incomplete | None = None): ... notlike_op = not_like_op -def ilike_op(a, b, escape: Incomplete | None = ...): ... -def not_ilike_op(a, b, escape: Incomplete | None = ...): ... +def ilike_op(a, b, escape: Incomplete | None = None): ... +def not_ilike_op(a, b, escape: Incomplete | None = None): ... notilike_op = not_ilike_op -def between_op(a, b, c, symmetric: bool = ...): ... -def not_between_op(a, b, c, symmetric: bool = ...): ... +def between_op(a, b, c, symmetric: bool = False): ... +def not_between_op(a, b, c, symmetric: bool = False): ... notbetween_op = not_between_op @@ -146,25 +146,25 @@ notin_op = not_in_op def distinct_op(a): ... def any_op(a): ... def all_op(a): ... -def startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_startswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def startswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_startswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notstartswith_op = not_startswith_op -def endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_endswith_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def endswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_endswith_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notendswith_op = not_endswith_op -def contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... -def not_contains_op(a, b, escape: Incomplete | None = ..., autoescape: bool = ...): ... +def contains_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... +def not_contains_op(a, b, escape: Incomplete | None = None, autoescape: bool = False): ... notcontains_op = not_contains_op def match_op(a, b, **kw): ... -def regexp_match_op(a, b, flags: Incomplete | None = ...): ... -def not_regexp_match_op(a, b, flags: Incomplete | None = ...): ... -def regexp_replace_op(a, b, replacement, flags: Incomplete | None = ...): ... +def regexp_match_op(a, b, flags: Incomplete | None = None): ... +def not_regexp_match_op(a, b, flags: Incomplete | None = None): ... +def regexp_replace_op(a, b, replacement, flags: Incomplete | None = None): ... def not_match_op(a, b, **kw): ... notmatch_op = not_match_op diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index 55dcfe560ee3..2b5dac32c7fa 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -30,13 +30,13 @@ class Table(DialectKWArgs, SchemaItem, TableClause): @property def bind(self): ... def add_is_dependent_on(self, table) -> None: ... - def append_column(self, column, replace_existing: bool = ...) -> None: ... # type: ignore[override] + def append_column(self, column, replace_existing: bool = False) -> None: ... # type: ignore[override] def append_constraint(self, constraint) -> None: ... - def exists(self, bind: Incomplete | None = ...): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... - def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = ..., name: Incomplete | None = ...): ... + def exists(self, bind: Incomplete | None = None): ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def tometadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = None, name: Incomplete | None = None): ... + def to_metadata(self, metadata, schema=..., referred_schema_fn: Incomplete | None = None, name: Incomplete | None = None): ... class Column(DialectKWArgs, SchemaItem, ColumnClause): __visit_name__: str @@ -80,20 +80,20 @@ class ForeignKey(DialectKWArgs, SchemaItem): def __init__( self, column, - _constraint: Incomplete | None = ..., - use_alter: bool = ..., - name: Incomplete | None = ..., - onupdate: Incomplete | None = ..., - ondelete: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - link_to_name: bool = ..., - match: Incomplete | None = ..., - info: Incomplete | None = ..., - _unresolvable: bool = ..., + _constraint: Incomplete | None = None, + use_alter: bool = False, + name: Incomplete | None = None, + onupdate: Incomplete | None = None, + ondelete: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + link_to_name: bool = False, + match: Incomplete | None = None, + info: Incomplete | None = None, + _unresolvable: bool = False, **dialect_kw, ) -> None: ... - def copy(self, schema: Incomplete | None = ..., **kw): ... + def copy(self, schema: Incomplete | None = None, **kw): ... @property def target_fullname(self): ... def references(self, table): ... @@ -107,8 +107,8 @@ class DefaultGenerator(Executable, SchemaItem): is_server_default: bool column: Any for_update: Any - def __init__(self, for_update: bool = ...) -> None: ... - def execute(self, bind: Incomplete | None = ...): ... # type: ignore[override] + def __init__(self, for_update: bool = False) -> None: ... + def execute(self, bind: Incomplete | None = None): ... # type: ignore[override] @property def bind(self): ... @@ -134,15 +134,15 @@ class IdentityOptions: order: Any def __init__( self, - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, ) -> None: ... class Sequence(IdentityOptions, DefaultGenerator): @@ -156,22 +156,22 @@ class Sequence(IdentityOptions, DefaultGenerator): def __init__( self, name, - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - schema: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., - data_type: Incomplete | None = ..., - optional: bool = ..., - quote: Incomplete | None = ..., - metadata: Incomplete | None = ..., - quote_schema: Incomplete | None = ..., - for_update: bool = ..., + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + schema: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, + data_type: Incomplete | None = None, + optional: bool = False, + quote: Incomplete | None = None, + metadata: Incomplete | None = None, + quote_schema: Incomplete | None = None, + for_update: bool = False, ) -> None: ... @memoized_property def is_callable(self): ... @@ -180,8 +180,8 @@ class Sequence(IdentityOptions, DefaultGenerator): def next_value(self): ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = True) -> None: ... class FetchedValue(SchemaEventTarget): is_server_default: bool @@ -189,13 +189,13 @@ class FetchedValue(SchemaEventTarget): has_argument: bool is_clause_element: bool for_update: Any - def __init__(self, for_update: bool = ...) -> None: ... + def __init__(self, for_update: bool = False) -> None: ... class DefaultClause(FetchedValue): has_argument: bool arg: Any reflected: Any - def __init__(self, arg, for_update: bool = ..., _reflected: bool = ...) -> None: ... + def __init__(self, arg, for_update: bool = False, _reflected: bool = False) -> None: ... class Constraint(DialectKWArgs, SchemaItem): __visit_name__: str @@ -205,12 +205,12 @@ class Constraint(DialectKWArgs, SchemaItem): info: Any def __init__( self, - name: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - _create_rule: Incomplete | None = ..., - info: Incomplete | None = ..., - _type_bound: bool = ..., + name: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + _create_rule: Incomplete | None = None, + info: Incomplete | None = None, + _type_bound: bool = False, **dialect_kw, ) -> None: ... @property @@ -225,7 +225,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): def __init__(self, *columns, **kw) -> None: ... columns: Any def __contains__(self, x): ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = None, **kw): ... def contains_column(self, col): ... def __iter__(self): ... def __len__(self) -> int: ... @@ -236,19 +236,19 @@ class CheckConstraint(ColumnCollectionConstraint): def __init__( self, sqltext, - name: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - table: Incomplete | None = ..., - info: Incomplete | None = ..., - _create_rule: Incomplete | None = ..., - _autoattach: bool = ..., - _type_bound: bool = ..., + name: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + table: Incomplete | None = None, + info: Incomplete | None = None, + _create_rule: Incomplete | None = None, + _autoattach: bool = True, + _type_bound: bool = False, **kw, ) -> None: ... @property def is_column_level(self): ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def copy(self, target_table: Incomplete | None = None, **kw): ... class ForeignKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -262,16 +262,16 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): self, columns, refcolumns, - name: Incomplete | None = ..., - onupdate: Incomplete | None = ..., - ondelete: Incomplete | None = ..., - deferrable: Incomplete | None = ..., - initially: Incomplete | None = ..., - use_alter: bool = ..., - link_to_name: bool = ..., - match: Incomplete | None = ..., - table: Incomplete | None = ..., - info: Incomplete | None = ..., + name: Incomplete | None = None, + onupdate: Incomplete | None = None, + ondelete: Incomplete | None = None, + deferrable: Incomplete | None = None, + initially: Incomplete | None = None, + use_alter: bool = False, + link_to_name: bool = False, + match: Incomplete | None = None, + table: Incomplete | None = None, + info: Incomplete | None = None, **dialect_kw, ) -> None: ... columns: Any @@ -279,7 +279,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint): def referred_table(self): ... @property def column_keys(self): ... - def copy(self, schema: Incomplete | None = ..., target_table: Incomplete | None = ..., **kw): ... # type: ignore[override] + def copy(self, schema: Incomplete | None = None, target_table: Incomplete | None = None, **kw): ... # type: ignore[override] class PrimaryKeyConstraint(ColumnCollectionConstraint): __visit_name__: str @@ -300,8 +300,8 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): def __init__(self, name, *expressions, **kw) -> None: ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...): ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False): ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... DEFAULT_NAMING_CONVENTION: Any @@ -313,11 +313,11 @@ class MetaData(SchemaItem): info: Any def __init__( self, - bind: Incomplete | None = ..., - schema: Incomplete | None = ..., - quote_schema: Incomplete | None = ..., - naming_convention: Incomplete | None = ..., - info: Incomplete | None = ..., + bind: Incomplete | None = None, + schema: Incomplete | None = None, + quote_schema: Incomplete | None = None, + naming_convention: Incomplete | None = None, + info: Incomplete | None = None, ) -> None: ... def __contains__(self, table_or_key) -> bool: ... def is_bound(self): ... @@ -328,17 +328,17 @@ class MetaData(SchemaItem): def sorted_tables(self): ... def reflect( self, - bind: Incomplete | None = ..., - schema: Incomplete | None = ..., - views: bool = ..., - only: Incomplete | None = ..., - extend_existing: bool = ..., - autoload_replace: bool = ..., - resolve_fks: bool = ..., + bind: Incomplete | None = None, + schema: Incomplete | None = None, + views: bool = False, + only: Incomplete | None = None, + extend_existing: bool = False, + autoload_replace: bool = True, + resolve_fks: bool = True, **dialect_kwargs, ) -> None: ... - def create_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop_all(self, bind: Incomplete | None = ..., tables: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create_all(self, bind: Incomplete | None = None, tables: Incomplete | None = None, checkfirst: bool = True) -> None: ... + def drop_all(self, bind: Incomplete | None = None, tables: Incomplete | None = None, checkfirst: bool = True) -> None: ... class ThreadLocalMetaData(MetaData): __visit_name__: str @@ -353,8 +353,8 @@ class Computed(FetchedValue, SchemaItem): sqltext: Any persisted: Any column: Any - def __init__(self, sqltext, persisted: Incomplete | None = ...) -> None: ... - def copy(self, target_table: Incomplete | None = ..., **kw): ... + def __init__(self, sqltext, persisted: Incomplete | None = None) -> None: ... + def copy(self, target_table: Incomplete | None = None, **kw): ... class Identity(IdentityOptions, FetchedValue, SchemaItem): __visit_name__: str @@ -363,16 +363,16 @@ class Identity(IdentityOptions, FetchedValue, SchemaItem): column: Any def __init__( self, - always: bool = ..., - on_null: Incomplete | None = ..., - start: Incomplete | None = ..., - increment: Incomplete | None = ..., - minvalue: Incomplete | None = ..., - maxvalue: Incomplete | None = ..., - nominvalue: Incomplete | None = ..., - nomaxvalue: Incomplete | None = ..., - cycle: Incomplete | None = ..., - cache: Incomplete | None = ..., - order: Incomplete | None = ..., + always: bool = False, + on_null: Incomplete | None = None, + start: Incomplete | None = None, + increment: Incomplete | None = None, + minvalue: Incomplete | None = None, + maxvalue: Incomplete | None = None, + nominvalue: Incomplete | None = None, + nomaxvalue: Incomplete | None = None, + cycle: Incomplete | None = None, + cache: Incomplete | None = None, + order: Incomplete | None = None, ) -> None: ... def copy(self, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index 4d0bcbfa1587..6553f2fcd419 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -33,9 +33,9 @@ class ReturnsRows(roles.ReturnsRowsRole, ClauseElement): class Selectable(ReturnsRows): __visit_name__: str is_selectable: bool - def lateral(self, name: Incomplete | None = ...): ... + def lateral(self, name: Incomplete | None = None): ... def replace_selectable(self, old, alias): ... - def corresponding_column(self, column, require_embedded: bool = ...): ... + def corresponding_column(self, column, require_embedded: bool = False): ... class HasPrefixes: def prefix_with(self: Self, *expr, **kw) -> Self: ... @@ -44,20 +44,20 @@ class HasSuffixes: def suffix_with(self: Self, *expr, **kw) -> Self: ... class HasHints: - def with_statement_hint(self, text, dialect_name: str = ...): ... - def with_hint(self: Self, selectable, text: str, dialect_name: str = ...) -> Self: ... + def with_statement_hint(self, text, dialect_name: str = "*"): ... + def with_hint(self: Self, selectable, text: str, dialect_name: str = "*") -> Self: ... class FromClause(roles.AnonymizedFromClauseRole, Selectable): __visit_name__: str named_with_column: bool schema: Any is_selectable: bool - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... - def join(self, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...): ... - def outerjoin(self, right, onclause: Incomplete | None = ..., full: bool = ...): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... + def join(self, right, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False): ... + def outerjoin(self, right, onclause: Incomplete | None = None, full: bool = False): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... def table_valued(self): ... - def tablesample(self, sampling, name: Incomplete | None = ..., seed: Incomplete | None = ...): ... + def tablesample(self, sampling, name: Incomplete | None = None, seed: Incomplete | None = None): ... def is_derived_from(self, fromclause): ... @property def description(self): ... @@ -86,15 +86,15 @@ class Join(roles.DMLTableRole, FromClause): onclause: Any isouter: Any full: Any - def __init__(self, left, right, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> None: ... + def __init__(self, left, right, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> None: ... @property def description(self): ... def is_derived_from(self, fromclause): ... - def self_group(self, against: Incomplete | None = ...): ... - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def self_group(self, against: Incomplete | None = None): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... @property def bind(self): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... class NoInit: def __init__(self, *arg, **kw) -> None: ... @@ -125,9 +125,9 @@ class TableValuedAlias(Alias): ) -> None: ... @HasMemoized.memoized_attribute def column(self): ... - def alias(self, name: Incomplete | None = ...): ... # type: ignore[override] - def lateral(self, name: Incomplete | None = ...): ... - def render_derived(self, name: Incomplete | None = ..., with_types: bool = ...): ... + def alias(self, name: Incomplete | None = None): ... # type: ignore[override] + def lateral(self, name: Incomplete | None = None): ... + def render_derived(self, name: Incomplete | None = None, with_types: bool = False): ... class Lateral(AliasedReturnsRows): __visit_name__: str @@ -138,13 +138,13 @@ class TableSample(AliasedReturnsRows): class CTE(roles.DMLTableRole, roles.IsCTERole, Generative, HasPrefixes, HasSuffixes, AliasedReturnsRows): __visit_name__: str - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... def union(self, *other): ... def union_all(self, *other): ... class HasCTE(roles.HasCTERole): def add_cte(self, cte) -> None: ... - def cte(self, name: Incomplete | None = ..., recursive: bool = ..., nesting: bool = ...): ... + def cte(self, name: Incomplete | None = None, recursive: bool = False, nesting: bool = False): ... class Subquery(AliasedReturnsRows): __visit_name__: str @@ -176,9 +176,9 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause): @memoized_property def description(self): ... def append_column(self, c, **kw) -> None: ... - def insert(self, values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... - def update(self, whereclause: Incomplete | None = ..., values: Incomplete | None = ..., inline: bool = ..., **kwargs): ... - def delete(self, whereclause: Incomplete | None = ..., **kwargs): ... + def insert(self, values: Incomplete | None = None, inline: bool = False, **kwargs): ... + def update(self, whereclause: Incomplete | None = None, values: Incomplete | None = None, inline: bool = False, **kwargs): ... + def delete(self, whereclause: Incomplete | None = None, **kwargs): ... class ForUpdateArg(ClauseElement): def __eq__(self, other): ... @@ -190,7 +190,12 @@ class ForUpdateArg(ClauseElement): key_share: Any of: Any def __init__( - self, nowait: bool = ..., read: bool = ..., of: Incomplete | None = ..., skip_locked: bool = ..., key_share: bool = ... + self, + nowait: bool = False, + read: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> None: ... class Values(Generative, FromClause): @@ -200,7 +205,7 @@ class Values(Generative, FromClause): literal_binds: Any def __init__(self, *columns, **kw) -> None: ... def alias(self: Self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] - def lateral(self: Self, name: Incomplete | None = ...) -> Self: ... + def lateral(self: Self, name: Incomplete | None = None) -> Self: ... def data(self: Self, values) -> Self: ... class SelectBase( @@ -227,9 +232,9 @@ class SelectBase( def exists(self): ... def scalar_subquery(self): ... def label(self, name): ... - def lateral(self, name: Incomplete | None = ...): ... - def subquery(self, name: Incomplete | None = ...): ... - def alias(self, name: Incomplete | None = ..., flat: bool = ...): ... + def lateral(self, name: Incomplete | None = None): ... + def subquery(self, name: Incomplete | None = None): ... + def alias(self, name: Incomplete | None = None, flat: bool = False): ... class SelectStatementGrouping(GroupedElement, SelectBase): __visit_name__: str @@ -239,7 +244,7 @@ class SelectStatementGrouping(GroupedElement, SelectBase): def set_label_style(self, label_style): ... @property def select_statement(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... @property def selected_columns(self): ... @@ -251,26 +256,26 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): def __init__( self, _label_style=..., - use_labels: bool = ..., - limit: Incomplete | None = ..., - offset: Incomplete | None = ..., - order_by: Incomplete | None = ..., - group_by: Incomplete | None = ..., - bind: Incomplete | None = ..., + use_labels: bool = False, + limit: Incomplete | None = None, + offset: Incomplete | None = None, + order_by: Incomplete | None = None, + group_by: Incomplete | None = None, + bind: Incomplete | None = None, ) -> None: ... def with_for_update( self: Self, - nowait: bool = ..., - read: bool = ..., - of: Incomplete | None = ..., - skip_locked: bool = ..., - key_share: bool = ..., + nowait: bool = False, + read: bool = False, + of: Incomplete | None = None, + skip_locked: bool = False, + key_share: bool = False, ) -> Self: ... def get_label_style(self): ... def set_label_style(self, style): ... def apply_labels(self): ... def limit(self: Self, limit: Incomplete | None) -> Self: ... - def fetch(self: Self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ... + def fetch(self: Self, count: Incomplete | None, with_ties: bool = False, percent: bool = False) -> Self: ... def offset(self: Self, offset: Incomplete | None) -> Self: ... def slice(self: Self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... def order_by(self: Self, *clauses) -> Self: ... @@ -289,7 +294,7 @@ class CompoundSelect(HasCompileState, GenerativeSelect): keyword: Any selects: Any def __init__(self, keyword, *selects, **kwargs) -> None: ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def is_derived_from(self, fromclause): ... @property def selected_columns(self): ... @@ -336,14 +341,14 @@ class Select( @classmethod def create_legacy_select( cls, - columns: Incomplete | None = ..., - whereclause: Incomplete | None = ..., - from_obj: Incomplete | None = ..., - distinct: bool = ..., - having: Incomplete | None = ..., - correlate: bool = ..., - prefixes: Incomplete | None = ..., - suffixes: Incomplete | None = ..., + columns: Incomplete | None = None, + whereclause: Incomplete | None = None, + from_obj: Incomplete | None = None, + distinct: bool = False, + having: Incomplete | None = None, + correlate: bool = True, + prefixes: Incomplete | None = None, + suffixes: Incomplete | None = None, **kwargs, ): ... def __init__(self) -> None: ... @@ -352,12 +357,12 @@ class Select( @property def column_descriptions(self): ... def from_statement(self, statement): ... - def join(self: Self, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ...) -> Self: ... - def outerjoin_from(self, from_, target, onclause: Incomplete | None = ..., full: bool = ...): ... + def join(self: Self, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... + def outerjoin_from(self, from_, target, onclause: Incomplete | None = None, full: bool = False): ... def join_from( - self: Self, from_, target, onclause: Incomplete | None = ..., isouter: bool = ..., full: bool = ... + self: Self, from_, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False ) -> Self: ... - def outerjoin(self, target, onclause: Incomplete | None = ..., full: bool = ...): ... + def outerjoin(self, target, onclause: Incomplete | None = None, full: bool = False): ... def get_final_froms(self): ... @property def froms(self): ... @@ -369,7 +374,7 @@ class Select( def get_children(self, **kwargs): ... def add_columns(self: Self, *columns) -> Self: ... def column(self, column): ... - def reduce_columns(self, only_synonyms: bool = ...): ... + def reduce_columns(self, only_synonyms: bool = True): ... def with_only_columns(self: Self, *columns, **kw) -> Self: ... @property def whereclause(self): ... @@ -381,7 +386,7 @@ class Select( def correlate_except(self: Self, *fromclauses) -> Self: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def self_group(self, against: Incomplete | None = ...): ... + def self_group(self, against: Incomplete | None = None): ... def union(self, *other, **kwargs): ... def union_all(self, *other, **kwargs): ... def except_(self, *other, **kwargs): ... @@ -410,7 +415,7 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping): class Exists(UnaryExpression): inherit_cache: bool def __init__(self, *args, **kwargs) -> None: ... - def select(self, whereclause: Incomplete | None = ..., **kwargs): ... + def select(self, whereclause: Incomplete | None = None, **kwargs): ... def correlate(self, *fromclause): ... def correlate_except(self, *fromclause): ... def select_from(self, *froms): ... @@ -423,7 +428,7 @@ class TextualSelect(SelectBase): element: Any column_args: Any positional: Any - def __init__(self, text, columns, positional: bool = ...) -> None: ... + def __init__(self, text, columns, positional: bool = False) -> None: ... @HasMemoized.memoized_attribute def selected_columns(self): ... def bindparams(self: Self, *binds, **bind_as_values) -> Self: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index 72f482b65870..2538111c3620 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -38,12 +38,12 @@ class String(Concatenable, TypeEngine): collation: Any def __init__( self, - length: Incomplete | None = ..., - collation: Incomplete | None = ..., - convert_unicode: bool = ..., - unicode_error: Incomplete | None = ..., - _warn_on_bytestring: bool = ..., - _expect_unicode: bool = ..., + length: Incomplete | None = None, + collation: Incomplete | None = None, + convert_unicode: bool = False, + unicode_error: Incomplete | None = None, + _warn_on_bytestring: bool = False, + _expect_unicode: bool = False, ) -> None: ... def literal_processor(self, dialect): ... def bind_processor(self, dialect): ... @@ -57,11 +57,11 @@ class Text(String): class Unicode(String): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class UnicodeText(Text): __visit_name__: str - def __init__(self, length: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, length: Incomplete | None = None, **kwargs) -> None: ... class Integer(_LookupExpressionAdapter, TypeEngine): __visit_name__: str @@ -84,10 +84,10 @@ class Numeric(_LookupExpressionAdapter, TypeEngine): asdecimal: Any def __init__( self, - precision: Incomplete | None = ..., - scale: Incomplete | None = ..., - decimal_return_scale: Incomplete | None = ..., - asdecimal: bool = ..., + precision: Incomplete | None = None, + scale: Incomplete | None = None, + decimal_return_scale: Incomplete | None = None, + asdecimal: bool = True, ) -> None: ... def get_dbapi_type(self, dbapi): ... def literal_processor(self, dialect): ... @@ -103,14 +103,14 @@ class Float(Numeric): asdecimal: Any decimal_return_scale: Any def __init__( - self, precision: Incomplete | None = ..., asdecimal: bool = ..., decimal_return_scale: Incomplete | None = ... + self, precision: Incomplete | None = None, asdecimal: bool = False, decimal_return_scale: Incomplete | None = None ) -> None: ... def result_processor(self, dialect, coltype): ... class DateTime(_LookupExpressionAdapter, TypeEngine): __visit_name__: str timezone: Any - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... @property def python_type(self): ... @@ -124,14 +124,14 @@ class Date(_LookupExpressionAdapter, TypeEngine): class Time(_LookupExpressionAdapter, TypeEngine): __visit_name__: str timezone: Any - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... @property def python_type(self): ... class _Binary(TypeEngine): length: Any - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... def literal_processor(self, dialect): ... @property def python_type(self): ... @@ -142,7 +142,7 @@ class _Binary(TypeEngine): class LargeBinary(_Binary): __visit_name__: str - def __init__(self, length: Incomplete | None = ...) -> None: ... + def __init__(self, length: Incomplete | None = None) -> None: ... class SchemaType(SchemaEventTarget): name: Any @@ -151,19 +151,19 @@ class SchemaType(SchemaEventTarget): inherit_schema: Any def __init__( self, - name: Incomplete | None = ..., - schema: Incomplete | None = ..., - metadata: Incomplete | None = ..., - inherit_schema: bool = ..., - quote: Incomplete | None = ..., - _create_events: bool = ..., + name: Incomplete | None = None, + schema: Incomplete | None = None, + metadata: Incomplete | None = None, + inherit_schema: bool = False, + quote: Incomplete | None = None, + _create_events: bool = True, ) -> None: ... def copy(self, **kw): ... def adapt(self, impltype, **kw): ... @property def bind(self): ... - def create(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Incomplete | None = ..., checkfirst: bool = ...) -> None: ... + def create(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... + def drop(self, bind: Incomplete | None = None, checkfirst: bool = False) -> None: ... class Enum(Emulated, String, SchemaType): __visit_name__: str @@ -175,7 +175,7 @@ class Enum(Emulated, String, SchemaType): class Comparator(Concatenable.Comparator[Any]): ... comparator_factory: Any - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... def adapt_to_emulated(self, impltype, **kw): ... def adapt(self, impltype, **kw): ... def literal_processor(self, dialect): ... @@ -192,7 +192,7 @@ class PickleType(TypeDecorator): pickler: Any comparator: Any def __init__( - self, protocol=..., pickler: Incomplete | None = ..., comparator: Incomplete | None = ..., impl: Incomplete | None = ... + self, protocol=5, pickler: Incomplete | None = None, comparator: Incomplete | None = None, impl: Incomplete | None = None ) -> None: ... def __reduce__(self): ... def bind_processor(self, dialect): ... @@ -204,7 +204,7 @@ class Boolean(Emulated, TypeEngine, SchemaType): # type: ignore[misc] native: bool create_constraint: Any name: Any - def __init__(self, create_constraint: bool = ..., name: Incomplete | None = ..., _create_events: bool = ...) -> None: ... + def __init__(self, create_constraint: bool = False, name: Incomplete | None = None, _create_events: bool = True) -> None: ... @property def python_type(self): ... def literal_processor(self, dialect): ... @@ -222,7 +222,7 @@ class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc second_precision: Any day_precision: Any def __init__( - self, native: bool = ..., second_precision: Incomplete | None = ..., day_precision: Incomplete | None = ... + self, native: bool = True, second_precision: Incomplete | None = None, day_precision: Incomplete | None = None ) -> None: ... @property def python_type(self): ... @@ -235,7 +235,7 @@ class JSON(Indexable, TypeEngine): hashable: bool NULL: Any none_as_null: Any - def __init__(self, none_as_null: bool = ...) -> None: ... + def __init__(self, none_as_null: bool = False) -> None: ... class JSONElementType(TypeEngine): def string_bind_processor(self, dialect): ... @@ -253,7 +253,7 @@ class JSON(Indexable, TypeEngine): def as_string(self): ... def as_integer(self): ... def as_float(self): ... - def as_numeric(self, precision, scale, asdecimal: bool = ...): ... + def as_numeric(self, precision, scale, asdecimal: bool = True): ... def as_json(self): ... comparator_factory: Any @property @@ -271,14 +271,14 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): class Comparator(Indexable.Comparator[_T], Concatenable.Comparator[_T], Generic[_T]): def contains(self, *arg, **kw) -> ColumnOperators[_T]: ... - def any(self, other, operator: Incomplete | None = ...): ... - def all(self, other, operator: Incomplete | None = ...): ... + def any(self, other, operator: Incomplete | None = None): ... + def all(self, other, operator: Incomplete | None = None): ... comparator_factory: Any item_type: Any as_tuple: Any dimensions: Any def __init__( - self, item_type, as_tuple: bool = ..., dimensions: Incomplete | None = ..., zero_indexes: bool = ... + self, item_type, as_tuple: bool = False, dimensions: Incomplete | None = None, zero_indexes: bool = False ) -> None: ... @property def hashable(self): ... @@ -316,7 +316,7 @@ class BIGINT(BigInteger): class TIMESTAMP(DateTime): __visit_name__: str - def __init__(self, timezone: bool = ...) -> None: ... + def __init__(self, timezone: bool = False) -> None: ... def get_dbapi_type(self, dbapi): ... class DATETIME(DateTime): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi index 5742b4dc1037..391287e827c8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/traversals.pyi @@ -151,7 +151,7 @@ class TraversalComparatorStrategy(InternalTraversal, MemoizedSlots): def compare_bindparam(self, left, right, **kw): ... class ColIdentityComparatorStrategy(TraversalComparatorStrategy): - def compare_column_element(self, left, right, use_proxies: bool = ..., equivalents=..., **kw): ... + def compare_column_element(self, left, right, use_proxies: bool = True, equivalents=(), **kw): ... def compare_column(self, left, right, **kw): ... def compare_label(self, left, right, **kw): ... def compare_table(self, left, right, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index 214d79e672c9..265b178689c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -46,11 +46,11 @@ class TypeEngine(Traversible): @property def python_type(self) -> None: ... def with_variant(self, type_, dialect_name): ... - def as_generic(self, allow_nulltype: bool = ...): ... + def as_generic(self, allow_nulltype: bool = False): ... def dialect_impl(self, dialect): ... def adapt(self, cls, **kw): ... def coerce_compared_value(self, op, value): ... - def compile(self, dialect: Incomplete | None = ...): ... + def compile(self, dialect: Incomplete | None = None): ... class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi index 8bf4c57f94a0..50e9b145af1f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/util.pyi @@ -11,11 +11,11 @@ def find_left_clause_to_join_from(clauses, join_to, onclause): ... def visit_binary_product(fn, expr) -> None: ... def find_tables( clause, - check_columns: bool = ..., - include_aliases: bool = ..., - include_joins: bool = ..., - include_selects: bool = ..., - include_crud: bool = ..., + check_columns: bool = False, + include_aliases: bool = False, + include_joins: bool = False, + include_selects: bool = False, + include_crud: bool = False, ): ... def unwrap_order_by(clause): ... def unwrap_label_reference(element): ... @@ -35,23 +35,23 @@ class _repr_base: class _repr_row(_repr_base): row: Any max_chars: Any - def __init__(self, row, max_chars: int = ...) -> None: ... + def __init__(self, row, max_chars: int = 300) -> None: ... class _repr_params(_repr_base): params: Any ismulti: Any batches: Any max_chars: Any - def __init__(self, params, batches, max_chars: int = ..., ismulti: Incomplete | None = ...) -> None: ... + def __init__(self, params, batches, max_chars: int = 300, ismulti: Incomplete | None = None) -> None: ... def adapt_criterion_to_null(crit, nulls): ... -def splice_joins(left, right, stop_on: Incomplete | None = ...): ... +def splice_joins(left, right, stop_on: Incomplete | None = None): ... def reduce_columns(columns, *clauses, **kw): ... def criterion_as_pairs( expression, - consider_as_foreign_keys: Incomplete | None = ..., - consider_as_referenced_keys: Incomplete | None = ..., - any_operator: bool = ..., + consider_as_foreign_keys: Incomplete | None = None, + consider_as_referenced_keys: Incomplete | None = None, + any_operator: bool = False, ): ... class ClauseAdapter(visitors.ReplacingExternalTraversal): @@ -65,14 +65,14 @@ class ClauseAdapter(visitors.ReplacingExternalTraversal): def __init__( self, selectable, - equivalents: Incomplete | None = ..., - include_fn: Incomplete | None = ..., - exclude_fn: Incomplete | None = ..., - adapt_on_names: bool = ..., - anonymize_labels: bool = ..., - adapt_from_selectables: Incomplete | None = ..., + equivalents: Incomplete | None = None, + include_fn: Incomplete | None = None, + exclude_fn: Incomplete | None = None, + adapt_on_names: bool = False, + anonymize_labels: bool = False, + adapt_from_selectables: Incomplete | None = None, ) -> None: ... - def replace(self, col, _include_singleton_constants: bool = ...): ... + def replace(self, col, _include_singleton_constants: bool = False): ... class ColumnAdapter(ClauseAdapter): columns: Any @@ -81,14 +81,14 @@ class ColumnAdapter(ClauseAdapter): def __init__( self, selectable, - equivalents: Incomplete | None = ..., - adapt_required: bool = ..., - include_fn: Incomplete | None = ..., - exclude_fn: Incomplete | None = ..., - adapt_on_names: bool = ..., - allow_label_resolve: bool = ..., - anonymize_labels: bool = ..., - adapt_from_selectables: Incomplete | None = ..., + equivalents: Incomplete | None = None, + adapt_required: bool = False, + include_fn: Incomplete | None = None, + exclude_fn: Incomplete | None = None, + adapt_on_names: bool = False, + allow_label_resolve: bool = True, + anonymize_labels: bool = False, + adapt_from_selectables: Incomplete | None = None, ) -> None: ... class _IncludeExcludeMapping: diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi index 398dee26ef9a..e8378c67ddc0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/visitors.pyi @@ -5,7 +5,7 @@ class TraversibleType(type): class Traversible(metaclass=TraversibleType): def __class_getitem__(cls, key): ... - def get_children(self, omit_attrs=..., **kw): ... + def get_children(self, omit_attrs=(), **kw): ... class _InternalTraversalType(type): def __init__(cls, clsname, bases, clsdict) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi index 0594d15506d1..e0e5f2bfa40d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertions.pyi @@ -9,27 +9,27 @@ def emits_warning_on(db, *messages): ... def uses_deprecated(*messages): ... def global_cleanup_assertions() -> None: ... def int_within_variance(expected, received, variance) -> None: ... -def eq_regex(a, b, msg: Incomplete | None = ...) -> None: ... -def eq_(a, b, msg: Incomplete | None = ...) -> None: ... -def ne_(a, b, msg: Incomplete | None = ...) -> None: ... -def le_(a, b, msg: Incomplete | None = ...) -> None: ... -def is_instance_of(a, b, msg: Incomplete | None = ...) -> None: ... -def is_none(a, msg: Incomplete | None = ...) -> None: ... -def is_not_none(a, msg: Incomplete | None = ...) -> None: ... -def is_true(a, msg: Incomplete | None = ...) -> None: ... -def is_false(a, msg: Incomplete | None = ...) -> None: ... -def is_(a, b, msg: Incomplete | None = ...) -> None: ... -def is_not(a, b, msg: Incomplete | None = ...) -> None: ... +def eq_regex(a, b, msg: Incomplete | None = None) -> None: ... +def eq_(a, b, msg: Incomplete | None = None) -> None: ... +def ne_(a, b, msg: Incomplete | None = None) -> None: ... +def le_(a, b, msg: Incomplete | None = None) -> None: ... +def is_instance_of(a, b, msg: Incomplete | None = None) -> None: ... +def is_none(a, msg: Incomplete | None = None) -> None: ... +def is_not_none(a, msg: Incomplete | None = None) -> None: ... +def is_true(a, msg: Incomplete | None = None) -> None: ... +def is_false(a, msg: Incomplete | None = None) -> None: ... +def is_(a, b, msg: Incomplete | None = None) -> None: ... +def is_not(a, b, msg: Incomplete | None = None) -> None: ... is_not_ = is_not -def in_(a, b, msg: Incomplete | None = ...) -> None: ... -def not_in(a, b, msg: Incomplete | None = ...) -> None: ... +def in_(a, b, msg: Incomplete | None = None) -> None: ... +def not_in(a, b, msg: Incomplete | None = None) -> None: ... not_in_ = not_in -def startswith_(a, fragment, msg: Incomplete | None = ...) -> None: ... -def eq_ignore_whitespace(a, b, msg: Incomplete | None = ...) -> None: ... +def startswith_(a, fragment, msg: Incomplete | None = None) -> None: ... +def eq_ignore_whitespace(a, b, msg: Incomplete | None = None) -> None: ... def assert_raises(except_cls, callable_, *args, **kw): ... def assert_raises_context_ok(except_cls, callable_, *args, **kw): ... def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): ... @@ -40,8 +40,8 @@ def assert_raises_message_context_ok(except_cls, msg, callable_, *args, **kwargs class _ErrorContainer: error: Incomplete -def expect_raises(except_cls, check_context: bool = ...): ... -def expect_raises_message(except_cls, msg, check_context: bool = ...): ... +def expect_raises(except_cls, check_context: bool = True): ... +def expect_raises_message(except_cls, msg, check_context: bool = True): ... class AssertsCompiledSQL: test_statement: Incomplete @@ -50,29 +50,29 @@ class AssertsCompiledSQL: self, clause, result, - params: Incomplete | None = ..., - checkparams: Incomplete | None = ..., - for_executemany: bool = ..., - check_literal_execute: Incomplete | None = ..., - check_post_param: Incomplete | None = ..., - dialect: Incomplete | None = ..., - checkpositional: Incomplete | None = ..., - check_prefetch: Incomplete | None = ..., - use_default_dialect: bool = ..., - allow_dialect_select: bool = ..., - supports_default_values: bool = ..., - supports_default_metavalue: bool = ..., - literal_binds: bool = ..., - render_postcompile: bool = ..., - schema_translate_map: Incomplete | None = ..., - render_schema_translate: bool = ..., - default_schema_name: Incomplete | None = ..., - from_linting: bool = ..., - check_param_order: bool = ..., + params: Incomplete | None = None, + checkparams: Incomplete | None = None, + for_executemany: bool = False, + check_literal_execute: Incomplete | None = None, + check_post_param: Incomplete | None = None, + dialect: Incomplete | None = None, + checkpositional: Incomplete | None = None, + check_prefetch: Incomplete | None = None, + use_default_dialect: bool = False, + allow_dialect_select: bool = False, + supports_default_values: bool = True, + supports_default_metavalue: bool = True, + literal_binds: bool = False, + render_postcompile: bool = False, + schema_translate_map: Incomplete | None = None, + render_schema_translate: bool = False, + default_schema_name: Incomplete | None = None, + from_linting: bool = False, + check_param_order: bool = True, ) -> None: ... class ComparesTables: - def assert_tables_equal(self, table, reflected_table, strict_types: bool = ...) -> None: ... + def assert_tables_equal(self, table, reflected_table, strict_types: bool = False) -> None: ... def assert_types_base(self, c1, c2) -> None: ... class AssertsExecutionResults: @@ -80,7 +80,7 @@ class AssertsExecutionResults: def assert_list(self, result, class_, list_) -> None: ... def assert_row(self, class_, rowobj, desc) -> None: ... def assert_unordered_result(self, result, cls, *expected): ... - def sql_execution_asserter(self, db: Incomplete | None = ...): ... + def sql_execution_asserter(self, db: Incomplete | None = None): ... def assert_sql_execution(self, db, callable_, *rules): ... def assert_sql(self, db, callable_, rules): ... def assert_sql_count(self, db, callable_, count) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi index c02391805e7c..c7534746d038 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/assertsql.pyi @@ -14,7 +14,7 @@ class CursorSQL(SQLMatchRule): statement: Any params: Any consume_statement: Any - def __init__(self, statement, params: Incomplete | None = ..., consume_statement: bool = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = None, consume_statement: bool = True) -> None: ... errormessage: Any is_consumed: bool def process_statement(self, execute_observed) -> None: ... @@ -23,7 +23,7 @@ class CompiledSQL(SQLMatchRule): statement: Any params: Any dialect: Any - def __init__(self, statement, params: Incomplete | None = ..., dialect: str = ...) -> None: ... + def __init__(self, statement, params: Incomplete | None = None, dialect: str = "default") -> None: ... is_consumed: bool errormessage: Any def process_statement(self, execute_observed) -> None: ... @@ -33,7 +33,7 @@ class RegexSQL(CompiledSQL): orig_regex: Any params: Any dialect: Any - def __init__(self, regex, params: Incomplete | None = ..., dialect: str = ...) -> None: ... + def __init__(self, regex, params: Incomplete | None = None, dialect: str = "default") -> None: ... class DialectSQL(CompiledSQL): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi index 4f0abf91803a..1ef8da6dba4c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/engines.pyi @@ -30,7 +30,7 @@ def assert_conns_closed(fn, *args, **kw) -> None: ... def rollback_open_connections(fn, *args, **kw) -> None: ... def close_first(fn, *args, **kw) -> None: ... def close_open_connections(fn, *args, **kw) -> None: ... -def all_dialects(exclude: Incomplete | None = ...) -> None: ... +def all_dialects(exclude: Incomplete | None = None) -> None: ... class ReconnectFixture: dbapi: Any @@ -39,34 +39,34 @@ class ReconnectFixture: def __init__(self, dbapi) -> None: ... def __getattr__(self, key: str): ... def connect(self, *args, **kwargs): ... - def shutdown(self, stop: bool = ...) -> None: ... + def shutdown(self, stop: bool = False) -> None: ... def restart(self) -> None: ... -def reconnecting_engine(url: Incomplete | None = ..., options: Incomplete | None = ...): ... +def reconnecting_engine(url: Incomplete | None = None, options: Incomplete | None = None): ... @overload def testing_engine( # type: ignore[misc] - url: URL | str | None = ..., - options: Mapping[str, Any] | None = ..., - future: bool | None = ..., - asyncio: Literal[False] = ..., - transfer_staticpool: bool = ..., + url: URL | str | None = None, + options: Mapping[str, Any] | None = None, + future: bool | None = None, + asyncio: Literal[False] = False, + transfer_staticpool: bool = False, ) -> Engine: ... @overload def testing_engine( - url: URL | str | None = ..., - options: Mapping[str, Any] | None = ..., - future: bool | None = ..., - asyncio: Literal[True] = ..., - transfer_staticpool: bool = ..., + url: URL | str | None = None, + options: Mapping[str, Any] | None = None, + future: bool | None = None, + asyncio: Literal[True] = True, + transfer_staticpool: bool = False, ) -> AsyncEngine: ... -def mock_engine(dialect_name: Incomplete | None = ...): ... +def mock_engine(dialect_name: Incomplete | None = None): ... class DBAPIProxyCursor: engine: Any connection: Any cursor: Any def __init__(self, engine, conn, *args, **kwargs) -> None: ... - def execute(self, stmt, parameters: Incomplete | None = ..., **kw): ... + def execute(self, stmt, parameters: Incomplete | None = None, **kw): ... def executemany(self, stmt, params, **kw): ... def __iter__(self): ... def __getattr__(self, key: str): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi index 7041a0266bc8..f9956ef44058 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/exclusions.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from typing import Any -def skip_if(predicate, reason: Incomplete | None = ...): ... -def fails_if(predicate, reason: Incomplete | None = ...): ... +def skip_if(predicate, reason: Incomplete | None = None): ... +def fails_if(predicate, reason: Incomplete | None = None): ... class compound: fails: Any @@ -22,17 +22,17 @@ class compound: def requires_tag(tagname): ... def tags(tagnames): ... -def only_if(predicate, reason: Incomplete | None = ...): ... -def succeeds_if(predicate, reason: Incomplete | None = ...): ... +def only_if(predicate, reason: Incomplete | None = None): ... +def succeeds_if(predicate, reason: Incomplete | None = None): ... class Predicate: @classmethod - def as_predicate(cls, predicate, description: Incomplete | None = ...): ... + def as_predicate(cls, predicate, description: Incomplete | None = None): ... class BooleanPredicate(Predicate): value: Any description: Any - def __init__(self, value, description: Incomplete | None = ...) -> None: ... + def __init__(self, value, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... class SpecPredicate(Predicate): @@ -41,7 +41,7 @@ class SpecPredicate(Predicate): spec: Any description: Any def __init__( - self, db, op: Incomplete | None = ..., spec: Incomplete | None = ..., description: Incomplete | None = ... + self, db, op: Incomplete | None = None, spec: Incomplete | None = None, description: Incomplete | None = None ) -> None: ... def __call__(self, config): ... @@ -51,30 +51,30 @@ class LambdaPredicate(Predicate): kw: Any description: Any def __init__( - self, lambda_, description: Incomplete | None = ..., args: Incomplete | None = ..., kw: Incomplete | None = ... + self, lambda_, description: Incomplete | None = None, args: Incomplete | None = None, kw: Incomplete | None = None ): ... def __call__(self, config): ... class NotPredicate(Predicate): predicate: Any description: Any - def __init__(self, predicate, description: Incomplete | None = ...) -> None: ... + def __init__(self, predicate, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... class OrPredicate(Predicate): predicates: Any description: Any - def __init__(self, predicates, description: Incomplete | None = ...) -> None: ... + def __init__(self, predicates, description: Incomplete | None = None) -> None: ... def __call__(self, config): ... def db_spec(*dbs): ... def open(): ... def closed(): ... -def fails(reason: Incomplete | None = ...): ... +def fails(reason: Incomplete | None = None): ... def future(fn, *arg): ... -def fails_on(db, reason: Incomplete | None = ...): ... +def fails_on(db, reason: Incomplete | None = None): ... def fails_on_everything_except(*dbs): ... -def skip(db, reason: Incomplete | None = ...): ... -def only_on(dbs, reason: Incomplete | None = ...): ... -def exclude(db, op, spec, reason: Incomplete | None = ...): ... +def skip(db, reason: Incomplete | None = None): ... +def only_on(dbs, reason: Incomplete | None = None): ... +def exclude(db, op, spec, reason: Incomplete | None = None): ... def against(config, *queries): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi index 5d3f8927da9f..c2aa3d0d0525 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/profiling.pyi @@ -9,7 +9,7 @@ class ProfileStatsFile: data: Any dump: Any sort: Any - def __init__(self, filename, sort: str = ..., dump: Incomplete | None = ...): ... + def __init__(self, filename, sort: str = "cumulative", dump: Incomplete | None = None): ... @property def platform_key(self): ... def has_stats(self): ... @@ -17,5 +17,5 @@ class ProfileStatsFile: def reset_count(self) -> None: ... def replace(self, callcount) -> None: ... -def function_call_count(variance: float = ..., times: int = ..., warmup: int = ...): ... -def count_functions(variance: float = ...) -> None: ... +def function_call_count(variance: float = 0.05, times: int = 1, warmup: int = 0): ... +def count_functions(variance: float = 0.05) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi index fc6879fc4a99..6e5ba05c8f53 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/util.pyi @@ -2,10 +2,10 @@ from _typeshed import Incomplete from typing import Any def non_refcount_gc_collect(*args) -> None: ... # only present on Python implementations with non-refcount gc -def gc_collect(generation: int = ...) -> None: ... +def gc_collect(generation: int = 2) -> None: ... def lazy_gc() -> None: ... def picklers(): ... -def random_choices(population, k: int = ...): ... +def random_choices(population, k: int = 1): ... def round_decimal(value, prec): ... class RandomSet(set[Any]): @@ -26,7 +26,7 @@ def provide_metadata(fn, *args, **kw): ... def flag_combinations(*combinations): ... def lambda_combinations(lambda_arg_sets, **kw): ... def resolve_lambda(__fn, **kw): ... -def metadata_fixture(ddl: str = ...): ... +def metadata_fixture(ddl: str = "function"): ... def force_drop_names(*names): ... class adict(dict[Any, Any]): @@ -35,7 +35,7 @@ class adict(dict[Any, Any]): get_all: Any def drop_all_tables_from_metadata(metadata, engine_or_connection) -> None: ... -def drop_all_tables(engine, inspector, schema: Incomplete | None = ..., include_names: Incomplete | None = ...) -> None: ... +def drop_all_tables(engine, inspector, schema: Incomplete | None = None, include_names: Incomplete | None = None) -> None: ... def total_size(o) -> int: ... def teardown_events(event_cls): ... def count_cache_key_tuples(tup) -> int: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi index 9aa4255ceaf6..7c72efd57763 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/warnings.pyi @@ -4,4 +4,4 @@ class SATestSuiteWarning(sa_exc.SAWarning): ... def warn_test_suite(message) -> None: ... def setup_filters() -> None: ... -def assert_warnings(fn, warning_msgs, regex: bool = ...): ... +def assert_warnings(fn, warning_msgs, regex: bool = False): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 631fcce3bda3..888b12d8940d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -67,11 +67,11 @@ class ImmutableProperties(ImmutableContainer, Properties[_T], Generic[_T]): ... OrderedDict = dict -def sort_dictionary(d, key: Incomplete | None = ...): ... +def sort_dictionary(d, key: Incomplete | None = None): ... class OrderedSet(set[_T], Generic[_T]): @overload - def __init__(self, d: None = ...) -> None: ... + def __init__(self, d: None = None) -> None: ... @overload def __init__(self, d: Iterable[_T]) -> None: ... def add(self, element: _T) -> None: ... @@ -100,7 +100,7 @@ class OrderedSet(set[_T], Generic[_T]): __isub__ = difference_update # type: ignore[assignment] class IdentitySet: - def __init__(self, iterable: Incomplete | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = None) -> None: ... def add(self, value) -> None: ... def __contains__(self, value): ... def remove(self, value) -> None: ... @@ -139,14 +139,14 @@ class IdentitySet: def __hash__(self) -> int: ... class WeakSequence: - def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ...) -> None: ... + def __init__(self, _WeakSequence__elements: Iterable[Incomplete] = ()) -> None: ... def append(self, item) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, index): ... class OrderedIdentitySet(IdentitySet): - def __init__(self, iterable: Incomplete | None = ...) -> None: ... + def __init__(self, iterable: Incomplete | None = None) -> None: ... class PopulateDict(dict[Any, Any]): creator: Any @@ -167,28 +167,28 @@ column_dict = dict # or pyright complains ordered_column_set = OrderedSet[_T] # noqa: Y026 -def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = ...) -> list[_T]: ... +def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = None) -> list[_T]: ... class UniqueAppender: data: Any - def __init__(self, data, via: Incomplete | None = ...) -> None: ... + def __init__(self, data, via: Incomplete | None = None) -> None: ... def append(self, item) -> None: ... def __iter__(self): ... def coerce_generator_arg(arg): ... -def to_list(x, default: Incomplete | None = ...): ... +def to_list(x, default: Incomplete | None = None): ... def has_intersection(set_, iterable): ... def to_set(x): ... def to_column_set(x): ... -def update_copy(d, _new: Incomplete | None = ..., **kw): ... +def update_copy(d, _new: Incomplete | None = None, **kw): ... def flatten_iterator(x) -> None: ... class LRUCache(dict[Any, Any]): capacity: Any threshold: Any size_alert: Any - def __init__(self, capacity: int = ..., threshold: float = ..., size_alert: Incomplete | None = ...) -> None: ... - def get(self, key, default: Incomplete | None = ...): ... + def __init__(self, capacity: int = 100, threshold: float = 0.5, size_alert: Incomplete | None = None) -> None: ... + def get(self, key, default: Incomplete | None = None): ... def __getitem__(self, key): ... def values(self): ... def setdefault(self, key, value): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi index f2fea9f5dcc0..53db95d001e2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_concurrency_py3k.pyi @@ -7,7 +7,7 @@ from .langhelpers import memoized_property def is_exit_exception(e): ... def await_only(awaitable: Coroutine[Any, Any, Any]) -> Any: ... def await_fallback(awaitable: Coroutine[Any, Any, Any]) -> Any: ... -async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = ..., **kwargs) -> Any: ... +async def greenlet_spawn(fn: Callable[..., Any], *args, _require_await: bool = False, **kwargs) -> Any: ... class AsyncAdaptedLock: @memoized_property diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi index eaabad39009d..f1e73ecf3a88 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_preloaded.pyi @@ -3,7 +3,7 @@ from typing import Any class _ModuleRegistry: module_registry: Any prefix: Any - def __init__(self, prefix: str = ...) -> None: ... + def __init__(self, prefix: str = "sqlalchemy.") -> None: ... def preload_module(self, *deps): ... def import_prefix(self, path) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi index eae66bce00e1..b334fb6da1b0 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/compat.pyi @@ -59,7 +59,7 @@ class FullArgSpec(NamedTuple): class nullcontext: enter_result: Any - def __init__(self, enter_result: Incomplete | None = ...) -> None: ... + def __init__(self, enter_result: Incomplete | None = None) -> None: ... def __enter__(self): ... def __exit__(self, *excinfo) -> None: ... @@ -86,18 +86,18 @@ def b64encode(x): ... def decode_backslashreplace(text, encoding): ... def cmp(a, b): ... def raise_( - exception, with_traceback: Incomplete | None = ..., replace_context: Incomplete | None = ..., from_: bool = ... + exception, with_traceback: Incomplete | None = None, replace_context: Incomplete | None = None, from_: bool = False ) -> None: ... def u(s): ... def ue(s): ... def inspect_formatargspec( args, - varargs: Incomplete | None = ..., - varkw: Incomplete | None = ..., - defaults: Incomplete | None = ..., - kwonlyargs=..., - kwonlydefaults=..., - annotations=..., + varargs: Incomplete | None = None, + varkw: Incomplete | None = None, + defaults: Incomplete | None = None, + kwonlyargs=(), + kwonlydefaults={}, + annotations={}, formatarg=..., formatvarargs=..., formatvarkw=..., @@ -107,6 +107,6 @@ def inspect_formatargspec( ): ... def dataclass_fields(cls): ... def local_dataclass_fields(cls): ... -def raise_from_cause(exception, exc_info: Incomplete | None = ...) -> None: ... -def reraise(tp, value, tb: Incomplete | None = ..., cause: Incomplete | None = ...) -> None: ... +def raise_from_cause(exception, exc_info: Incomplete | None = None) -> None: ... +def reraise(tp, value, tb: Incomplete | None = None, cause: Incomplete | None = None) -> None: ... def with_metaclass(meta, *bases, **kw): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi index c755277f4f4b..e816883e2c34 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/deprecations.pyi @@ -9,18 +9,20 @@ from .langhelpers import ( SQLALCHEMY_WARN_20: bool SILENCE_UBER_WARNING: bool -def warn_deprecated(msg, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def warn_deprecated_limited(msg, args, version, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def warn_deprecated_20(msg, stacklevel: int = ..., code: Incomplete | None = ...) -> None: ... -def deprecated_cls(version, message, constructor: str = ...): ... -def deprecated_20_cls(clsname, alternative: Incomplete | None = ..., constructor: str = ..., becomes_legacy: bool = ...): ... +def warn_deprecated(msg, version, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def warn_deprecated_limited(msg, args, version, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def warn_deprecated_20(msg, stacklevel: int = 3, code: Incomplete | None = None) -> None: ... +def deprecated_cls(version, message, constructor: str = "__init__"): ... +def deprecated_20_cls( + clsname, alternative: Incomplete | None = None, constructor: str = "__init__", becomes_legacy: bool = False +): ... def deprecated( version, - message: Incomplete | None = ..., - add_deprecation_to_docstring: bool = ..., - warning: Incomplete | None = ..., - enable_warnings: bool = ..., + message: Incomplete | None = None, + add_deprecation_to_docstring: bool = True, + warning: Incomplete | None = None, + enable_warnings: bool = True, ): ... def moved_20(message, **kw): ... -def deprecated_20(api_name, alternative: Incomplete | None = ..., becomes_legacy: bool = ..., **kw): ... +def deprecated_20(api_name, alternative: Incomplete | None = None, becomes_legacy: bool = False, **kw): ... def deprecated_params(**specs): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 3f0e7c564753..bd31f3201016 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -10,7 +10,7 @@ def md5_hex(x): ... class safe_reraise: warn_only: Any - def __init__(self, warn_only: bool = ...) -> None: ... + def __init__(self, warn_only: bool = False) -> None: ... def __enter__(self) -> None: ... def __exit__(self, type_, value, traceback) -> None: ... @@ -21,34 +21,34 @@ def method_is_overridden(instance_or_cls, against_method): ... def decode_slice(slc): ... def map_bits(fn, n) -> None: ... def decorator(target): ... -def public_factory(target, location, class_location: Incomplete | None = ...): ... +def public_factory(target, location, class_location: Incomplete | None = None): ... class PluginLoader: group: Any impls: Any auto_fn: Any - def __init__(self, group, auto_fn: Incomplete | None = ...) -> None: ... + def __init__(self, group, auto_fn: Incomplete | None = None) -> None: ... def clear(self) -> None: ... def load(self, name): ... def register(self, name, modulepath, objname) -> None: ... -def get_cls_kwargs(cls, _set: Incomplete | None = ...): ... +def get_cls_kwargs(cls, _set: Incomplete | None = None): ... def get_func_kwargs(func): ... -def get_callable_argspec(fn, no_self: bool = ..., _is_init: bool = ...): ... -def format_argspec_plus(fn, grouped: bool = ...): ... -def format_argspec_init(method, grouped: bool = ...): ... +def get_callable_argspec(fn, no_self: bool = False, _is_init: bool = False): ... +def format_argspec_plus(fn, grouped: bool = True): ... +def format_argspec_init(method, grouped: bool = True): ... def create_proxy_methods( - target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=..., methods=..., attributes=... + target_cls, target_cls_sphinx_name, proxy_cls_sphinx_name, classmethods=(), methods=(), attributes=() ): ... def getargspec_init(method): ... def unbound_method_to_callable(func_or_cls): ... -def generic_repr(obj, additional_kw=..., to_inspect: Incomplete | None = ..., omit_kwarg=...): ... +def generic_repr(obj, additional_kw=(), to_inspect: Incomplete | None = None, omit_kwarg=()): ... class portable_instancemethod: target: Any name: Any kwargs: Any - def __init__(self, meth, kwargs=...) -> None: ... + def __init__(self, meth, kwargs=()) -> None: ... def __call__(self, *arg, **kw): ... def class_hierarchy(cls): ... @@ -56,19 +56,19 @@ def iterate_attributes(cls) -> None: ... def monkeypatch_proxied_specials( into_cls, from_cls, - skip: Incomplete | None = ..., - only: Incomplete | None = ..., - name: str = ..., - from_instance: Incomplete | None = ..., + skip: Incomplete | None = None, + only: Incomplete | None = None, + name: str = "self.proxy", + from_instance: Incomplete | None = None, ) -> None: ... def methods_equivalent(meth1, meth2): ... -def as_interface(obj, cls: Incomplete | None = ..., methods: Incomplete | None = ..., required: Incomplete | None = ...): ... +def as_interface(obj, cls: Incomplete | None = None, methods: Incomplete | None = None, required: Incomplete | None = None): ... class memoized_property(Generic[_R]): fget: Callable[..., _R] __doc__: str __name__: str - def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload def __get__(self: Self, obj: None, cls: object) -> Self: ... @overload @@ -83,7 +83,7 @@ class HasMemoized: fget: Callable[..., _R] __doc__: str __name__: str - def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... + def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload def __get__(self: Self, obj: None, cls: object) -> Self: ... @overload @@ -98,11 +98,11 @@ class MemoizedSlots: def asbool(obj): ... def bool_or_str(*text): ... def asint(value): ... -def coerce_kw_type(kw, key, type_, flexi_bool: bool = ..., dest: Incomplete | None = ...) -> None: ... +def coerce_kw_type(kw, key, type_, flexi_bool: bool = True, dest: Incomplete | None = None) -> None: ... def constructor_key(obj, cls): ... def constructor_copy(obj, cls, *args, **kw): ... def counter(): ... -def duck_type_collection(specimen, default: Incomplete | None = ...): ... +def duck_type_collection(specimen, default: Incomplete | None = None): ... def assert_arg_type(arg, argtype, name): ... def dictlike_iteritems(dictlike): ... @@ -130,28 +130,28 @@ class hybridmethod: class _symbol(int): def __new__( # noqa: Y034 # Excplicitely instanciates _symbol - self, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + self, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... def __reduce__(self): ... class symbol: symbols: Any def __new__( # type: ignore[misc] # Excplicitely instanciates _symbol - cls, name, doc: Incomplete | None = ..., canonical: Incomplete | None = ... + cls, name, doc: Incomplete | None = None, canonical: Incomplete | None = None ) -> _symbol: ... @classmethod - def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = ...): ... + def parse_user_argument(cls, arg, choices, name, resolve_symbol_names: bool = False): ... def set_creation_order(instance) -> None: ... def warn_exception(func, *args, **kwargs): ... -def ellipses_string(value, len_: int = ...): ... +def ellipses_string(value, len_: int = 25): ... class _hash_limit_string(compat.text_type): def __new__(cls, value, num, args): ... def __hash__(self) -> int: ... def __eq__(self, other): ... -def warn(msg, code: Incomplete | None = ...) -> None: ... +def warn(msg, code: Incomplete | None = None) -> None: ... def warn_limited(msg, args) -> None: ... def only_once(fn, retry_on_exception): ... def chop_traceback(tb, exclude_prefix=..., exclude_suffix=...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi b/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi index 7a26c25d72c7..852018369726 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/queue.pyi @@ -9,27 +9,27 @@ class Queue: not_empty: Any not_full: Any use_lifo: Any - def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def __init__(self, maxsize: int = 0, use_lifo: bool = False) -> None: ... def qsize(self): ... def empty(self): ... def full(self): ... - def put(self, item, block: bool = ..., timeout: Incomplete | None = ...) -> None: ... + def put(self, item, block: bool = True, timeout: Incomplete | None = None) -> None: ... def put_nowait(self, item): ... - def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def get(self, block: bool = True, timeout: Incomplete | None = None): ... def get_nowait(self): ... class AsyncAdaptedQueue: await_: Any use_lifo: Any maxsize: Any - def __init__(self, maxsize: int = ..., use_lifo: bool = ...) -> None: ... + def __init__(self, maxsize: int = 0, use_lifo: bool = False) -> None: ... def empty(self): ... def full(self): ... def qsize(self): ... def put_nowait(self, item): ... - def put(self, item, block: bool = ..., timeout: Incomplete | None = ...): ... + def put(self, item, block: bool = True, timeout: Incomplete | None = None): ... def get_nowait(self): ... - def get(self, block: bool = ..., timeout: Incomplete | None = ...): ... + def get(self, block: bool = True, timeout: Incomplete | None = None): ... class FallbackAsyncAdaptedQueue(AsyncAdaptedQueue): await_: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi b/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi index 04428e1ba790..7f54e1a0574c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/topological.pyi @@ -1,3 +1,3 @@ def sort_as_subsets(tuples, allitems) -> None: ... -def sort(tuples, allitems, deterministic_order: bool = ...) -> None: ... +def sort(tuples, allitems, deterministic_order: bool = True) -> None: ... def find_cycles(tuples, allitems): ... From ad138e77a4e3f7dd7396b68c9a23789eba9e15a2 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 31 Mar 2023 15:50:29 -0400 Subject: [PATCH 21/25] Update usage of Self --- stubs/SQLAlchemy/sqlalchemy/engine/base.pyi | 6 +- stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi | 4 +- stubs/SQLAlchemy/sqlalchemy/engine/result.pyi | 7 +- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 20 +++--- stubs/SQLAlchemy/sqlalchemy/engine/util.pyi | 4 +- .../sqlalchemy/ext/asyncio/session.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/log.pyi | 5 +- stubs/SQLAlchemy/sqlalchemy/orm/query.pyi | 66 +++++++++---------- stubs/SQLAlchemy/sqlalchemy/orm/session.pyi | 5 +- .../sqlalchemy/orm/strategy_options.pyi | 47 ++++++------- stubs/SQLAlchemy/sqlalchemy/sql/base.pyi | 7 +- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 6 +- .../SQLAlchemy/sqlalchemy/sql/selectable.pyi | 59 ++++++++--------- .../sqlalchemy/testing/provision.pyi | 8 +-- .../sqlalchemy/util/_collections.pyi | 15 +++-- .../sqlalchemy/util/langhelpers.pyi | 9 +-- 16 files changed, 138 insertions(+), 135 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi index a4cdd5970106..2b69e99d3378 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/base.pyi @@ -1,10 +1,10 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from _typeshed.dbapi import DBAPIConnection from abc import abstractmethod from collections.abc import Callable, Mapping from types import TracebackType from typing import Any, TypeVar, overload -from typing_extensions import Concatenate, ParamSpec, TypeAlias +from typing_extensions import Concatenate, ParamSpec, Self, TypeAlias from ..log import Identified, _EchoFlag, echo_property from ..pool import Pool @@ -40,7 +40,7 @@ class Connection(Connectable): _allow_revalidate: bool = True, ) -> None: ... def schema_for_object(self, obj) -> str | None: ... - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi index dc685760d8c0..bfd8007258db 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/mock.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self from abc import abstractmethod from collections.abc import Mapping from typing import Any, overload +from typing_extensions import Self from .base import _Executable from .cursor import CursorResult @@ -11,7 +11,7 @@ from .url import URL class MockConnection(Connectable): def __init__(self, dialect: Dialect, execute) -> None: ... @property - def engine(self: Self) -> Self: ... # type: ignore[override] + def engine(self) -> Self: ... # type: ignore[override] @property def dialect(self) -> Dialect: ... @property diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi index 05097cadfebb..e684e8ba61ff 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/result.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Generator, KeysView from typing import Any +from typing_extensions import Self from ..sql.base import InPlaceGenerative from .row import Row @@ -40,8 +41,8 @@ class Result(_WithKeys, ResultInternal): def close(self) -> None: ... @property def closed(self): ... - def yield_per(self: Self, num: int) -> Self: ... - def unique(self: Self, strategy: Incomplete | None = None) -> Self: ... + def yield_per(self, num: int) -> Self: ... + def unique(self, strategy: Incomplete | None = None) -> Self: ... def columns(self, *col_expressions): ... def scalars(self, index: int = 0) -> ScalarResult: ... def mappings(self) -> MappingResult: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 5ce97d688fd6..7725046071ba 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -1,7 +1,7 @@ -from _typeshed import Self, SupportsItems +from _typeshed import SupportsItems from collections.abc import Iterable, Mapping, Sequence from typing import Any, NamedTuple -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ..util import immutabledict from .interfaces import Dialect @@ -19,7 +19,7 @@ class _URLTuple(NamedTuple): _Query: TypeAlias = Mapping[str, str | Sequence[str]] | Sequence[tuple[str, str | Sequence[str]]] class URL(_URLTuple): - def __new__(self: type[Self], *arg, **kw) -> Self | URL: ... + def __new__(self, *arg, **kw) -> Self | URL: ... @classmethod def create( cls, @@ -32,7 +32,7 @@ class URL(_URLTuple): query: _Query | None = ..., ) -> URL: ... def set( - self: Self, + self, drivername: str | None = None, username: str | None = None, password: str | object | None = None, @@ -41,18 +41,16 @@ class URL(_URLTuple): database: str | None = None, query: _Query | None = None, ) -> Self: ... - def update_query_string(self: Self, query_string: str, append: bool = False) -> Self: ... - def update_query_pairs(self: Self, key_value_pairs: Iterable[tuple[str, str]], append: bool = False) -> Self: ... - def update_query_dict( - self: Self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = False - ) -> Self: ... + def update_query_string(self, query_string: str, append: bool = False) -> Self: ... + def update_query_pairs(self, key_value_pairs: Iterable[tuple[str, str]], append: bool = False) -> Self: ... + def update_query_dict(self, query_parameters: SupportsItems[str, str | Sequence[str]], append: bool = False) -> Self: ... def difference_update_query(self, names: Iterable[str]) -> URL: ... @property def normalized_query(self) -> immutabledict[str, tuple[str, ...]]: ... def __to_string__(self, hide_password: bool = True) -> str: ... def render_as_string(self, hide_password: bool = True) -> str: ... - def __copy__(self: Self) -> Self: ... - def __deepcopy__(self: Self, memo: object) -> Self: ... + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: object) -> Self: ... def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi index f711f0c83d0a..0fdef74350e3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/util.pyi @@ -1,12 +1,12 @@ -from _typeshed import Self from collections.abc import Callable from types import TracebackType from typing import Any +from typing_extensions import Self def connection_memoize(key: str) -> Callable[..., Any]: ... class TransactionalContext: - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__( self, type_: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi index 505132ea4be9..727ff0c6e412 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/asyncio/session.pyi @@ -1,5 +1,6 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from ...util.langhelpers import memoized_property from .base import ReversibleProxy, StartableContext @@ -56,7 +57,7 @@ class AsyncSession(ReversibleProxy): async def invalidate(self): ... @classmethod async def close_all(cls): ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self) -> Self: ... async def __aexit__(self, type_, value, traceback) -> None: ... # proxied from Session identity_map: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index 1044d8394947..a378fe47a5cc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,8 +1,7 @@ import sys -from _typeshed import Self from logging import Logger from typing import Any, TypeVar, overload -from typing_extensions import Final, Literal, TypeAlias +from typing_extensions import Final, Literal, Self, TypeAlias _ClsT = TypeVar("_ClsT", bound=type) _EchoFlag: TypeAlias = bool | Literal["debug"] | None @@ -45,7 +44,7 @@ def instance_logger(instance: Identified, echoflag: _EchoFlag = None) -> None: . class echo_property: __doc__: str @overload - def __get__(self: Self, instance: None, owner: object) -> Self: ... + def __get__(self, instance: None, owner: object) -> Self: ... @overload def __get__(self, instance: Identified, owner: object) -> _EchoFlag: ... def __set__(self, instance: Identified, value: _EchoFlag) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi index 9c228941c633..c98765f8cbed 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/query.pyi @@ -1,7 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Iterator from typing import Any, Generic, TypeVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Self, TypeAlias from ..sql.annotation import SupportsCloneAnnotations from ..sql.base import Executable @@ -31,74 +31,74 @@ class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffi @property def selectable(self): ... def __clause_element__(self): ... - def only_return_tuples(self: Self, value) -> Self: ... + def only_return_tuples(self, value) -> Self: ... @property def is_single_entity(self): ... - def enable_eagerloads(self: Self, value) -> Self: ... + def enable_eagerloads(self, value) -> Self: ... def with_labels(self): ... apply_labels: Any @property def get_label_style(self): ... def set_label_style(self, style): ... - def enable_assertions(self: Self, value) -> Self: ... + def enable_assertions(self, value) -> Self: ... @property def whereclause(self): ... def with_polymorphic( - self: Self, cls_or_mappers, selectable: Incomplete | None = None, polymorphic_on: Incomplete | None = None + self, cls_or_mappers, selectable: Incomplete | None = None, polymorphic_on: Incomplete | None = None ) -> Self: ... - def yield_per(self: Self, count) -> Self: ... + def yield_per(self, count) -> Self: ... def get(self, ident): ... @property def lazy_loaded_from(self): ... - def correlate(self: Self, *fromclauses) -> Self: ... - def autoflush(self: Self, setting) -> Self: ... - def populate_existing(self: Self) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def autoflush(self, setting) -> Self: ... + def populate_existing(self) -> Self: ... def with_parent(self, instance, property: Incomplete | None = None, from_entity: Incomplete | None = None): ... - def add_entity(self: Self, entity, alias: Incomplete | None = None) -> Self: ... - def with_session(self: Self, session) -> Self: ... + def add_entity(self, entity, alias: Incomplete | None = None) -> Self: ... + def with_session(self, session) -> Self: ... def from_self(self, *entities): ... def values(self, *columns): ... def value(self, column): ... - def with_entities(self: Self, *entities) -> Self: ... - def add_columns(self: Self, *column) -> Self: ... + def with_entities(self, *entities) -> Self: ... + def add_columns(self, *column) -> Self: ... def add_column(self, column): ... - def options(self: Self, *args) -> Self: ... + def options(self, *args) -> Self: ... def with_transformation(self, fn): ... def get_execution_options(self): ... - def execution_options(self: Self, **kwargs) -> Self: ... + def execution_options(self, **kwargs) -> Self: ... def with_for_update( - self: Self, + self, read: bool = False, nowait: bool = False, of: Incomplete | None = None, skip_locked: bool = False, key_share: bool = False, ) -> Self: ... - def params(self: Self, *args, **kwargs) -> Self: ... + def params(self, *args, **kwargs) -> Self: ... def where(self, *criterion): ... - def filter(self: Self, *criterion) -> Self: ... - def filter_by(self: Self, **kwargs) -> Self: ... - def order_by(self: Self, *clauses) -> Self: ... - def group_by(self: Self, *clauses) -> Self: ... - def having(self: Self, criterion) -> Self: ... + def filter(self, *criterion) -> Self: ... + def filter_by(self, **kwargs) -> Self: ... + def order_by(self, *clauses) -> Self: ... + def group_by(self, *clauses) -> Self: ... + def having(self, criterion) -> Self: ... def union(self, *q): ... def union_all(self, *q): ... def intersect(self, *q): ... def intersect_all(self, *q): ... def except_(self, *q): ... def except_all(self, *q): ... - def join(self: Self, target, *props, **kwargs) -> Self: ... - def outerjoin(self: Self, target, *props, **kwargs) -> Self: ... - def reset_joinpoint(self: Self) -> Self: ... - def select_from(self: Self, *from_obj) -> Self: ... - def select_entity_from(self: Self, from_obj) -> Self: ... + def join(self, target, *props, **kwargs) -> Self: ... + def outerjoin(self, target, *props, **kwargs) -> Self: ... + def reset_joinpoint(self) -> Self: ... + def select_from(self, *from_obj) -> Self: ... + def select_entity_from(self, from_obj) -> Self: ... def __getitem__(self, item): ... - def slice(self: Self, start, stop) -> Self: ... - def limit(self: Self, limit) -> Self: ... - def offset(self: Self, offset) -> Self: ... - def distinct(self: Self, *expr) -> Self: ... + def slice(self, start, stop) -> Self: ... + def limit(self, limit) -> Self: ... + def offset(self, offset) -> Self: ... + def distinct(self, *expr) -> Self: ... def all(self) -> list[_T]: ... - def from_statement(self: Self, statement) -> Self: ... + def from_statement(self, statement) -> Self: ... def first(self) -> _T | None: ... def one_or_none(self): ... def one(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi index 2953604558f5..a5a736afb60e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/session.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Mapping from typing import Any, TypeVar, overload +from typing_extensions import Self from ..engine.base import Connection from ..engine.result import Result @@ -106,7 +107,7 @@ class Session(_SessionClassMethods): query_cls: Incomplete | None = None, ) -> None: ... connection_callable: Any - def __enter__(self: Self) -> Self: ... + def __enter__(self) -> Self: ... def __exit__(self, type_, value, traceback) -> None: ... @property def transaction(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi index 83b4b04ea941..e4ee26f1da18 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/strategy_options.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from typing import Any +from typing_extensions import Self from ..sql.base import Generative from .interfaces import LoaderOption @@ -18,28 +19,28 @@ class Load(Generative, LoaderOption): propagate_to_loaders: bool def process_compile_state_replaced_entities(self, compile_state, mapper_entities) -> None: ... def process_compile_state(self, compile_state) -> None: ... - def options(self: Self, *opts) -> Self: ... - def set_relationship_strategy(self: Self, attr, strategy, propagate_to_loaders: bool = True) -> Self: ... - def set_column_strategy(self: Self, attrs, strategy, opts: Incomplete | None = None, opts_only: bool = False) -> Self: ... - def set_generic_strategy(self: Self, attrs, strategy) -> Self: ... - def set_class_strategy(self: Self, strategy, opts) -> Self: ... + def options(self, *opts) -> Self: ... + def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = True) -> Self: ... + def set_column_strategy(self, attrs, strategy, opts: Incomplete | None = None, opts_only: bool = False) -> Self: ... + def set_generic_strategy(self, attrs, strategy) -> Self: ... + def set_class_strategy(self, strategy, opts) -> Self: ... # Added dynamically at runtime - def contains_eager(loadopt: Self, attr, alias: Incomplete | None = None) -> Self: ... - def load_only(loadopt: Self, *attrs) -> Self: ... - def joinedload(loadopt: Self, attr, innerjoin: Incomplete | None = None) -> Self: ... - def subqueryload(loadopt: Self, attr) -> Self: ... - def selectinload(loadopt: Self, attr) -> Self: ... - def lazyload(loadopt: Self, attr) -> Self: ... - def immediateload(loadopt: Self, attr) -> Self: ... - def noload(loadopt: Self, attr) -> Self: ... - def raiseload(loadopt: Self, attr, sql_only: bool = False) -> Self: ... - def defaultload(loadopt: Self, attr) -> Self: ... - def defer(loadopt: Self, key, raiseload: bool = False) -> Self: ... - def undefer(loadopt: Self, key) -> Self: ... - def undefer_group(loadopt: Self, name) -> Self: ... - def with_expression(loadopt: Self, key, expression) -> Self: ... - def selectin_polymorphic(loadopt: Self, classes) -> Self: ... - def baked_lazyload(loadopt: Self, attr) -> Self: ... + def contains_eager(loadopt, attr, alias: Incomplete | None = None) -> Self: ... + def load_only(loadopt, *attrs) -> Self: ... + def joinedload(loadopt, attr, innerjoin: Incomplete | None = None) -> Self: ... + def subqueryload(loadopt, attr) -> Self: ... + def selectinload(loadopt, attr) -> Self: ... + def lazyload(loadopt, attr) -> Self: ... + def immediateload(loadopt, attr) -> Self: ... + def noload(loadopt, attr) -> Self: ... + def raiseload(loadopt, attr, sql_only: bool = False) -> Self: ... + def defaultload(loadopt, attr) -> Self: ... + def defer(loadopt, key, raiseload: bool = False) -> Self: ... + def undefer(loadopt, key) -> Self: ... + def undefer_group(loadopt, name) -> Self: ... + def with_expression(loadopt, key, expression) -> Self: ... + def selectin_polymorphic(loadopt, classes) -> Self: ... + def baked_lazyload(loadopt, attr) -> Self: ... class _UnboundLoad(Load): path: Any @@ -50,7 +51,7 @@ class loader_option: name: str # The first parameter of this Callable should always be `loadopt: Load` fn: Callable[..., loader_option] - def __call__(self: Self, fn: Callable[..., loader_option]) -> Self: ... + def __call__(self, fn: Callable[..., loader_option]) -> Self: ... # loader_option instances that can be used to dynamically add methods to Load at runtime @loader_option() diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi index 343ec09b2b98..9083c4f7ff9c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/base.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import MutableMapping from typing import Any, ClassVar +from typing_extensions import Self from .. import util from ..util.langhelpers import HasMemoized, hybridmethod, memoized_property @@ -98,8 +99,8 @@ class Executable(roles.StatementRole, Generative): is_text: bool is_delete: bool is_dml: bool - def options(self: Self, *options) -> Self: ... - def execution_options(self: Self, **kw) -> Self: ... + def options(self, *options) -> Self: ... + def execution_options(self, **kw) -> Self: ... def get_execution_options(self): ... def execute(self, *multiparams, **params): ... def scalar(self, *multiparams, **params): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index 921c6ef2acaa..454f33396a51 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -1,6 +1,6 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any, Generic, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, Self from .. import util from ..util.langhelpers import HasMemoized, memoized_property @@ -138,7 +138,7 @@ class TextClause( key: Any text: Any def __init__(self, text: str, bind: Incomplete | None = None) -> None: ... - def bindparams(self: Self, *binds, **names_to_values) -> Self: ... + def bindparams(self, *binds, **names_to_values) -> Self: ... def columns(self, *cols, **types): ... @property def type(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi index 6553f2fcd419..fff056a8488d 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi @@ -1,5 +1,6 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from typing import Any +from typing_extensions import Self from .. import util from ..util.langhelpers import HasMemoized, memoized_property @@ -38,14 +39,14 @@ class Selectable(ReturnsRows): def corresponding_column(self, column, require_embedded: bool = False): ... class HasPrefixes: - def prefix_with(self: Self, *expr, **kw) -> Self: ... + def prefix_with(self, *expr, **kw) -> Self: ... class HasSuffixes: - def suffix_with(self: Self, *expr, **kw) -> Self: ... + def suffix_with(self, *expr, **kw) -> Self: ... class HasHints: def with_statement_hint(self, text, dialect_name: str = "*"): ... - def with_hint(self: Self, selectable, text: str, dialect_name: str = "*") -> Self: ... + def with_hint(self, selectable, text: str, dialect_name: str = "*") -> Self: ... class FromClause(roles.AnonymizedFromClauseRole, Selectable): __visit_name__: str @@ -204,9 +205,9 @@ class Values(Generative, FromClause): name: Any literal_binds: Any def __init__(self, *columns, **kw) -> None: ... - def alias(self: Self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] - def lateral(self: Self, name: Incomplete | None = None) -> Self: ... - def data(self: Self, values) -> Self: ... + def alias(self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override] + def lateral(self, name: Incomplete | None = None) -> Self: ... + def data(self, values) -> Self: ... class SelectBase( roles.SelectStatementRole, @@ -264,7 +265,7 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): bind: Incomplete | None = None, ) -> None: ... def with_for_update( - self: Self, + self, nowait: bool = False, read: bool = False, of: Incomplete | None = None, @@ -274,12 +275,12 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): def get_label_style(self): ... def set_label_style(self, style): ... def apply_labels(self): ... - def limit(self: Self, limit: Incomplete | None) -> Self: ... - def fetch(self: Self, count: Incomplete | None, with_ties: bool = False, percent: bool = False) -> Self: ... - def offset(self: Self, offset: Incomplete | None) -> Self: ... - def slice(self: Self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... - def order_by(self: Self, *clauses) -> Self: ... - def group_by(self: Self, *clauses) -> Self: ... + def limit(self, limit: Incomplete | None) -> Self: ... + def fetch(self, count: Incomplete | None, with_ties: bool = False, percent: bool = False) -> Self: ... + def offset(self, offset: Incomplete | None) -> Self: ... + def slice(self, start: Incomplete | None, stop: Incomplete | None) -> Self: ... + def order_by(self, *clauses) -> Self: ... + def group_by(self, *clauses) -> Self: ... class CompoundSelectState(CompileState): ... @@ -357,11 +358,9 @@ class Select( @property def column_descriptions(self): ... def from_statement(self, statement): ... - def join(self: Self, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... + def join(self, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... def outerjoin_from(self, from_, target, onclause: Incomplete | None = None, full: bool = False): ... - def join_from( - self: Self, from_, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False - ) -> Self: ... + def join_from(self, from_, target, onclause: Incomplete | None = None, isouter: bool = False, full: bool = False) -> Self: ... def outerjoin(self, target, onclause: Incomplete | None = None, full: bool = False): ... def get_final_froms(self): ... @property @@ -372,18 +371,18 @@ class Select( def inner_columns(self): ... def is_derived_from(self, fromclause): ... def get_children(self, **kwargs): ... - def add_columns(self: Self, *columns) -> Self: ... + def add_columns(self, *columns) -> Self: ... def column(self, column): ... def reduce_columns(self, only_synonyms: bool = True): ... - def with_only_columns(self: Self, *columns, **kw) -> Self: ... + def with_only_columns(self, *columns, **kw) -> Self: ... @property def whereclause(self): ... - def where(self: Self, *whereclause) -> Self: ... - def having(self: Self, having) -> Self: ... - def distinct(self: Self, *expr) -> Self: ... - def select_from(self: Self, *froms) -> Self: ... - def correlate(self: Self, *fromclauses) -> Self: ... - def correlate_except(self: Self, *fromclauses) -> Self: ... + def where(self, *whereclause) -> Self: ... + def having(self, having) -> Self: ... + def distinct(self, *expr) -> Self: ... + def select_from(self, *froms) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def correlate_except(self, *fromclauses) -> Self: ... @HasMemoized.memoized_attribute def selected_columns(self): ... def self_group(self, against: Incomplete | None = None): ... @@ -407,10 +406,10 @@ class ScalarSelect(roles.InElementRole, Generative, Grouping): def columns(self) -> None: ... @property def c(self): ... - def where(self: Self, crit) -> Self: ... + def where(self, crit) -> Self: ... def self_group(self, **kwargs): ... - def correlate(self: Self, *fromclauses) -> Self: ... - def correlate_except(self: Self, *fromclauses) -> Self: ... + def correlate(self, *fromclauses) -> Self: ... + def correlate_except(self, *fromclauses) -> Self: ... class Exists(UnaryExpression): inherit_cache: bool @@ -431,7 +430,7 @@ class TextualSelect(SelectBase): def __init__(self, text, columns, positional: bool = False) -> None: ... @HasMemoized.memoized_attribute def selected_columns(self): ... - def bindparams(self: Self, *binds, **bind_as_values) -> Self: ... + def bindparams(self, *binds, **bind_as_values) -> Self: ... TextAsFrom = TextualSelect diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index e32fec0eaee4..1db722caae9e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import TypeAlias +from typing_extensions import Self, TypeAlias from ..engine.interfaces import Connectable from ..engine.url import URL @@ -26,8 +26,8 @@ def reap_dbs(idents_file) -> None: ... class register(Generic[_F]): fns: dict[str, _F] @classmethod - def init(cls: type[Self], fn: _F) -> Self: ... - def for_db(self: Self, *dbnames: str) -> Callable[[_F], Self]: ... + def init(cls, fn: _F) -> Self: ... + def for_db(self, *dbnames: str) -> Callable[[_F], Self]: ... # Impossible to specify the args from the generic Callable in the current type system def __call__(self, cfg: str | URL, *arg: Any) -> str | URL | None: ... # AnyOf[str | URL | None] diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 888b12d8940d..41f17a7f9f34 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -1,7 +1,8 @@ import collections.abc -from _typeshed import Incomplete, Self, SupportsKeysAndGetItem +from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Iterable, Iterator, Mapping from typing import Any, Generic, NoReturn, TypeVar, overload +from typing_extensions import Self from ..cimmutabledict import immutabledict as immutabledict @@ -82,21 +83,21 @@ class OrderedSet(set[_T], Generic[_T]): def __getitem__(self, key: int) -> _T: ... def __iter__(self) -> Iterator[_T]: ... def __add__(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... - def update(self: Self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override] + def update(self, iterable: Iterable[_T]) -> Self: ... # type: ignore[override] __ior__ = update # type: ignore[assignment] def union(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... # type: ignore[override] __or__ = union # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] - def intersection(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def intersection(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __and__ = intersection # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] def symmetric_difference(self, other: Iterable[_S]) -> OrderedSet[_S | _T]: ... __xor__ = symmetric_difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] - def difference(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def difference(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __sub__ = difference # type: ignore[assignment] # pyright: ignore[reportGeneralTypeIssues] - def intersection_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def intersection_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __iand__ = intersection_update # type: ignore[assignment] - def symmetric_difference_update(self: Self, other: Iterable[_T]) -> Self: ... # type: ignore[override] + def symmetric_difference_update(self, other: Iterable[_T]) -> Self: ... # type: ignore[override] __ixor__ = symmetric_difference_update # type: ignore[assignment] - def difference_update(self: Self, other: Iterable[Any]) -> Self: ... # type: ignore[override] + def difference_update(self, other: Iterable[Any]) -> Self: ... # type: ignore[override] __isub__ = difference_update # type: ignore[assignment] class IdentitySet: diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index bd31f3201016..697ee035b1a2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete, Self +from _typeshed import Incomplete from collections.abc import Callable from typing import Any, Generic, TypeVar, overload +from typing_extensions import Self from . import compat @@ -70,7 +71,7 @@ class memoized_property(Generic[_R]): __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload - def __get__(self: Self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: object) -> Self: ... @overload def __get__(self, obj: object, cls: object) -> _R: ... @classmethod @@ -85,7 +86,7 @@ class HasMemoized: __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload - def __get__(self: Self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: object) -> Self: ... @overload def __get__(self, obj: object, cls: object) -> _R: ... @@ -119,7 +120,7 @@ class hybridproperty(Generic[_R]): def __get__(self, instance: None, owner: Any) -> _R: ... @overload def __get__(self, instance: object, owner: object) -> _R: ... - def classlevel(self: Self, func: Callable[..., _R]) -> Self: ... + def classlevel(self, func: Callable[..., _R]) -> Self: ... class hybridmethod: func: Any From d586c7b782d7142b4c0f2a6e6f57000a982d8ece Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 31 Mar 2023 15:53:39 -0400 Subject: [PATCH 22/25] Update usage of Unused --- stubs/SQLAlchemy/sqlalchemy/engine/url.pyi | 4 +-- stubs/SQLAlchemy/sqlalchemy/log.pyi | 5 +-- stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi | 4 +-- .../sqlalchemy/testing/provision.pyi | 31 +++++++++---------- .../sqlalchemy/util/_collections.pyi | 8 ++--- .../sqlalchemy/util/langhelpers.pyi | 10 +++--- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index 7725046071ba..f21e6f51a9eb 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsItems +from _typeshed import SupportsItems, Unused from collections.abc import Iterable, Mapping, Sequence from typing import Any, NamedTuple from typing_extensions import Self, TypeAlias @@ -50,7 +50,7 @@ class URL(_URLTuple): def __to_string__(self, hide_password: bool = True) -> str: ... def render_as_string(self, hide_password: bool = True) -> str: ... def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: object) -> Self: ... + def __deepcopy__(self, memo: Unused) -> Self: ... def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index a378fe47a5cc..dbfccc8092d5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import Unused from logging import Logger from typing import Any, TypeVar, overload from typing_extensions import Final, Literal, Self, TypeAlias @@ -44,7 +45,7 @@ def instance_logger(instance: Identified, echoflag: _EchoFlag = None) -> None: . class echo_property: __doc__: str @overload - def __get__(self, instance: None, owner: object) -> Self: ... + def __get__(self, instance: None, owner: Unused) -> Self: ... @overload - def __get__(self, instance: Identified, owner: object) -> _EchoFlag: ... + def __get__(self, instance: Identified, owner: Unused) -> _EchoFlag: ... def __set__(self, instance: Identified, value: _EchoFlag) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 16bb37733e64..55ebd2b52c7e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Any, ClassVar, TypeVar, overload from typing_extensions import TypeAlias @@ -28,7 +28,7 @@ _DeclarativeBaseMeta: TypeAlias = Callable[[str, tuple[type[Any], ...], dict[str def has_inherited_table(cls: type[Any]) -> bool: ... class DeclarativeMeta(type): - def __init__(cls, classname: str, bases: tuple[type[Any], ...], dict_: dict[str, Any], **kw: object) -> None: ... + def __init__(cls, classname: str, bases: tuple[type[Any], ...], dict_: dict[str, Any], **kw: Unused) -> None: ... def __setattr__(cls, key: str, value: Any) -> None: ... def __delattr__(cls, key: str) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi index 1db722caae9e..ab44e956128f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/provision.pyi @@ -1,14 +1,13 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from logging import Logger from typing import Any, Generic, NoReturn, TypeVar -from typing_extensions import Self, TypeAlias +from typing_extensions import Self from ..engine.interfaces import Connectable from ..engine.url import URL from ..testing.config import Config -_Unused: TypeAlias = object _S = TypeVar("_S", bound=str) _U = TypeVar("_U", bound=URL) _F = TypeVar("_F", bound=Callable[..., str | URL | None]) @@ -34,30 +33,30 @@ class register(Generic[_F]): @register.init def generate_driver_url(url: _U, driver: str, query_str: str) -> _U | None: ... @register.init -def drop_all_schema_objects_pre_tables(cfg: _Unused, eng: _Unused) -> None: ... +def drop_all_schema_objects_pre_tables(cfg: Unused, eng: Unused) -> None: ... @register.init -def drop_all_schema_objects_post_tables(cfg: _Unused, eng: _Unused) -> None: ... +def drop_all_schema_objects_post_tables(cfg: Unused, eng: Unused) -> None: ... @register.init -def create_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +def create_db(cfg: Unused, eng: Connectable, ident: Unused) -> NoReturn: ... @register.init -def drop_db(cfg: _Unused, eng: Connectable, ident: _Unused) -> NoReturn: ... +def drop_db(cfg: Unused, eng: Connectable, ident: Unused) -> NoReturn: ... @register.init -def update_db_opts(db_url: _Unused, db_opts: _Unused) -> None: ... +def update_db_opts(db_url: Unused, db_opts: Unused) -> None: ... @register.init -def post_configure_engine(url: _Unused, engine: _Unused, follower_ident: _Unused) -> None: ... +def post_configure_engine(url: Unused, engine: Unused, follower_ident: Unused) -> None: ... @register.init def follower_url_from_main(url: _U, ident: str) -> _U: ... @register.init -def configure_follower(cfg: _Unused, ident: _Unused) -> None: ... +def configure_follower(cfg: Unused, ident: Unused) -> None: ... @register.init -def run_reap_dbs(url: _Unused, ident: _Unused) -> None: ... +def run_reap_dbs(url: Unused, ident: Unused) -> None: ... @register.init -def temp_table_keyword_args(cfg: _Unused, eng: Connectable) -> NoReturn: ... +def temp_table_keyword_args(cfg: Unused, eng: Connectable) -> NoReturn: ... @register.init -def prepare_for_drop_tables(config: _Unused, connection: _Unused) -> None: ... +def prepare_for_drop_tables(config: Unused, connection: Unused) -> None: ... @register.init -def stop_test_class_outside_fixtures(config: _Unused, db: _Unused, testcls: _Unused) -> None: ... +def stop_test_class_outside_fixtures(config: Unused, db: Unused, testcls: Unused) -> None: ... @register.init # type: ignore[type-var] # False-positive, _S is bound to str -def get_temp_table_name(cfg: _Unused, eng: _Unused, base_name: _S) -> _S: ... +def get_temp_table_name(cfg: Unused, eng: Unused, base_name: _S) -> _S: ... @register.init -def set_default_schema_on_connection(cfg, dbapi_connection: _Unused, schema_name: _Unused) -> NoReturn: ... +def set_default_schema_on_connection(cfg, dbapi_connection: Unused, schema_name: Unused) -> NoReturn: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 41f17a7f9f34..a1f7f1772844 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -1,5 +1,5 @@ import collections.abc -from _typeshed import Incomplete, SupportsKeysAndGetItem +from _typeshed import Incomplete, SupportsKeysAndGetItem, Unused from collections.abc import Callable, Iterable, Iterator, Mapping from typing import Any, Generic, NoReturn, TypeVar, overload from typing_extensions import Self @@ -16,9 +16,9 @@ collections_abc = collections.abc EMPTY_SET: frozenset[Any] class ImmutableContainer: - def __delitem__(self, *arg: object, **kw: object) -> NoReturn: ... - def __setitem__(self, *arg: object, **kw: object) -> NoReturn: ... - def __setattr__(self, *arg: object, **kw: object) -> NoReturn: ... + def __delitem__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... + def __setitem__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... + def __setattr__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... @overload def coerce_to_immutabledict(d: None) -> immutabledict[Any, Any]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index 697ee035b1a2..286b5c7b1ef4 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Any, Generic, TypeVar, overload from typing_extensions import Self @@ -71,9 +71,9 @@ class memoized_property(Generic[_R]): __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload - def __get__(self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: Unused) -> Self: ... @overload - def __get__(self, obj: object, cls: object) -> _R: ... + def __get__(self, obj: object, cls: Unused) -> _R: ... @classmethod def reset(cls, obj: object, name: str) -> None: ... @@ -86,9 +86,9 @@ class HasMemoized: __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = None) -> None: ... @overload - def __get__(self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: Unused) -> Self: ... @overload - def __get__(self, obj: object, cls: object) -> _R: ... + def __get__(self, obj: object, cls: Unused) -> _R: ... @classmethod def memoized_instancemethod(cls, fn): ... From 6b1211e7f96efd461c52ad94a28eb39c799159ad Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 14 Apr 2023 20:58:33 -0400 Subject: [PATCH 23/25] Row.count and Row.index should not be represetned in stubs --- stubs/SQLAlchemy/@tests/stubtest_allowlist.txt | 6 ++++++ stubs/SQLAlchemy/sqlalchemy/engine/row.pyi | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index a19612c250db..aacd3b85a56e 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -14,6 +14,12 @@ sqlalchemy.engine.base.Engine.logging_name # initialized if not None sqlalchemy.sql.lambdas.PyWrapper.__clause_element__ sqlalchemy.testing.util.non_refcount_gc_collect +# potentially replaced at runtime +sqlalchemy.engine.Row.count +sqlalchemy.engine.Row.index +sqlalchemy.engine.row.Row.count +sqlalchemy.engine.row.Row.index + # abstract fields not present at runtime sqlalchemy.engine.Transaction.connection sqlalchemy.engine.Transaction.is_active diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi index 8cd077dd68b8..ccc6f336e61f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/row.pyi @@ -28,10 +28,6 @@ class Row(BaseRow, Sequence[Any], metaclass=ABCMeta): def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... def keys(self) -> list[str]: ... - @property - def count(self): ... - @property - def index(self): ... def __contains__(self, key): ... # The following methods are public, but have a leading underscore # to prevent conflicts with column names. From c878c6d8f8bb6ddc33cf21de6dc92c08b3b7e645 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 16 Apr 2023 19:35:25 -0400 Subject: [PATCH 24/25] Redundant `..sql` in imports --- stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi | 14 +++++++------- stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi index 1a02e1ff88da..cb5717f07643 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi @@ -2,9 +2,10 @@ from _typeshed import Incomplete from typing import TypeVar from ..schema import Table -from ..sql.compiler import _CompileLabel -from ..sql.crud import _multiparam_column -from ..sql.elements import ( +from ..util import immutabledict +from .compiler import _CompileLabel +from .crud import _multiparam_column +from .elements import ( AnnotatedColumnElement as _ElementsAnnotatedColumnElement, AsBoolean, BinaryExpression, @@ -36,7 +37,7 @@ from ..sql.elements import ( _label_reference, _textual_label_reference, ) -from ..sql.functions import ( +from .functions import ( AnsiFunction, Function, FunctionAsBinary, @@ -76,8 +77,8 @@ from ..sql.functions import ( sysdate, user, ) -from ..sql.schema import Column -from ..sql.selectable import ( +from .schema import Column +from .selectable import ( CTE, Alias, AliasedReturnsRows, @@ -95,7 +96,6 @@ from ..sql.selectable import ( Values, _OffsetLimitParam, ) -from ..util import immutabledict _T = TypeVar("_T") diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi index dfe53a8bf244..951f35774ec8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/type_api.pyi @@ -2,9 +2,9 @@ from _typeshed import Incomplete from typing import Any, Generic, TypeVar from .. import util -from ..sql.sqltypes import Boolean from . import operators from .base import SchemaEventTarget +from .sqltypes import Boolean from .visitors import Traversible, TraversibleType _T = TypeVar("_T") From f302543309d8313d31b8d905ac2d20dcfe6f3af0 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 26 Apr 2023 18:25:39 -0400 Subject: [PATCH 25/25] pytype exclude sqlalchemy/sql/annotation.pyi --- tests/pytype_exclude_list.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/pytype_exclude_list.txt b/tests/pytype_exclude_list.txt index ff83a0ce7990..765eae421805 100644 --- a/tests/pytype_exclude_list.txt +++ b/tests/pytype_exclude_list.txt @@ -191,3 +191,7 @@ stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi stubs/Flask-SQLAlchemy/flask_sqlalchemy/model.pyi stubs/Flask-SQLAlchemy/flask_sqlalchemy/utils.pyi + +# Uncertain why pytype is giving an error +# pytype.pytd.visitors.ContainerError +stubs/SQLAlchemy/sqlalchemy/sql/annotation.pyi