inducer / arraycontext

Choose your favorite numpy-workalike!
6 stars 11 forks source link

Convert some is_array_container_type checks #112

Closed alexfikl closed 3 years ago

alexfikl commented 3 years ago

Converts most of the is_array_container_type checks to use try: serialize except: ... instead, so that the various traversal functions do the same thing.

Fixes #28

inducer commented 3 years ago

The more I read the except TypeError pattern, the more I am concerned about how unspecific it is. I agree with your idea of introducing a more specific

class NotAnArrayContainerError(TypeError):  # or some such
    pass

This'll also make all this code a bit more readable. Are you open to doing this as part of this PR?

alexfikl commented 3 years ago

This'll also make all this code a bit more readable. Are you open to doing this as part of this PR?

Completely agree. I'll make the changes.

inducer commented 3 years ago

LGTM, thanks!