inducer / arraycontext

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

Rename `ArrayContainerT` #81

Closed majosm closed 3 years ago

majosm commented 3 years ago

Closes #80.

I noticed a couple of spots where it makes sense (I think) to require containers, so I also added a ContainerT in addition to ArrayOrContainerT.

majosm commented 3 years ago

I had to remove a couple of the ContainerT usage instances to fix mypy failures, so it's maybe a little less useful than I thought. I don't suppose there's a way to indicate that a ContainerT is also an ArrayOrContainerT? I think that's (at least partially) what's throwing mypy off.

majosm commented 3 years ago

I wonder if I could do something like:

ArrayT = TypeVar("ArrayT")
ContainerT = TypeVar("ContainerT")
ArrayOrContainerT = Union[ArrayT, ContainerT]

?

majosm commented 3 years ago

That seems to work. Is it OK to add ArrayT? (Should I put it somewhere other than arraycontext.container?)