<@UB2J9BQA0> is there a reason `SpecsParser.parse_...
# development
h
@hundreds-father-404 is there a reason
SpecsParser.parse_spec
has return type
Union[AddressSpec, FilesystemSpec]
instead of just
Spec
?
h
Yep, because then when we do
isinstance(AddressSpec)
, MyPy knows if that's not true it would be a
FilesystemSpec
h
so mypy in general doesn't assume it knows about all subclasses of a class that might exist?
h
exactly, because it cannot do that. So we would need to do:
Copy code
if isinstance(AddressSpec):
  ...
elif isinstance(FilesystemSpec):
  ...
else:
  raise Unexpected