Convert plain set to instance of this class.
(cls, index: str, value: Any)
| 1061 | |
| 1062 | @classmethod |
| 1063 | def coerce(cls, index: str, value: Any) -> Optional[MutableSet[_T]]: |
| 1064 | """Convert plain set to instance of this class.""" |
| 1065 | if not isinstance(value, cls): |
| 1066 | if isinstance(value, set): |
| 1067 | return cls(value) |
| 1068 | return Mutable.coerce(index, value) |
| 1069 | else: |
| 1070 | return value |
| 1071 | |
| 1072 | def __getstate__(self) -> Set[_T]: |
| 1073 | return set(self) |