I know you can assert a type struct like this (althought its more a module assert):
assert foo.__struct__ == Foo
But is there a more elegant way to do this? something like:
assert type(foo) == %Foo{}
Aucun commentaire:
Enregistrer un commentaire