Removes NoneTypes from Unions when strict Optional checking is off.
(self)
| 3379 | return visitor.visit_union_type(self) |
| 3380 | |
| 3381 | def relevant_items(self) -> list[Type]: |
| 3382 | """Removes NoneTypes from Unions when strict Optional checking is off.""" |
| 3383 | if state.strict_optional: |
| 3384 | return self.items |
| 3385 | else: |
| 3386 | return [i for i in self.items if not isinstance(get_proper_type(i), NoneType)] |
| 3387 | |
| 3388 | def serialize(self) -> JsonDict: |
| 3389 | return { |
no test coverage detected