Returns a description of the trait.
(self)
| 2159 | self.error(obj, value) |
| 2160 | |
| 2161 | def info(self) -> str: |
| 2162 | """Returns a description of the trait.""" |
| 2163 | if isinstance(self.klass, str): |
| 2164 | klass = self.klass |
| 2165 | else: |
| 2166 | klass = self.klass.__module__ + "." + self.klass.__name__ |
| 2167 | result = "a subclass of '%s'" % klass |
| 2168 | if self.allow_none: |
| 2169 | return result + " or None" |
| 2170 | return result |
| 2171 | |
| 2172 | def instance_init(self, obj: t.Any) -> None: |
| 2173 | # we can't do this in subclass_init because that |
no outgoing calls