Ivan Levkivskyi added the comment:
Here is the new patch. I hope I didn't miss any comment and fixed everything.
There is still a refleak to fix.
--
Added file: http://bugs.python.org/file44469/hg-pep-526-v2.diff
___
Python tracker
Ivan Levkivskyi added the comment:
Sorry, again attached a wrong diff, here is the correct one.
--
Added file: http://bugs.python.org/file44470/hg-pep-526-v2.diff
___
Python tracker
<http://bugs.python.org/issue27
Ivan Levkivskyi added the comment:
It looks like this part is causing a refleak
def test_do_not_recreate_annotations(self):
class C:
del __annotations__
try: #with self.assertRaises(NameError):
x: int
except NameError
Ivan Levkivskyi added the comment:
Yury,
Commenting out was an attempt to debug. It should be there
--
___
Python tracker
<http://bugs.python.org/issue27
Ivan Levkivskyi added the comment:
Yury, thank you for the fix and for good advice!
(I checked everything like 10 times, except for TOS :-)
I run the full test suite and everything seem to be fine now.
Guido, does Yury's patch apply cleanly, or I need to regenerate a ne
Ivan Levkivskyi added the comment:
Oh, I see there are more comments by Serhiy, I will implement them and submit a
new patch.
--
___
Python tracker
<http://bugs.python.org/issue27
Ivan Levkivskyi added the comment:
Guido,
I resolved merge conflicts in patch v4 (if it will complain, this could be
because of graminit.c or importlib_external.h, just ignore those, they will be
regenerated during build).
Please take a look and sorry for a delay.
--
Added file
Ivan Levkivskyi added the comment:
Thank you Yury,
I usually do
./python -m test -R : test___all__ test_dis test_grammar test_opcodes
test_parser test_pydoc test_symtable test_tools test_typing
and then
./python -m test -j3 -u all
I just run tests with -R3:3 it also works
Ivan Levkivskyi added the comment:
Yes,
This is the latest patch that I tested and with resolved merge conflicts.
--
___
Python tracker
<http://bugs.python.org/issue27
Changes by Ivan Levkivskyi :
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue26982>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ivan Levkivskyi added the comment:
Thank you Guido, Yury, Brett, and Serhiy!
It is first time I make such kind of contribution. It was a great experience
and a great opportunity to better understand CPython internals (I already have
several ideas on what to work next :-)
I will soon submit a
New submission from Ivan Levkivskyi:
Guido,
Here is a patch to remove com2ann (also it looks like Yury added a second entry
for me in MISC/Acks, so that I am removing it).
--
components: Demos and Tools
files: remove-com2ann.diff
keywords: patch
messages: 275274
nosy: gvanrossum
Ivan Levkivskyi added the comment:
Victor,
Guido proposed to publish com2ann script in a separate repo on github.
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
After some thinking, maybe it could be still kept in Tools but developed on
github as it is done for typing and asyncio?
I have no preference here, core devs should decide.
--
___
Python tracker
<h
Ivan Levkivskyi added the comment:
I am attaching the patch.
Yury, I also added you here, just in case you have time for this.
Btw, while working on this I have found that the second restriction:
"""
Names listed in a global statement must not be ... in a for loop control
Ivan Levkivskyi added the comment:
Added few tests to the patch
--
Added file: http://bugs.python.org/file44503/patch-v2.diff
___
Python tracker
<http://bugs.python.org/issue27
Ivan Levkivskyi added the comment:
Here is the patch for some omissions in typing module documentation.
Guido, please take a look.
--
keywords: +patch
nosy: +gvanrossum
Added file: http://bugs.python.org/file44541/typing-doc.diff
___
Python tracker
Ivan Levkivskyi added the comment:
The patch contains docs for both new 3.6 features and missing 3.5:
ClassVar, Collection, plus also Sized, Hashable, DefaultDict, @overload,
TYPE_CHECKING
Should I generate a separate patch for 3.5 with only 3.5 omissions
New submission from Ivan Levkivskyi:
Variable annotations for private names are stored in __annotations__ without
name mangling. This is inconsistent with how function annotations behave:
class C:
def meth(__x: int): ...
assert C.meth.__annotations__ == {'_C__x': int}
The atta
New submission from Ivan Levkivskyi:
Here is the patch for 3.5
--
files: typing-patch.diff
keywords: patch
messages: 275809
nosy: gvanrossum, levkivskyi
priority: normal
severity: normal
status: open
title: Update typing and test typing from python/typing repo
Added file: http
Changes by Ivan Levkivskyi :
--
components: +Library (Lib)
type: -> enhancement
___
Python tracker
<http://bugs.python.org/issue28079>
___
___
Python-bugs-lis
Ivan Levkivskyi added the comment:
I have noticed that some code could be simplified, since it is
backward-compatible even with 3.2, but I think it is easiest to keep the source
here in sync with what is on python/typing.
--
___
Python tracker
Ivan Levkivskyi added the comment:
I could guess this is because some changes have been already integrated by
patch that implemented PEP 526.
If this would help here is a separate patch that should apply cleanly to 3.6
--
Added file: http://bugs.python.org/file44559/typing-patch-3.6
New submission from Ivan Levkivskyi:
Patch with added comment and a minor refactoring to error messages in symtable.c
Now the error message is simply always overwritten by any more "severe"
SyntaxError found in the same block.
--
components: Interpreter Core
files: refa
New submission from Ivan Levkivskyi:
The implementation of NamedTuple in typing module has been extended to support
PEP 526 variable annotation syntax.
Here is he patch that updates documentation accordingly.
--
assignee: docs@python
components: Documentation
files: nmtuple-doc.diff
Ivan Levkivskyi added the comment:
OK
--
___
Python tracker
<http://bugs.python.org/issue28107>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ivan Levkivskyi:
The attached patch contains a simple item summarizing PEP 526 in 3.6 What's New.
--
assignee: docs@python
components: Documentation
files: whats-new-pep-526.diff
keywords: patch
messages: 276105
nosy: docs@python, gvanrossum, levkivskyi
pri
Ivan Levkivskyi added the comment:
Updated patch
--
Added file: http://bugs.python.org/file44603/whats-new-pep-526-v2.diff
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Second update, implemented comments by Yury an Guido.
--
Added file: http://bugs.python.org/file44606/whats-new-pep-526-v3.diff
___
Python tracker
<http://bugs.python.org/issue28
Changes by Ivan Levkivskyi :
Added file: http://bugs.python.org/file44626/whats-new-pep-526-v3a.diff
___
Python tracker
<http://bugs.python.org/issue28109>
___
___
Pytho
Ivan Levkivskyi added the comment:
Here is the patch for 3.6 with requested changes.
While playing with this a bit more, I discovered that the error message in this
case (if no value is actually assigned):
def f():
x: int
global x
could be misleading. Therefore I changed the order of
Changes by Ivan Levkivskyi :
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue28250>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ivan Levkivskyi added the comment:
I have submitted a PR with one of the quick fixes upstream (to python/typing).
Also I have played a bit with a more permanent fix. Here is an important
observation: it is not easy to avoid adding parameterized generics to
__subclasses__. For example, Node
Changes by Ivan Levkivskyi :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue28100>
___
___
Python-bugs-list
Ivan Levkivskyi added the comment:
Since the quick fix is now applied, I think it should not be a release blocker
any more.
--
___
Python tracker
<http://bugs.python.org/issue28
New submission from Ivan Levkivskyi:
Here is the patch with updates according to recent changes in typing module and
PEP 484:
- most things are not classes now
- outcome of parameterizing generics is cached
- Union does not unify everything with Any
- few minor fixes
This patch also fixes
Ivan Levkivskyi added the comment:
I think this is the right way to fix this, as discussed on python-dev,
memoryview is not considered consistent with ByteString.
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
I tried and all tests pass on 3.7a also with prior import of typing.
A larger fix is not _necessary_, but I would _prefer_ to go with the option 4
that I proposed above, i.e.:
Instead of special casing abc and functools in __subclasshook__ in typing via
sys
Changes by Ivan Levkivskyi :
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue28433>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Ivan Levkivskyi :
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue28482>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ivan Levkivskyi added the comment:
Martin, I have opened a PR with your patch at python/typing
https://github.com/python/typing/pull/304
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Here is the patch according to the discussion (modifying inspect).
I didn't change the rendering of docs for classes (neither stripped 'typing.'
nor changed __bases__ to __orig_bases__). First, collections.abc.X are widely
used as base classes
Ivan Levkivskyi added the comment:
For function annotations I did as originally proposed. In my previous comment I
was talking about documentation for classes. For example:
class C(Generic[T], Mapping[int, str]): ...
pydoc.render_doc(C)
will show "class C(typing.Mapping)".
while fo
Ivan Levkivskyi added the comment:
Actually, for classes, it is probably worth adding a separate section "Generic
type info" that will render information using __orig_bases__, __parameters__,
and __args__. At the same time the "header" will be the same as now, listing
runt
New submission from Ivan Levkivskyi:
It was proposed in the discussion of #27989 to update pydoc rendering of
documentation of classes supporting generic types.
Currently there are two ideas:
1. Keep the class header intact (i.e. listing actual runtime __bases__)
and adding a separate section
Ivan Levkivskyi added the comment:
Guido,
> Honestly I think it's better if this remains a "hidden" feature until we have
> support for it in mypy. So let's wait for that.
This patch now could be applied (since the
Changes by Ivan Levkivskyi :
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue28556>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ivan Levkivskyi:
This will remove one test from test_grammar that depends on typing module API
(this test case is already covered in test_typing).
--
components: Tests
files: test-grammar-patch.diff
keywords: patch
messages: 280132
nosy: gvanrossum, levkivskyi
New submission from Ivan Levkivskyi:
Here is the patch with recent additions/changes in typing.py
Summary: Tuple and Callable are now classes, generic type aliases, added
Coroutine, extended docs for get_type_hints.
--
assignee: docs@python
components: Documentation
files: recent
Ivan Levkivskyi added the comment:
Sorry, here is the patch with corrected formatting and base classes for
Coroutine.
--
Added file: http://bugs.python.org/file45402/recent-typing-docs-v2.diff
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Thanks Mariatta, here is a new version of patch with indentation fixed.
--
Added file: http://bugs.python.org/file45405/recent-typing-docs-v3.diff
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Yury, Guido, I think I understand why test_typing crashes in refleak hunting
mode. The test relies on caching, namely type variables are compared by id, so
that if cache is cleared between those two lines, then test fails. I think we
should just update those
Ivan Levkivskyi added the comment:
Yury, _tp_cache should be the only one (of course most generic classes have
_abc_cache since GenericMeta inherits from ABCMeta)
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Here is the corrected patch to avoid crash.
--
Added file: http://bugs.python.org/file45416/fix-typing-test-v2.diff
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Yury, yes I will take a look at this now.
--
___
Python tracker
<http://bugs.python.org/issue28649>
___
___
Python-bugs-list m
Ivan Levkivskyi added the comment:
My impression is like something wrong happens when TypeError is raised by a
cached function.
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
A very simple repro:
with self.assertRaises(TypeError):
Union[[]]
It looks like the problem happens when a non-hashable argument is passed to
cached function
--
___
Python tracker
<h
Ivan Levkivskyi added the comment:
FWIW, if I comment out this code
try:
from _functools import _lru_cache_wrapper
except ImportError:
pass
in functools.py to use the pure Python version, then I get much larger numbers:
$ ./python -m test -R : test_typing
Run tests sequentially
0:00
Ivan Levkivskyi added the comment:
It seems to be unrelated to typing.py
With your test from test_functools:
def test_lru_type_error(self):
@functools.lru_cache(maxsize=None)
def infinite_cache(o):
pass
with self.assertRaises(TypeError
Ivan Levkivskyi added the comment:
Anyway, this is not urgent, typing.py uses the default version, which is the C
version.
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
> Wow. I can reproduce refleaks in test_typing, but not in test_functools. This
> is weird.
Indeed, I copied the new test from test_functools to test_typing, but now I see
that pure Python version of lru_cache fails even if I remove this test and test
Ivan Levkivskyi added the comment:
I am not sure what does this mean, but when I remove __slots__ = () from some
classes, numbers of leaked references change.
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
> * It looks like that some types in the cache are being *reused* by different
> tests.
I also noticed this some time ago, ideally we need to make all tests more
isolated between each other.
> Now this all of this is just my guess of what's
Ivan Levkivskyi added the comment:
It looks like the tearDown() works really well. It also somehow fixes the
problem with test_generic_forward_ref
--
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
I think Yury is right here. The good plan would be to add the tearDown(), but
also fix the problem with test_generic_forward_ref. I could work on it tomorrow
(really don't have time today, sorry).
--
___
P
Ivan Levkivskyi added the comment:
Guido, Yury, it looks like I solved the puzzle. All the remaining problems are
because of forward references. In particular, _ForwardRef keeps a reference to
the frame where it was defined:
typing_globals = globals()
frame = sys._getframe(1
Ivan Levkivskyi added the comment:
> BTW, if I set maxsize=10 for typing lru_cache, test_generic_forward_ref
> crashes in refleak-test mode. Maybe this is another bug...
This one is also related to the mentioned in my previous message. Namely,
forward references are only evaluate
Ivan Levkivskyi added the comment:
OK, here are the PRs:
https://github.com/python/typing/pull/327
https://github.com/python/typing/pull/328
Those two seem to fix everything, I tried various cache sizes with both C and
Python versions of lru_cache and found no refleaks
Ivan Levkivskyi added the comment:
Guido, here is a new patch with your comments implemented.
--
Added file: http://bugs.python.org/file45424/recent-typing-docs-v4.diff
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
I think tearDown() is not necessary. But on the other hand it could be nice to
have a method in tests to force cache clear. I would propose it not as a
default, but as an opt-in to check that cache works well, or that a certain
tested feature is "
Ivan Levkivskyi added the comment:
Guido, here is the new patch with your corrections. I have some questions in
Rietveld, but those are about mypy, you could apply the patch now.
--
Added file: http://bugs.python.org/file45446/recent-typing-docs-v5.diff
Changes by Ivan Levkivskyi :
Added file: http://bugs.python.org/file45447/recent-typing-docs-v6.diff
___
Python tracker
<http://bugs.python.org/issue28644>
___
___
Pytho
Ivan Levkivskyi added the comment:
I think it would be more useful for multidimensional slicing:
>>> subscript[::-1, ..., ::-1]
(slice(None, None, -1), Ellipsis, slice(None, None, -1))
--
___
Python tracker
<http://bugs.python.or
Ivan Levkivskyi added the comment:
Here is a new patch that does not cause refleaks, I just replaced empty
__slots__ with a __setattr__: it looks like __slots__ are not needed here to
save memory (there is only a singleton instance), they were used just to create
an immutable object
Changes by Ivan Levkivskyi :
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue28651>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ivan Levkivskyi added the comment:
Thank you Yury and Elvis for working on this!
I have few more suggestions for What's New:
* collections.abc.Reversible (http://bugs.python.org/issue25987).
* various ABCs in collections.abc now have means for explicit
"anti-registration&quo
Ivan Levkivskyi added the comment:
The patch is small and it was initially applied before 3.6b1, I think we should
ask Ned (added to nosy) if this is OK to apply the fixed version?
--
nosy: +ned.deily
___
Python tracker
<http://bugs.python.
Ivan Levkivskyi added the comment:
Serhiy, thank you for review! Here is a corrected patch.
--
Added file:
http://bugs.python.org/file45473/operator_subscript_norefleak_v2.patch
___
Python tracker
<http://bugs.python.org/issue24
Ivan Levkivskyi added the comment:
Maybe then it makes sense to apply this to 3.7? It looks like most people are
in favour of this (also on python-ideas), only Raymond is not sure/mildly
against.
--
___
Python tracker
<http://bugs.python.
Ivan Levkivskyi added the comment:
The patch looks good, I left just one small comment in Rietveld.
--
nosy: +levkivskyi
___
Python tracker
<http://bugs.python.org/issue28
Ivan Levkivskyi added the comment:
Thank you Manuel!
LGTM.
--
___
Python tracker
<http://bugs.python.org/issue28773>
___
___
Python-bugs-list mailing list
Unsub
601 - 681 of 681 matches
Mail list logo