Use __new__ instead of __init__ for some builtin classes (#4555)

Closes #4514 #2630 #2686
This commit is contained in:
Sebastian Rittau
2020-09-30 09:00:06 +02:00
committed by GitHub
parent e3352c654d
commit 27dfbf68aa
3 changed files with 46 additions and 24 deletions

View File

@@ -412,6 +412,28 @@ zipfile.ZipExtFile.read
zipfile.ZipExtFile.readline
zlib.compressobj
# These enums derive from (int, IntEnum) or (str, Enum). Strangely,
# at runtime, they inherit Enum.__new__, not int.__new__ or
# str.__new__ as the mro would dictate, which is why stubtest balks.
enum.IntEnum.__new__
enum.IntFlag.__new__
http.HTTPStatus.__new__
inspect._ParameterKind.__new__
pstats.SortKey.__new__
re.RegexFlag.__new__
signal.Handlers.__new__
signal.Sigmasks.__new__
signal.Signals.__new__
socket.AddressFamily.__new__
socket.AddressInfo.__new__
socket.MsgFlag.__new__
socket.SocketKind.__new__
ssl.Options.__new__
ssl.TLSVersion.__new__
ssl.VerifyFlags.__new__
ssl.VerifyMode.__new__
tkinter.EventType.__new__
# ==========
# Whitelist entries that cannot or should not be fixed
# ==========