A casting version of the byte string trait.
| 2898 | |
| 2899 | |
| 2900 | class 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 | |
| 2910 | class Unicode(TraitType[G, S]): |
no outgoing calls
searching dependent graphs…