Skip to content

canonicalized set/frozenset signatures#15470

Merged
srittau merged 1 commit intopython:mainfrom
randolf-scholz:set_signatures
Mar 2, 2026
Merged

canonicalized set/frozenset signatures#15470
srittau merged 1 commit intopython:mainfrom
randolf-scholz:set_signatures

Conversation

@randolf-scholz
Copy link
Contributor

@randolf-scholz randolf-scholz commented Feb 28, 2026

Partially Fixes #15271

This PR addressed set/frozenset methods. I replaced Iterable[Any] with iterable[object] as per discussion in #15297

  • Fixed set.discard only accepting T rather than object
  • Fixed set.{difference, difference_update, intersection, intersection_update, isdisjoint, issubset, issuperset} only accepting Iterable[T] rather than Iterable[object]
  • Fixed set.symmetric_difference only accepting Iterable[T] rather than Iterable[S]
  • Fixed frozenset.{isdisjoint, __and__} only accepting Iterable[T] rather than Iterable[object]
  • Fixed frozenset.{__xor__, symmetric_difference} only accepting Iterable[T] rather than Iterable[S]

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! These all look reasonable.

@srittau srittau merged commit e8638cd into python:main Mar 2, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Several methods on built-in types are too strict.

2 participants