Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7cc2282

Browse filesBrowse files
authored
[ctypes] Add note about atypical classmethod behavior (#10795)
1 parent b76b2af commit 7cc2282
Copy full SHA for 7cc2282

1 file changed

+6Lines changed: 6 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎stdlib/_ctypes.pyi‎

Copy file name to clipboardExpand all lines: stdlib/_ctypes.pyi
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ class _CData(metaclass=_CDataMeta):
5656
_b_base_: int
5757
_b_needsfree_: bool
5858
_objects: Mapping[Any, int] | None
59+
# At runtime the following classmethods are available only on classes, not
60+
# on instances. This can't be reflected properly in the type system:
61+
#
62+
# Structure.from_buffer(...) # valid at runtime
63+
# Structure(...).from_buffer(...) # invalid at runtime
64+
#
5965
@classmethod
6066
def from_buffer(cls, source: WriteableBuffer, offset: int = ...) -> Self: ...
6167
@classmethod

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.