Skip to content

Commit d1959d2

Browse files
committed
change title of added reference
1 parent bff3522 commit d1959d2

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,7 @@ automatic property creation, proxies, frameworks, and automatic resource
29112911
locking/synchronization.
29122912

29132913

2914-
.. _custom-instance-subclass:
2914+
.. _customize-instance-subclass-checks:
29152915

29162916
Customizing instance and subclass checks
29172917
----------------------------------------

Doc/tools/extensions/pydoc_topics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"continue",
4848
"conversions",
4949
"customization",
50-
"custom-instance-subclass",
50+
"customize-instance-subclass-checks",
5151
"debugger",
5252
"del",
5353
"dict",

Lib/pydoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,7 @@ def collect_dunders(symbols):
18801880
'__instancecheck__', '__subclasscheck__'
18811881
]
18821882
for d in instance_dunders:
1883-
dunders[d] = ('custom-instance-subclass', 'SPECIALNAMES')
1883+
dunders[d] = ('customize-instance-subclass-checks', 'SPECIALNAMES')
18841884

18851885
sequence_dunders = [
18861886
'__len__', '__length_hint__', '__getitem__', '__setitem__',

Lib/pydoc_data/topics.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Autogenerated by Sphinx on Mon Aug 18 00:55:48 2025
1+
# Autogenerated by Sphinx on Mon Aug 18 01:09:13 2025
22
# as part of the release process.
33

44
topics = {
@@ -4083,43 +4083,6 @@ def f() -> annotation: ...
40834083
Some additional rules apply for certain operators (e.g., a string as a
40844084
left argument to the ‘%’ operator). Extensions must define their own
40854085
conversion behavior.
4086-
''',
4087-
'custom-instance-subclass': r'''Customizing instance and subclass checks
4088-
****************************************
4089-
4090-
The following methods are used to override the default behavior of the
4091-
"isinstance()" and "issubclass()" built-in functions.
4092-
4093-
In particular, the metaclass "abc.ABCMeta" implements these methods in
4094-
order to allow the addition of Abstract Base Classes (ABCs) as
4095-
“virtual base classes” to any class or type (including built-in
4096-
types), including other ABCs.
4097-
4098-
type.__instancecheck__(self, instance)
4099-
4100-
Return true if *instance* should be considered a (direct or
4101-
indirect) instance of *class*. If defined, called to implement
4102-
"isinstance(instance, class)".
4103-
4104-
type.__subclasscheck__(self, subclass)
4105-
4106-
Return true if *subclass* should be considered a (direct or
4107-
indirect) subclass of *class*. If defined, called to implement
4108-
"issubclass(subclass, class)".
4109-
4110-
Note that these methods are looked up on the type (metaclass) of a
4111-
class. They cannot be defined as class methods in the actual class.
4112-
This is consistent with the lookup of special methods that are called
4113-
on instances, only in this case the instance is itself a class.
4114-
4115-
See also:
4116-
4117-
**PEP 3119** - Introducing Abstract Base Classes
4118-
Includes the specification for customizing "isinstance()" and
4119-
"issubclass()" behavior through "__instancecheck__()" and
4120-
"__subclasscheck__()", with motivation for this functionality in
4121-
the context of adding Abstract Base Classes (see the "abc"
4122-
module) to the language.
41234086
''',
41244087
'customization': r'''Basic customization
41254088
*******************
@@ -4429,6 +4392,43 @@ def __hash__(self):
44294392
considered true if its result is nonzero. If a class defines
44304393
neither "__len__()" nor "__bool__()" (which is true of the "object"
44314394
class itself), all its instances are considered true.
4395+
''',
4396+
'customize-instance-subclass-checks': r'''Customizing instance and subclass checks
4397+
****************************************
4398+
4399+
The following methods are used to override the default behavior of the
4400+
"isinstance()" and "issubclass()" built-in functions.
4401+
4402+
In particular, the metaclass "abc.ABCMeta" implements these methods in
4403+
order to allow the addition of Abstract Base Classes (ABCs) as
4404+
“virtual base classes” to any class or type (including built-in
4405+
types), including other ABCs.
4406+
4407+
type.__instancecheck__(self, instance)
4408+
4409+
Return true if *instance* should be considered a (direct or
4410+
indirect) instance of *class*. If defined, called to implement
4411+
"isinstance(instance, class)".
4412+
4413+
type.__subclasscheck__(self, subclass)
4414+
4415+
Return true if *subclass* should be considered a (direct or
4416+
indirect) subclass of *class*. If defined, called to implement
4417+
"issubclass(subclass, class)".
4418+
4419+
Note that these methods are looked up on the type (metaclass) of a
4420+
class. They cannot be defined as class methods in the actual class.
4421+
This is consistent with the lookup of special methods that are called
4422+
on instances, only in this case the instance is itself a class.
4423+
4424+
See also:
4425+
4426+
**PEP 3119** - Introducing Abstract Base Classes
4427+
Includes the specification for customizing "isinstance()" and
4428+
"issubclass()" behavior through "__instancecheck__()" and
4429+
"__subclasscheck__()", with motivation for this functionality in
4430+
the context of adding Abstract Base Classes (see the "abc"
4431+
module) to the language.
44324432
''',
44334433
'debugger': r'''"pdb" — The Python Debugger
44344434
***************************

0 commit comments

Comments
 (0)