[Numpy-discussion] mypy occasional error on _UnknownType in _array_like.py since 1.22 or 1.23

2022-10-10 Thread Nick Gerner
I upgraded from 1.21 to 1.23.3 recently and got a variety of mypy issues. I
seem to have resolved all of them, but I occasionally still see this show
up:

.venv/lib/python3.10/site-packages/numpy/_typing/_array_like.py:153: error:
Type argument "_UnknownType" of "dtype" must be a subtype of "generic"
 [type-var]

On mypy 0.981 this is not 100% repro and if I restart dmypy it goes away...
until it comes back. I just now upgraded to mypy 0.982 and didn't get it on
one run, at least not right away. Maybe this was some kind of mypy issue,
but time will tell.

I haven't seen exactly this error getting posted anywhere. I know this is a
fairly recent change and it looks like there's a lot of type hinting work
going on (excellent work! I love it, thank you numpy devs!).

Anyone else got any insight on what's going on here? Is this a known issue?
Is this a mypy issue?

Thanks everyone.

--Nick
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: mypy occasional error on _UnknownType in _array_like.py since 1.22 or 1.23

2022-10-10 Thread Charles R Harris
On Mon, Oct 10, 2022 at 12:27 PM Nick Gerner  wrote:

> I upgraded from 1.21 to 1.23.3 recently and got a variety of mypy issues.
> I seem to have resolved all of them, but I occasionally still see this show
> up:
>
> .venv/lib/python3.10/site-packages/numpy/_typing/_array_like.py:153:
> error: Type argument "_UnknownType" of "dtype" must be a subtype of
> "generic"  [type-var]
>
> On mypy 0.981 this is not 100% repro and if I restart dmypy it goes
> away... until it comes back. I just now upgraded to mypy 0.982 and didn't
> get it on one run, at least not right away. Maybe this was some kind of
> mypy issue, but time will tell.
>
> I haven't seen exactly this error getting posted anywhere. I know this is
> a fairly recent change and it looks like there's a lot of type hinting work
> going on (excellent work! I love it, thank you numpy devs!).
>
> Anyone else got any insight on what's going on here? Is this a known
> issue? Is this a mypy issue?
>
> Thanks everyone.
>

I'd be very curious to know if 0.982 fixes things. I know that using python
3.10.7 causes problems for mypy < 0.981.

Chuck
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: mypy occasional error on _UnknownType in _array_like.py since 1.22 or 1.23

2022-10-10 Thread Nick Gerner
On Mon, Oct 10, 2022 at 1:35 PM Charles R Harris 
wrote:

>
>
> On Mon, Oct 10, 2022 at 12:27 PM Nick Gerner 
> wrote:
>
>> I upgraded from 1.21 to 1.23.3 recently and got a variety of mypy issues.
>> I seem to have resolved all of them, but I occasionally still see this show
>> up:
>>
>> .venv/lib/python3.10/site-packages/numpy/_typing/_array_like.py:153:
>> error: Type argument "_UnknownType" of "dtype" must be a subtype of
>> "generic"  [type-var]
>>
>> On mypy 0.981 this is not 100% repro and if I restart dmypy it goes
>> away... until it comes back. I just now upgraded to mypy 0.982 and didn't
>> get it on one run, at least not right away. Maybe this was some kind of
>> mypy issue, but time will tell.
>>
>> I haven't seen exactly this error getting posted anywhere. I know this is
>> a fairly recent change and it looks like there's a lot of type hinting work
>> going on (excellent work! I love it, thank you numpy devs!).
>>
>> Anyone else got any insight on what's going on here? Is this a known
>> issue? Is this a mypy issue?
>>
>> Thanks everyone.
>>
>
> I'd be very curious to know if 0.982 fixes things. I know that using
> python 3.10.7 causes problems for mypy < 0.981.
>
> Chuck
>

Sadly, it does not seem to resolve the problem. I've run into the issue
with mypy 0.982 several times today. I am running python 3.10.7.

I've posted to the mypy gitter as well in case it's an issue on their end.
I guess I should add that I haven't seen it running mypy, only running
dmypy. That and the fact that it's not 100% repro does make it seem like a
mypy issue.

I appreciate the attention.

--Nick
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com