Author vstinner
Recipients christian.heimes, erlendaasland, pablogsal, serhiy.storchaka, shreyanavigyan, vstinner
Date 2021-04-30.14:12:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619791971.85.0.1788605094.issue43916@roundup.psfhosted.org>
In-reply-to
Content
Currently, 33 types explicitly set the Py_TPFLAGS_DISALLOW_INSTANTIATION flag:

* PyStdPrinter_Type
* _curses.ncurses_version type
* _curses_panel.panel
* _dbm.dbm
* _gdbm.gdbm
* _hashlib.HASH
* _hashlib.HASHXOF
* _hashlib.HMAC
* _multibytecodec.MultibyteCodec
* _sre..SRE_Scanner
* _thread._localdummy
* _thread.lock
* _tkinter.Tcl_Obj
* _tkinter.tkapp
* _tkinter.tktimertoken
* _winapi.Overlapped
* _xxsubinterpretersmodule.ChannelID
* array.arrayiterator
* functools.KeyWrapper
* functools._lru_list_elem
* os.DirEntry
* os.ScandirIterator
* pyexpat.xmlparser
* re.Match
* re.Pattern
* select.poll
* sys.flags type
* sys.getwindowsversion() type
* sys.version_info type
* unicodedata.UCD
* zlib.Compress
* zlib.Decompress
* _xxsubinterpreters.ChannelID

---

Static types with tp_base=NULL (or tp_base=&PyBaseObject_Type) and tp_new=NULL get Py_TPFLAGS_DISALLOW_INSTANTIATION flag automatically. Example of 70 static types which gets this flag automatically:

* CArgObject
* EncodingMap
* Generic
* GenericAlias
* PyCapsule
* TaskStepMethWrapper
* Token.MISSING
* _RunningLoopHolder
* _asyncio.FutureIter
* _ctypes.CThunkObject
* _ctypes.StructParam_Type
* _ctypes._CData
* _elementtree._element_iterator
* _io._BytesIOBuffer
* _pickle.Pdata
* _pickle.PicklerMemoProxy
* _pickle.UnpicklerMemoProxy
* _xxsubinterpreters.ChannelID
* anext_awaitable
* async_generator
* async_generator_asend
* async_generator_athrow
* async_generator_wrapped_value
* builtin_function_or_method
* bytearray_iterator
* bytes_iterator
* callable_iterator
* classmethod_descriptor
* coroutine
* coroutine_wrapper
* decimal.ContextManager
* dict_itemiterator
* dict_items
* dict_keyiterator
* dict_keys
* dict_reverseitemiterator
* dict_reversekeyiterator
* dict_reversevalueiterator
* dict_valueiterator
* dict_values
* fieldnameiterator
* formatteriterator
* frame
* generator
* getset_descriptor
* hamt_array_node
* hamt_bitmap_node
* hamt_collision_node
* items
* iterator
* keys
* list_iterator
* list_reverseiterator
* longrange_iterator
* managedbuffer
* member_descriptor
* method-wrapper
* method_descriptor
* moduledef
* odict_iterator
* range_iterator
* set_iterator
* str_iterator
* symtable entry
* tuple_iterator
* types.Union
* values
* weakcallableproxy
* weakproxy
* wrapper_descriptor
History
Date User Action Args
2021-04-30 14:12:51vstinnersetrecipients: + vstinner, christian.heimes, serhiy.storchaka, pablogsal, erlendaasland, shreyanavigyan
2021-04-30 14:12:51vstinnersetmessageid: <1619791971.85.0.1788605094.issue43916@roundup.psfhosted.org>
2021-04-30 14:12:51vstinnerlinkissue43916 messages
2021-04-30 14:12:51vstinnercreate