This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Remove redundant checks from set.__init__
Type: performance Stage: resolved
Components: Interpreter Core Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, rhettinger, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-04-29 06:29 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
set_init.patch serhiy.storchaka, 2016-04-29 06:29 review
Messages (3)
msg264467 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-04-29 06:29
set.__init__ have checks PyAnySet_Check(self) and PySet_Check(self). They are redundant since set.__init__ can't be called for non-set.

>>> set.__init__(frozenset(), ())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: descriptor '__init__' requires a 'set' object but received a 'frozenset'

Do I miss something?
msg264474 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-04-29 08:11
LGTM
msg264477 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-29 08:32
New changeset ed6345cb08ab by Serhiy Storchaka in branch 'default':
Issue #26880: Removed redundant checks in set.__init__.
https://hg.python.org/cpython/rev/ed6345cb08ab
History
Date User Action Args
2022-04-11 14:58:30adminsetgithub: 71067
2016-04-29 08:32:40serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-04-29 08:32:22python-devsetnosy: + python-dev
messages: + msg264477
2016-04-29 08:11:10rhettingersetassignee: rhettinger -> serhiy.storchaka
messages: + msg264474
2016-04-29 06:29:20serhiy.storchakacreate