A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2016-October/146601.html below:

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

[Python-Dev] Is explicit registration of Iterators needed? [Python-Dev] Is explicit registration of Iterators needed?Guido van Rossum guido at python.org
Sat Oct 8 22:55:25 EDT 2016
On Fri, Oct 7, 2016 at 3:52 PM, Ivan Levkivskyi <levkivskyi at gmail.com> 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)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4