[Python-Dev] Re: Python-Dev Digest, Vol 201, Issue 1

2020-04-02 Thread Ilya Kamenshchikov
erious question: what should `enumerate.__reversed__` > do when given a starting value? > > reversed(enumerate('abc', 1)) > > Should that yield...? > > # treat the start value as a start value > (1, 'c'), (0, 'b'), (-1, 'a') > > # treat the start value as

[Python-Dev] Re: reversed enumerate

2020-04-02 Thread Ilya Kamenshchikov
st express their ideas differently knowing it doesn't work in straight-forward way. Best Regards, -- Ilya Kamenshchikov ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org

[Python-Dev] reversed enumerate

2020-04-01 Thread Ilya Kamenshchikov
Hi, I needed reversed(enumerate(x: list)) in my code, and have discovered that it wound't work. This is disappointing because operation is well defined. It is also well defined for str type, range, and - in principle, but not yet in practice - on dictionary iterators - keys(), values(), items()

Re: [Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-23 Thread Ilya Kamenshchikov
Ok thanks for explaining. I will proceed by trying it with typeshed. Best Regards, -- Ilya Kamenshchikov On Tue, Apr 23, 2019 at 9:44 PM Ivan Levkivskyi wrote: > Mypy doesn't use source code of stlib for analysis and instead uses stub > files from typeshed. IIUC PyCharm can also do tha

Re: [Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-23 Thread Ilya Kamenshchikov
, performant and sufficient code - then perhaps modifying mypy is a reasonable price to pay. Perhaps this particular case can be just patched locally by PyCharm /JetBrains, but what is a general solution to this class of problems? Best Regards, -- Ilya Kamenshchikov On Tue, Apr 23, 2019 at 7:05 PM

Re: [Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-20 Thread Ilya Kamenshchikov
alright, so would an import under TYPE_CHECKING guard be an option? like: from typing import TYPE_CHECKING if TYPE_CHECKING: from .process import ProcessPoolExecutor from .thread import ThreadPoolExecutor Perhaps we can have both clarity and performance.

[Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-20 Thread Ilya Kamenshchikov
and would indeed be an improvement? Best Regards, -- Ilya Kamenshchikov ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail