[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-29 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: OK, I will close this issue, and open separate issues for documentation, Union, etc. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: ISTM that those ought to be separate issues since PEP 560 has been implemented fully here. Also I am getting cold feet about Union simplification (esp. this late in the release cycle). We should probably retreat on the typing tracker and

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: https://github.com/python/typing/issues/512 and https://github.com/python/typing/issues/511 are first issue (they are closely related to each other). This is not directly related to PEP 560, but changes in typing because of it will

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Guido van Rossum
Guido van Rossum added the comment: Are there more specific descriptions of those bugs? Links to a tracker? (Even if it's the typing tracker.) -- ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think all the critical things have been implemented/fixed. There are unfortunately no docs yet (my fault), also there are two bugs related to PEP 560, but they are not new, they also exist in Python 3.6. I am however marking this as

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Ned Deily
Ned Deily added the comment: What's the status of this? The issue is still open with "release blocker" status. -- ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-20 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset d911e40e788fb679723d78b6ea11cabf46caed5a by Ivan Levkivskyi in branch 'master': bpo-32226: PEP 560: improve typing module (#4906) https://github.com/python/cpython/commit/d911e40e788fb679723d78b6ea11cabf46caed5a

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset e860089fd93728824cf586fa4d91f08eff3bab73 by Victor Stinner in branch 'master': bpo-32226: Fix memory leak in generic_alias_dealloc() (#5212)

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-17 Thread STINNER Victor
STINNER Victor added the comment: Oh ok, I think that I found the bug: PR 5212. -- ___ Python tracker ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-17 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +5066 ___ Python tracker ___ ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-17 Thread STINNER Victor
STINNER Victor added the comment: Since the commit 45700fb757591a672e9d25b8252971c2a2caeaf2, test_genericclass leaks references: --- vstinner@apu$ ./python -m test -R 3:3 test_genericclass -m test.test_genericclass.CAPITest.test_c_class Run tests sequentially 0:00:00

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I know very small about this module to writing the documentation. -- ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-11 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Serhiy, I am sorry for a delay, I have recently moved to another country, this is why I have not much time. I will try to work on this weekend. Here are some points where you can be helpful: * Make a short documentation PR for

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can I help? I'm implementing the feature related to pickling classes, and want to implement pickling generic types as an example. But since PEP 560 will change all here, I need to wait this change. --

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please don't forgot to document this feature. -- ___ Python tracker ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +ned.deily priority: normal -> release blocker ___ Python tracker ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ce5b0e9db1b9698e6ffc43ae41cf3a22ca5a6ba6 by Serhiy Storchaka in branch 'master': bpo-32226: Make __class_getitem__ an automatic class method. (#5098)

[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4966 ___ Python tracker ___ ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-16 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- pull_requests: +4800 ___ Python tracker ___ ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread STINNER Victor
STINNER Victor added the comment: It is very to get stable benchmarks with timings shorter than 1 ms, and even harder for timings shorter than 1 us. I wrote documentation to implement how to get more stable results:

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread Guido van Rossum
Guido van Rossum added the comment: I think the best thing to do is not to panic! Also maybe PGO could help? On Dec 14, 2017 15:43, "Ivan Levkivskyi" wrote: > > Ivan Levkivskyi added the comment: > > Interesting. I have noticed

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Interesting. I have noticed similar when I tried to add a fast loop proposed by Serhiy. It should save at least one pointer comparison for base class, but sometimes it actually led to slow-downs (although very small). How can one fight

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 2b5fd1e9ca9318673989e6ccac2c8acadc3809cd by Ivan Levkivskyi in branch 'master': bpo-32226: Implementation of PEP 560 (core components) (#4732)

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is a cause. The difference may be dependent on the compiler and platform. -- nosy: +vstinner ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread Guido van Rossum
Guido van Rossum added the comment: > This adds an overhead to every indexing. I'm not doubting your results, but I'm curious how that happened. The extra code in PyObject_GetItem is right before the point where it would otherwise raise TypeError -- I presume you benchmark

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This adds an overhead to every indexing. $ ./python -m perf timeit --compare-to=./python0 -s 'a = [1]' --duplicate=1 'a[0]' python0: . 15.3 ns +- 0.5 ns python: . 16.1 ns +- 0.3 ns

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-12 Thread Xavier G. Domingo
Change by Xavier G. Domingo : -- nosy: +xgdomingo ___ Python tracker ___ ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-12 Thread Guido van Rossum
Guido van Rossum added the comment: I like the current approach (PyObject_GetItem). I agree with both of your reasons to prefer it. -- ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-12 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Guido, what is your preference for the implementation of ``__class_getitem__``: ``PyObject_GetItem`` (current one) or ``type.__getitem__`` (old one)? Can we just go ahead with the version you like and then re-consider if some objections

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-12 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > As for __class_getitem__, why not implement type.__getitem__ instead of > hacking PyObject_GetItem()? This question was raised by Mark Shannon on python-dev. Actually, my initial implementation did exactly this, but I didn't like it

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For reference: PEP 560. -- ___ Python tracker ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As for __class_getitem__, why not implement type.__getitem__ instead of hacking PyObject_GetItem()? -- nosy: +serhiy.storchaka ___ Python tracker

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- keywords: +patch pull_requests: +4635 stage: needs patch -> patch review ___ Python tracker ___

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-05 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi : As discussed before, there will be two PRs. One for the core components, and the second one (large) for typing updates. I will open the first PR shortly. -- nosy: +gvanrossum ___ Python

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- assignee: levkivskyi components: Interpreter Core, Library (Lib) nosy: levkivskyi priority: normal severity: normal stage: needs patch status: open title: Implement PEP 560: Core support for typing module and generic types type: