MCPcopy Create free account
hub / github.com/ipython/traitlets / has_trait

Method has_trait

traitlets/traitlets.py:1832–1834  ·  view source on GitHub ↗

Returns True if the object has a trait with the specified name.

(self, name: str)

Source from the content-addressed store, hash-verified

1830 }
1831
1832 def has_trait(self, name: str) -> bool:
1833 """Returns True if the object has a trait with the specified name."""
1834 return name in self._traits
1835
1836 def trait_has_value(self, name: str) -> bool:
1837 """Returns True if the specified trait has a value.

Callers 4

__init__Method · 0.95
set_traitMethod · 0.95
trait_defaultsMethod · 0.95
test_trait_namesMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_trait_namesMethod · 0.64