Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor edits to the Descriptor HowTo Guide #24901

Merged
merged 25 commits into from
Oct 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
58b799d
Fix wrong Sphinx markup preventing syntax highlighting
geryogam Mar 17, 2021
f77b0f9
Fix a bug in the ClassMethod Python equivalent
geryogam Mar 17, 2021
1dbd876
Fix the description of the ClassMethod Python equivalent
geryogam Mar 17, 2021
d0d301e
Raise TypeError for __get__(None, None) calls
geryogam Mar 19, 2021
e87fe37
Fix a typo
geryogam Mar 22, 2021
52a06d0
Use the existing cls variable
geryogam Mar 25, 2021
2f9971b
Allow keyword arguments in Object.__new__
geryogam Mar 31, 2021
2f335ca
Use two more super() for consistency
geryogam Mar 31, 2021
4886dbb
Add Object.__getattribute__ to raise AttributeError with the correct …
geryogam Mar 31, 2021
705c577
Allow attribute lookup from a class in Member.__get__
geryogam Mar 31, 2021
c0e6432
Allow keyword arguments in Type.__new__
geryogam Mar 31, 2021
81ec93c
Raise ValueError for slot names conflicting with class variables
geryogam Apr 1, 2021
34eef3a
Update descriptor.rst
geryogam Apr 1, 2021
ae8c622
Raise TypeError for non-empty __slots__ in subclasses of variable-len…
geryogam Apr 5, 2021
1d5fb96
Raise TypeError for non-empty __slots__ in subclasses of variable-len…
geryogam Apr 5, 2021
4671b91
Apply requested changes and remove changes on the slots emulation
geryogam May 10, 2022
0a132bf
Merge branch 'main' into patch-14
geryogam May 10, 2022
62fe4fc
Update descriptor.rst
geryogam May 10, 2022
1252f4b
Update descriptor.rst
geryogam May 10, 2022
58ae977
Update descriptor.rst
geryogam May 10, 2022
5630c64
Update descriptor.rst
geryogam May 10, 2022
bfb33f7
Merge branch 'main' into patch-14
geryogam May 10, 2022
5d45eaa
Revert the two-argument form of super() and forward variadic arguments
geryogam Oct 4, 2022
c853e6b
Merge branch 'main' into patch-14
rhettinger Oct 7, 2022
bcc9da0
Update descriptor.rst
geryogam Oct 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Raise TypeError for non-empty __slots__ in subclasses of variable-len…
…gth built-in types (int, tuple, bytes)
  • Loading branch information
geryogam authored Apr 5, 2021
commit 1d5fb9656848fcf823f4bf59b709c61d0f91f2f0
3 changes: 1 addition & 2 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1477,10 +1477,9 @@ variables:
# type_new() calls PyTypeReady() which calls add_methods()
slot_names = mapping.get('slot_names', [])
if slot_names:
variable_length = {int, tuple, bytes}
for base in bases:
for cls in base.__mro__:
if cls in variable_length:
if cls.__itemsize__:
raise TypeError(
f'nonempty __slots__ not supported for '
f'subtype of {cls.__name__!r}'
Expand Down