Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ with_exc
Method
with_exc
Lib/test/test_capi/test_number.py:37–42 ·
view source on GitHub ↗
(cls, exc)
Source
from the content-addressed store, hash-verified
35
36
@classmethod
37
def
with_exc(cls, exc):
38
obj = super().__new__(cls)
39
obj.val = None
40
obj.exc = exc
41
setattr(cls, cls.methname, cls._meth)
42
return
obj
43
44
class
HasBadAttr:
45
def
__new__(cls):
Callers
3
test_long
Method · 0.80
test_float
Method · 0.80
test_index
Method · 0.80
Calls
2
super
Class · 0.85
__new__
Method · 0.45
Tested by
no test coverage detected