File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
@tests/stubtest_allowlists Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ pdb.Pdb.do_exceptions
116116pdb.Pdb.interaction
117117pdb.Pdb.message
118118pdb.Pdb.user_opcode
119+ # `__replace__` to be special cased in dataclasses
119120pstats.FunctionProfile.__replace__
120121pstats.StatsProfile.__replace__
121122pydoc.pager
@@ -156,9 +157,7 @@ tkinter.PhotoImage.zoom
156157tkinter.Text.count
157158tkinter.Wm.wm_attributes
158159trace.CoverageResults.write_results
159- types.CodeType.__replace__
160160types.MappingProxyType.get
161- types.SimpleNamespace.__replace__
162161unittest.IsolatedAsyncioTestCase.loop_factory
163162unittest.TestProgram.usageExit
164163unittest.__all__
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ class CodeType:
245245 co_qualname : str = ...,
246246 co_linetable : bytes = ...,
247247 co_exceptiontable : bytes = ...,
248- ) -> CodeType : ...
248+ ) -> Self : ...
249249 elif sys .version_info >= (3 , 10 ):
250250 def replace (
251251 self ,
@@ -266,7 +266,7 @@ class CodeType:
266266 co_filename : str = ...,
267267 co_name : str = ...,
268268 co_linetable : bytes = ...,
269- ) -> CodeType : ...
269+ ) -> Self : ...
270270 else :
271271 def replace (
272272 self ,
@@ -287,7 +287,10 @@ class CodeType:
287287 co_filename : str = ...,
288288 co_name : str = ...,
289289 co_lnotab : bytes = ...,
290- ) -> CodeType : ...
290+ ) -> Self : ...
291+
292+ if sys .version_info >= (3 , 13 ):
293+ __replace__ = replace
291294
292295@final
293296class MappingProxyType (Mapping [_KT , _VT_co ]):
@@ -314,6 +317,8 @@ class SimpleNamespace:
314317 def __getattribute__ (self , name : str , / ) -> Any : ...
315318 def __setattr__ (self , name : str , value : Any , / ) -> None : ...
316319 def __delattr__ (self , name : str , / ) -> None : ...
320+ if sys .version_info >= (3 , 13 ):
321+ def __replace__ (self , ** kwargs : Any ) -> Self : ...
317322
318323class ModuleType :
319324 __name__ : str
You can’t perform that action at this time.
0 commit comments