steve-mavens

Results 38 comments of steve-mavens

Yes, I think the basic problem here is that `TypeIs` requires a clean division of types. It doesn't allow for a function that takes input type `A | B |...

One workaround for users would be `math.isnan(x) if isinstance(x, float) else pd.isna(x)`, but obviously there's some performance implications there. It's probably better to suppress the unreachable warning than take the...

Also, there are allowed to be float NaN values distinct from `float('nan')`, so it could still go wrong in even rarer cases. Is there a way to import `pandas.api.typing.NAType` (or...

So, another workaround is to make sure variables/expressions that might contain a float NaN are typed as `float | NAType`, or `float | None`, so that mypy doesn't think the...

Great, thanks for your help. I'll probably use `None` until `NAType` is public in the stubs, since either way I just need to tell mypy that `pd.isna` might return True.

Another possible approach, which I haven't thought through but might be worth considering. Permit passing an iterable of key-value pairs for `fields`, as well as permitting a dictionary. `Iterable`'s type...

Since there might be many calls, and in general the user might not be able to tell in advance how many: if/when you go ahead with this I'd suggest either...

Thanks for explaining the current status. It might be that the types for the parts I use are good enough, and then if mypy fixes https://github.com/python/mypy/issues/8545 I'll be sorted :-)