From 04ae11cdd0129c8e378bb6ce39b94dd2dbe7fe21 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 9 Nov 2022 17:53:42 +0300 Subject: [PATCH] All `__nonzero__` are methods that return `bool` (#9139) --- stubs/SQLAlchemy/sqlalchemy/event/attr.pyi | 4 ++-- stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi | 4 ++-- stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi | 4 ++-- stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi | 2 +- stubs/cffi/cffi/backend_ctypes.pyi | 2 +- stubs/peewee/peewee.pyi | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi b/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi index 36c7033a7..5f03e16bc 100644 --- a/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/event/attr.pyi @@ -46,7 +46,7 @@ class _EmptyListener(_InstanceLevelDispatch): def __len__(self) -> int: ... def __iter__(self): ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... class _CompoundListener(_InstanceLevelDispatch): def exec_once(self, *args, **kw) -> None: ... @@ -55,7 +55,7 @@ class _CompoundListener(_InstanceLevelDispatch): def __len__(self) -> int: ... def __iter__(self): ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... class _ListenerCollection(_CompoundListener): parent_listeners: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi index db13af90a..3b527c5c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/ext/associationproxy.pyi @@ -97,7 +97,7 @@ class _AssociationCollection: def col(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... class _AssociationList(_AssociationCollection): def __getitem__(self, index): ... @@ -163,7 +163,7 @@ class _AssociationDict(_AssociationCollection): class _AssociationSet(_AssociationCollection): def __len__(self) -> int: ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... def __contains__(self, value): ... def __iter__(self): ... def add(self, value) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi index 87c6e00c6..88e136e44 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/attributes.pyi @@ -208,7 +208,7 @@ def backref_listeners(attribute, key, uselist): ... class History: def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... def empty(self): ... def sum(self): ... def non_deleted(self): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi index 5fa636573..ef4c64165 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/collections.pyi @@ -74,7 +74,7 @@ class CollectionAdapter: def __iter__(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... def fire_append_wo_mutation_event(self, item, initiator: Any | None = ...): ... def fire_append_event(self, item, initiator: Any | None = ...): ... def fire_remove_event(self, item, initiator: Any | None = ...) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi index 52651c7e9..d68b5dfc6 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/dynamic.pyi @@ -51,7 +51,7 @@ class DynamicCollectionAdapter: def __iter__(self): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... class AppenderMixin: query_class: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi index 1909ed7cf..4db3200c5 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/instrumentation.pyi @@ -58,7 +58,7 @@ class ClassManager(HasMemoized, dict[Any, Any]): def has_state(self, instance): ... def has_parent(self, state, key, optimistic: bool = ...): ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... class _SerializeManager: class_: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi index e3964d140..2750e6d97 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/path_registry.pyi @@ -94,7 +94,7 @@ class AbstractEntityRegistry(PathRegistry): @property def mapper(self): ... def __bool__(self) -> bool: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... def __getitem__(self, entity): ... class SlotsEntityRegistry(AbstractEntityRegistry): diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi index be3f6016b..4ab36b9d7 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi @@ -34,7 +34,7 @@ class ClauseElement(roles.SQLRole, SupportsWrappingAnnotations, MemoizedHasCache def compile(self, bind: Any | None = ..., dialect: Any | None = ..., **kw): ... def __invert__(self): ... def __bool__(self) -> None: ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... class ColumnElement( roles.ColumnArgumentOrKeyRole, @@ -285,7 +285,7 @@ class BinaryExpression(ColumnElement[Any]): self, left, right, operator, type_: Any | None = ..., negate: Any | None = ..., modifiers: Any | None = ... ) -> None: ... def __bool__(self): ... - __nonzero__: Any + def __nonzero__(self) -> bool: ... @property def is_comparison(self): ... def self_group(self, against: Any | None = ...): ... diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi index 3bef98404..4b77d78af 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/lambdas.pyi @@ -107,7 +107,7 @@ class PyWrapper(ColumnOperators[_T], Generic[_T]): def reverse_operate(self, op, other, **kwargs): ... def __clause_element__(self): ... def __bool__(self) -> bool: ... - def __nonzero__(self): ... + def __nonzero__(self) -> bool: ... def __getattribute__(self, key): ... def __iter__(self): ... def __getitem__(self, key) -> ColumnOperators[_T]: ... diff --git a/stubs/cffi/cffi/backend_ctypes.pyi b/stubs/cffi/cffi/backend_ctypes.pyi index 5c361ce96..32c66b8c6 100644 --- a/stubs/cffi/cffi/backend_ctypes.pyi +++ b/stubs/cffi/cffi/backend_ctypes.pyi @@ -29,7 +29,7 @@ class CTypesGenericArray(CTypesData): class CTypesGenericPtr(CTypesData): kind: str - def __nonzero__(self): ... + def __nonzero__(self) -> bool: ... def __bool__(self) -> bool: ... class CTypesBaseStructOrUnion(CTypesData): ... diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index 9d44fdf18..fbd8d9566 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -1534,7 +1534,7 @@ class ModelBase(type): def __contains__(self, key): ... def __len__(self) -> int: ... def __bool__(self) -> bool: ... - __nonzero__: Incomplete + def __nonzero__(self) -> bool: ... def __sql__(self, ctx): ... class _BoundModelsContext(_callable_context_manager):