Re: [Python-Dev] Is explicit registration of Iterators needed?

2016年10月08日 20:02:04 -0700

On Fri, Oct 7, 2016 at 3:52 PM, Ivan Levkivskyi <[email protected]> wrote:
> I have a question about the registration of builtins. Currently, typing.py
> contains this line:
>
> ByteString.register(type(memoryview(b'')))
>
> But there are two test lines in test_collections.py
>
> self.assertNotIsInstance(memoryview(b""), ByteString)
> self.assertFalse(issubclass(memoryview, ByteString))
>
> This looks like a contradiction. Which one is right?
> Should these tests be removed or the registration in typing.py?
Looks like the registration is in error. The stubs (and hence mypy)
don't consider memoryview consistent with ByteString.
-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to