File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1657,13 +1657,16 @@ class' :attr:`~object.__dict__`.
16571657
16581658 .. note ::
16591659
1660- ``__set_name__ `` is only called implicitly as part of the ``type `` constructor, so
1661- it will need to be called explicitly with the appropriate parameters when a
1662- descriptor is added to a class after initial creation::
1660+ :meth: `__set_name__ ` is only called implicitly as part of the
1661+ :class: `type ` constructor, so it will need to be called explicitly with
1662+ the appropriate parameters when a descriptor is added to a class after
1663+ initial creation::
16631664
1665+ class A:
1666+ pass
16641667 descr = custom_descriptor()
1665- cls .attr = descr
1666- descr.__set_name__(cls , 'attr')
1668+ A .attr = descr
1669+ descr.__set_name__(A , 'attr')
16671670
16681671 See :ref: `class-object-creation ` for more details.
16691672
You can’t perform that action at this time.
0 commit comments