Skip to content

Commit 09ca954

Browse files
perf: opt out instance_init for bool and enum
1 parent 5bb5924 commit 09ca954

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

traitlets/traitlets.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,6 +2616,9 @@ def from_string(self, s):
26162616
else:
26172617
raise ValueError("%r is not 1, 0, true, or false")
26182618

2619+
def subclass_init(self, cls):
2620+
pass # fully opt out of instance_init
2621+
26192622

26202623
class CBool(Bool):
26212624
"""A casting version of the boolean trait."""
@@ -2667,6 +2670,9 @@ def from_string(self, s):
26672670
except TraitError:
26682671
return _safe_literal_eval(s)
26692672

2673+
def subclass_init(self, cls):
2674+
pass # fully opt out of instance_init
2675+
26702676

26712677
class CaselessStrEnum(Enum):
26722678
"""An enum of strings where the case should be ignored."""

0 commit comments

Comments
 (0)