Skip to content

Fix incorrect use of Any #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ordered_set/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
OrderedSetInitializer = Union[AbstractSet[T], Sequence[T], Iterable[T]]


def _is_atomic(obj: Any) -> bool:
def _is_atomic(obj: object) -> bool:
"""
Returns True for objects which are iterable but should not be iterated in
the context of indexing an OrderedSet.
Expand Down Expand Up @@ -71,7 +71,7 @@ def __init__(self, initial: OrderedSetInitializer[T] = None):
# support as values for `initial`.
self |= initial # type: ignore

def __len__(self):
def __len__(self) -> int:
"""
Returns the number of unique elements in the ordered set

Expand Down Expand Up @@ -162,7 +162,7 @@ def __setstate__(self, state):
else:
self.__init__(state)

def __contains__(self, key: Any) -> bool:
def __contains__(self, key: object) -> bool:
"""
Test if the item is in this ordered set.

Expand Down Expand Up @@ -250,7 +250,7 @@ def index(self, key):
get_loc = index
get_indexer = index

def pop(self, index=-1) -> T:
def pop(self, index: int = -1) -> T:
"""
Remove and return item at index (default last).

Expand Down Expand Up @@ -322,7 +322,7 @@ def __repr__(self) -> str:
return "%s()" % (self.__class__.__name__,)
return "%s(%r)" % (self.__class__.__name__, list(self))

def __eq__(self, other: Any) -> bool:
def __eq__(self, other: object) -> bool:
"""
Returns true if the containers have the same items. If `other` is a
Sequence, then order is checked, otherwise it is ignored.
Expand Down