Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Sep 25, 2024
1 parent 6477766 commit 8f38531
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
:attr:`~type.__name__` attribute.

If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is made accessible as the
:attr:`~type.__name__` attribute, and the :attr:`~class.__module__` attribute is undefined
:attr:`~type.__name__` attribute, and the :attr:`~type.__module__` attribute is undefined
(unless explicitly set in the dictionary, as explained above). This means your
type will be impossible to pickle. Additionally, it will not be listed in
module documentations created with pydoc.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pickle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ a given class::
unpickled_class = pickle.loads(f.getvalue())

assert isinstance(unpickled_class, type)
assert unpickled_type.__name__ == "MyClass"
assert unpickled_class.__name__ == "MyClass"
assert unpickled_class.my_attribute == 1


Expand Down
2 changes: 1 addition & 1 deletion Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,7 @@ Preparing the class namespace

Once the appropriate metaclass has been identified, then the class namespace
is prepared. If the metaclass has a ``__prepare__`` attribute, it is called
as ``namespace = metatype.__prepare__(name, bases, **kwds)`` (where the
as ``namespace = metaclass.__prepare__(name, bases, **kwds)`` (where the
additional keyword arguments, if any, come from the class definition). The
``__prepare__`` method should be implemented as a
:func:`classmethod <classmethod>`. The
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
<type '_socket.socket'>

* One of the noted incompatibilities between old- and new-style classes has been
removed: you can now assign to the :attr:`~type.__name__` and :attr:`~class.__bases__`
removed: you can now assign to the :attr:`~type.__name__` and :attr:`~type.__bases__`
attributes of new-style classes. There are some restrictions on what can be
assigned to :attr:`!__bases__` along the lines of those relating to assigning to
an instance's :attr:`~object.__class__` attribute.
Expand Down

0 comments on commit 8f38531

Please sign in to comment.