Set Objects — Python 3.14.7 documentation

docs.python.org

Tin mới

Dictionary Objects

Python Module Index

3.14.7 Documentation

Python/C API reference manual

Concrete Objects Layer

PyObject_CallMethod()

This is an instance of PyTypeObject representing the Python set type.

PyObject_RichCompareBool()

This is an instance of PyTypeObject representing the Python set type.

PyNumber_Subtract()

This is an instance of PyTypeObject representing the Python set type.

Safe for concurrent use on the same object

Return a new set containing objects returned by the iterable. The iterable may be NULL to create a new empty set. Return the new set on success or NULL on failure. Raise TypeError if iterable is not actually iterable. Th

object.__contains__

Return 1 if found, 0 if not found, and -1 if an error is encountered. Unlike the Python __contains__() method, this function does not automatically convert unhashable sets into temporary frozensets. Raise a TypeError if

free-threaded build

In the free-threaded build, the set is emptied before its entries are cleared, so other threads will observe an empty set rather than intermediate states.