[issue26880] Remove redundant checks from set.__init__

Serhiy Storchaka report at bugs.python.org
Fri Apr 29 02:29:20 EDT 2016


New submission from Serhiy Storchaka:

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?

----------
assignee: rhettinger
components: Interpreter Core
files: set_init.patch
keywords: patch
messages: 264467
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove redundant checks from set.__init__
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file42644/set_init.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26880>
_______________________________________


More information about the Python-bugs-list mailing list