Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pdb.Pdb.do_exceptions
pdb.Pdb.interaction
pdb.Pdb.message
pdb.Pdb.user_opcode
# `__replace__` to be special cased in dataclasses
Comment thread
max-muoto marked this conversation as resolved.
pstats.FunctionProfile.__replace__
pstats.StatsProfile.__replace__
pydoc.pager
Expand Down Expand Up @@ -156,9 +157,7 @@ tkinter.PhotoImage.zoom
tkinter.Text.count
tkinter.Wm.wm_attributes
trace.CoverageResults.write_results
types.CodeType.__replace__
types.MappingProxyType.get
types.SimpleNamespace.__replace__
unittest.IsolatedAsyncioTestCase.loop_factory
unittest.TestProgram.usageExit
unittest.__all__
Expand Down
11 changes: 8 additions & 3 deletions stdlib/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class CodeType:
co_qualname: str = ...,
co_linetable: bytes = ...,
co_exceptiontable: bytes = ...,
) -> CodeType: ...
) -> Self: ...
elif sys.version_info >= (3, 10):
def replace(
self,
Expand All @@ -266,7 +266,7 @@ class CodeType:
co_filename: str = ...,
co_name: str = ...,
co_linetable: bytes = ...,
) -> CodeType: ...
) -> Self: ...
else:
def replace(
self,
Expand All @@ -287,7 +287,10 @@ class CodeType:
co_filename: str = ...,
co_name: str = ...,
co_lnotab: bytes = ...,
) -> CodeType: ...
) -> Self: ...

if sys.version_info >= (3, 13):
__replace__ = replace

@final
class MappingProxyType(Mapping[_KT, _VT_co]):
Expand All @@ -314,6 +317,8 @@ class SimpleNamespace:
def __getattribute__(self, name: str, /) -> Any: ...
def __setattr__(self, name: str, value: Any, /) -> None: ...
def __delattr__(self, name: str, /) -> None: ...
if sys.version_info >= (3, 13):
def __replace__(self, **kwargs: Any) -> Self: ...

class ModuleType:
__name__: str
Expand Down