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

Class CBytes

traitlets/traitlets.py:2900–2907  ·  view source on GitHub ↗

A casting version of the byte string trait.

Source from the content-addressed store, hash-verified

2898
2899
2900class CBytes(Bytes, TraitType[bytes, t.Any]):
2901 """A casting version of the byte string trait."""
2902
2903 def validate(self, obj: t.Any, value: t.Any) -> bytes | None:
2904 try:
2905 return bytes(value)
2906 except Exception:
2907 self.error(obj, value)
2908
2909
2910class Unicode(TraitType[G, S]):

Callers 2

test_invalid_argsMethod · 0.90
test_invalid_argsMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_invalid_argsMethod · 0.72
test_invalid_argsMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…