[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thanks for the report and patch.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset d7947280a4ba9dc652c3fac22946466338ec6999 by Terry Jan Reedy in 
branch '3.7':
[3.7] bpo-39136: Fixed typos (GH-17720)
https://github.com/python/cpython/commit/d7947280a4ba9dc652c3fac22946466338ec6999


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Andy Lester


Andy Lester  added the comment:

Thank you. I appreciate the pointer.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39151] Simplify the deep-first-search of the assembler

2019-12-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +17178
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17733

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2019-12-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Have you tried dropping ABCMeta? Mypy checks @abstractmethod regardless.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> PyToken_OneChar in Parser/token.c is autogenerated.  I suspect it may be 
> faster and smaller if it were a lookup into a static table of ops rather than 
> a switch statement.  Check to see if it is.

I suspect that it will be marginally faster (because it won't need to do bound 
checks to go to the default case) but under PGO it will make almost no 
difference.

You can try to see if there is any significant improvement using the 
pyperformance suite (https://pyperformance.readthedocs.io/) with and without 
your change (with PGO/LTO activated).

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25087] Type variable substitution in type instances

2019-12-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yup, see comment in https://github.com/python/typing/pull/308 regarding #156.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15723] Python breaks OS' append guarantee on file writes

2019-12-28 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39151] Simplify the deep-first-search of the assembler

2019-12-28 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

I was recently checking the code of the assembler and when looking in detail at 
the dfs() function I was surprised by this code:

static void
dfs(struct compiler *c, basicblock *b, struct assembler *a, int end)
{


while (j < end) {
b = a->a_postorder[j++];
for (i = 0; i < b->b_iused; i++) {
struct instr *instr = >b_instr[i];
if (instr->i_jrel || instr->i_jabs)
dfs(c, instr->i_target, a, j);
}
assert(a->a_nblocks < j);
a->a_postorder[a->a_nblocks++] = b;
}
}

In particular, the recursive call to:

dfs(c, instr->i_target, a, j)

I cannot imagine a situation in which the previous for loop

for (j = end; b && !b->b_seen; b = b->b_next) {
b->b_seen = 1;
assert(a->a_nblocks < j);
a->a_postorder[--j] = b;
}

has not visited all blocks (so the b_seen is already set) and in which the 
recursion will do something meaninfull. Indeed, as a naive check, simplifying 
the function to (no recursive call):

static void
dfs(struct compiler *c, basicblock *b, struct assembler *a, int end)
{
int i, j;

for (j = end; b && !b->b_seen; b = b->b_next) {
b->b_seen = 1;
assert(a->a_nblocks < j);
a->a_postorder[--j] = b;
}
while (j < end) {
b = a->a_postorder[j++];
assert(a->a_nblocks < j);
a->a_postorder[a->a_nblocks++] = b;
}
}

passes the full test suite. I am missing something? Even if I am missing 
something I think that situation should be added to the test suite so It 
mativated me to open the issue.

--
components: Interpreter Core
messages: 358978
nosy: Mark.Shannon, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Simplify the deep-first-search of the assembler
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I'm afraid nailing anything here is hard.  For example, I don't know what you 
> did to "measure memory", but if you're using stats reported by the OS, that's 
> fraught with dangers too. 

I am interposing a custom allocator to track all the used blocks in all used 
pools in all arenas and then monitor all the memmap/malloc allocations. I get 
the same results if I don't use obmalloc (setting the PYTHONMALLOC=malloc) env 
var, which is more straightforward as I can just interpose a malloc 
implementation using LD_PRELOAD or a simple custom allocator. I don't claim to 
be exact but is better than just checking the resident size.

I didn't want to use sys._debugmallocstats() so printing to stdout does not 
impact performance, as I was also checking that the code does not make the 
interpreter slower.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Tim Peters


Tim Peters  added the comment:

All right!  So, at a first look, "buffering" isn't an obvious disaster ;-)

I'm afraid nailing anything here is hard.  For example, I don't know what you 
did to "measure memory", but if you're using stats reported by the OS, that's 
fraught with dangers too.  Python's small-object allocator makes only weak 
attempts to return memory "to C", which in turn may or may not return memory to 
"the system".

One way to do better is to call `sys._debugmallocstats()` and stare at the 
output.  The "# bytes in allocated blocks" output line is an exact count of the 
number of bytes pymalloc is currently hanging on to for objects that have been 
allocated but not yet freed.  The point is that C - and the OS - have nothing 
to do with this value.  The downside:  objects > 512 bytes aren't included at 
all in this (pymalloc passes on requests for > 512 bytes to the system 
malloc(), and doesn't keep track of them).

Anyway, so far, so good!  Looks worth pursuing :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Andy Lester


New submission from Andy Lester :

PyToken_OneChar in Parser/token.c is autogenerated.  I suspect it may be faster 
and smaller if it were a lookup into a static table of ops rather than a switch 
statement.  Check to see if it is.

--
components: Interpreter Core
messages: 358975
nosy: petdance
priority: normal
severity: normal
status: open
title: See if PyToken_OneChar would be faster as a lookup table
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +17177
pull_request: https://github.com/python/cpython/pull/17732

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset df647f3340d7a40628ba731f80425cb469e72653 by Terry Jan Reedy in 
branch '3.8':
[3.8] bpo-39136: Fixed typos (GH-17720)
https://github.com/python/cpython/commit/df647f3340d7a40628ba731f80425cb469e72653


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have attached two files to the issue. One of them (vanilla-vs-buffered) shows 
the mean memory profile of running test_asyncio 1000 times with the buffered GC 
and without the buffered GC. The other file shows the difference between both 
curves.

test_ascyncio is not a "production application" but is the longest and less 
specific test that we have. I have experimented with some tests in the 
pyperformance suite and they show some similitudes like some memory spikes seem 
to be smaller and less memory usage in flat regions after collections.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


Added file: https://bugs.python.org/file48807/vanilla-vs-buffered.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


Added file: https://bugs.python.org/file48808/diff-vanilla-buffered.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +17176
pull_request: https://github.com/python/cpython/pull/17731

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Oh, I don't expect it to help appreciably - which is why I never did it ;-)  
> It's aimed at something different, I think, than what you're after:  reducing 
> the burden of cyclic gc on objects that would otherwise soon be reclaimed by 
> refcounting anyway.  But such stuff is going to get reclaimed "soon" 
> regardless, and saving it from getting scanned by gc at most once has limited 
> potential.

What I wanted to say is that this idea is still interesting to benchmark and 
experiment on its own, especially because is simple enough.

>You seem aimed more at reclaiming _cyclic_ trash sooner.  The hack I sketched 
>would only help with that if a cycle in part B became "theoretically dead" 
>before part A filled up enough to trigger another collection.  But I have no 
>guess as to the distribution of cycle lifetimes, other than that it's bound to 
>vary a lot across programs, and will be multi-modal.

That is right (I was also looking to solve the case in which an object is 
referred by something in an older generation, then is promoted and almost 
immediately the referent dies - or it was dead to begin with -).  I think 
evolving from your proposal into something in which the first generation is 
split into two "sub-generations" with the same threshold that is collected at 
the same time should not be very complicated.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Tim Peters


Tim Peters  added the comment:

Oh, I don't expect it to help appreciably - which is why I never did it ;-)  
It's aimed at something different, I think, than what you're after:  reducing 
the burden of cyclic gc on objects that would otherwise soon be reclaimed by 
refcounting anyway.  But such stuff is going to get reclaimed "soon" 
regardless, and saving it from getting scanned by gc at most once has limited 
potential.

You seem aimed more at reclaiming _cyclic_ trash sooner.  The hack I sketched 
would only help with that if a cycle in part B became "theoretically dead" 
before part A filled up enough to trigger another collection.  But I have no 
guess as to the distribution of cycle lifetimes, other than that it's bound to 
vary a lot across programs, and will be multi-modal.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2019-12-28 Thread Nathaniel Smith


Change by Nathaniel Smith :


--
nosy: +njs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6c7bb38ff2799ac218e6df598b2b262f89e2bc1e by Terry Jan Reedy 
(Gurupad Hegde) in branch 'master':
bpo-39136: Fixed typos (GH-17720)
https://github.com/python/cpython/commit/6c7bb38ff2799ac218e6df598b2b262f89e2bc1e


--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34118] Fix some class entries in 'Built-in Functions'

2019-12-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I closed #39112, about tuple only, as a duplicate of this.

--
keywords: +patch
versions: +Python 3.9 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38938] Possible performance improvement for heaqq.merge()

2019-12-28 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

PR 17729 is a C implementation of a non-recursive "flattening" of the the 
recursive-lazy-mergesort algorithm into a tournament whose state is a tree of 
losers of comparisons.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39112] Misleading documentation for tuple

2019-12-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Fix some class entries in 'Built-in Functions'

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2019-12-28 Thread xitop


xitop  added the comment:

Please, could some experienced Python developer take a look at this issue 
reported more than 3 month ago?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Leonardo Galani


Leonardo Galani  added the comment:

I would totally agree if it wasn't for this:

>>> 'a' and 'b' and 'g' in dict
False

The last evaluation is False, making the whole statement False.

but thanks for the documentation link and stackoverflow suggestion.
it sure does make the code more readable.

Happy new year!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Ned Deily


Ned Deily  added the comment:

P.S. You should also read the "Operator precedence" section for expressions in 
the Python Language Reference manual which explains that comparison operators 
bind tighter than Boolean AND operators:

https://docs.python.org/3/reference/expressions.html#operator-precedence

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> For example, break the youngest generation into parts A & B.  Newly tracked 
> items are added to part A.  When a collection occurs, only part B 
> participates from the youngest generation.  When the collection ends, part A 
> is renamed to part B, and part A is marked empty (just a handful of pointer 
> manipulations).

Well, this seems simple enough to fully implement just to try it out to 
benchmark a bit. I will start doing some experiments with it.

> Beyond that most objects "die young", which appears overwhelmingly truer than 
> not across almost all Python programs, I'm not sure anything else about 
> lifetime distribution is generally exploitable.

In theory, sub-generation steps will make use of "most object die young", 
specifically it will try to make it happen more often, as this issue can be 
summarized on "some objects that should die young don't because they were in a 
collection at the wrong time and now they need to wait even more".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

> About "5 bits", no, we don't have 'em.  Even the relatively modest > ugliness 
> we have now makes it impossible to port Python to a word->addressed machine 
> (I'm not sure any still exist!).  Nothing in C >guarantees the last 2 or 3 
> bits of a pointer "are 0".  We're already >using two words to store 2 
> persistent pointers, one persistent flag, a >full-width transient reference 
> count, and two transient flags.

In view of this, +1 for avoiding the extra bits for age storage. The steps 
scheme will work best in this case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2019-12-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the details. Attached is a complete script. Looking at the source 
code, anything that looks like a tuple is converted into a tuple. namedtuple 
produces factory function that itself is a subclass of tuple. It led me to this 
interesting issue over detecting if it's a namedtuple issue7796 where detecting 
_fields in msg134186 is described as a workaround. So logging might detect 
namedtuple and skip conversion to ConvertingTuple using the workaround but it 
appears more of the class of special casing it here in logging  that will 
depend on namedtuple internals. There are no test failures. I will leave it to 
vinay on this.

>>> import collections
>>> person = collections.namedtuple('Person', 'age')
>>> isinstance(person(age=20), tuple)
True
>>> print(person._source) # works on 3.6 but verbose and _source were removed 
>>> in 3.7 with 8b57d7363916869357848e666d03fa7614c47897
from builtins import property as _property, tuple as _tuple
from operator import itemgetter as _itemgetter
from collections import OrderedDict

class Person(tuple):
'Person(age,)'
// snip more source code for person

# Detect namedtuple by checking for _fields attribute

diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 4a3b8966ed..ba6937e725 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -448,7 +448,8 @@ class BaseConfigurator(object):
 value = ConvertingList(value)
 value.configurator = self
 elif not isinstance(value, ConvertingTuple) and\
- isinstance(value, tuple):
+ isinstance(value, tuple) and\
+ not hasattr(value, '_fields'):
 value = ConvertingTuple(value)
 value.configurator = self
 elif isinstance(value, str): # str for py3k

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

>
I suppose we would need to experiment, but for what I have seen I think two or 
three :) What do you think?


IMO, I think experimenting with two steps is good enough.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Tim Peters


Tim Peters  added the comment:

Long ago I thought about adding "a buffer in front of" CPython's cyclic gc:  
newly tracked items would be added there, and not participate in cyclic gc at 
all until a collection passed.

For example, break the youngest generation into parts A & B.  Newly tracked 
items are added to part A.  When a collection occurs, only part B participates 
from the youngest generation.  When the collection ends, part A is renamed to 
part B, and part A is marked empty (just a handful of pointer manipulations).

Seems a similar thrust, but a more extreme goal:  trying to maximize the number 
of new containers that can be reclaimed by refcounting alone without _ever_ 
being chased by cyclic gc.

Beyond that most objects "die young", which appears overwhelmingly truer than 
not across almost all Python programs, I'm not sure anything else about 
lifetime distribution is generally exploitable.

About "5 bits", no, we don't have 'em.  Even the relatively modest ugliness we 
have now makes it impossible to port Python to a word-addressed machine (I'm 
not sure any still exist!).  Nothing in C guarantees the last 2 or 3 bits of a 
pointer "are 0".  We're already using two words to store 2 persistent pointers, 
one persistent flag, a full-width transient reference count, and two transient 
flags.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> How many semi-spaces do you think of having in this generation? Most systems 
> have and recommend two.

I suppose we would need to experiment, but for what I have seen I think two or 
three :) What do you think?

> If it is a worse tradeoff to managing steps then I would suggest to stick to 
> the steps.

I think any memory increase that scales with the number of objects will be a 
big concern.

>  we need to add a step and manage it which is more complex than for example 
> when tracking ages, incase of a change we only change the age threshold which 
> looks simpler to implement.

Exactly, but if with "tracking ages" you mean store per-object ages then the 
previous concern applies :( Adding sub-generation steps should not be much more 
complicated IMHO.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25087] Type variable substitution in type instances

2019-12-28 Thread Batuhan


Batuhan  added the comment:

It looks like the issue in typing tracker closed, can we also close this?

--
nosy: +BTaskaya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It's intended as non-empty strings evaluate to True so you with `'a' and 'b' 
and 'c' in dict` you are essentially evaluating `'a' and 'b' and ('c' in dict)` 
with brackets precedence i.e. `True and True and True` . On the other hand `'a' 
and 'g' and 'c' in dict` it's the same with 'g' evaluated to True. I guess you 
want to check all the keys are present where all is more readable. Some more 
answers here: 
https://stackoverflow.com/questions/1285911/how-do-i-check-that-multiple-keys-are-in-a-dict-in-a-single-pass

>>> all(char in dict for char in ['a', 'b', 'c'])
True
>>> all(char in dict for char in ['a', 'b', 'g'])
False

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

>5 bit *per object* is a lot because it scales with the number of objects. It 
>will quickly obliterate >any gain that we get from some objects being 
>deallocated sooner (which is what we are trying >to achieve). Using 
>inter-generations has a constant cost that is negligible. 

I agree but this may not require us falling back to a two word header per 
object as was the original worry. If it is a worse tradeoff to managing steps 
then I would suggest to stick to the steps. Again in the end it is about what 
tradeoffs are willing to work with.

 >I am not sure what you mean with "changing the age >threshold for objects 
 >looks simpler than >creating and managing steps". If you mean changing >the 
 >generational threshold, I think that >does not fix the problem as it only 
 >delays or speeds up >collections but the problem is >scale-invariant with the 
 >number of objects.

I meant that for any need for increase in promotion delay, we need to add a 
step and manage it which is more complex than for example when tracking ages, 
incase of a change we only change the age threshold which looks simpler to 
implement.

>I will propose maybe to only do sub-steps for the first generation (as many 
>papers suggest >that is where the bigger gains are).

Correct, since the premise is we just want to delay promotion of young objects 
to an older generation so that they have enough time to die. The steps should 
reasonably be in the first generation.

How many semi-spaces do you think of having in this generation? Most systems 
have and recommend two.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Leonardo Galani


New submission from Leonardo Galani :

using Python 3.7.6 (default, Dec 27 2019, 09:51:07) @ macOs

dict = { 'a': 1, 'b': 2, 'c': 3 }

if you `if 'a' and 'b' and 'c' in dict: print('ok')` you will get a True, since 
everything is true.

if you `if 'a' and 'g' and 'c' in dict: print('ok')` you also get a True 
because the last statement is True but the mid statement is false.

To avoid this false positive, you need to be explicit:
`if 'a' in dict and 'g' in dict and 'c' in dict: print('ok')` you will get a 
false.

--
components: macOS
messages: 358954
nosy: leonardogalani, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: False positive using operator 'AND' while checking keys on dict()
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32599] Add dtrace hook for PyCFunction_Call

2019-12-28 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39123] PyThread_xxx() not available when using limited API

2019-12-28 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah, vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33944] Deprecate and remove pth files

2019-12-28 Thread Michel Desmoulin


Michel Desmoulin  added the comment:

Just realized it didn't work in venv anyway.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11105] Compiling evil ast crashes interpreter

2019-12-28 Thread Batuhan


Batuhan  added the comment:

We can probably implement something like this to prevent this happening
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index daac0966f5..f9da52da7f 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -559,6 +559,11 @@ class Obj2ModVisitor(PickleVisitor):
 self.emit("asdl_seq_SET(%s, i, val);" % field.name, depth+2)
 self.emit("}", depth+1)
 else:
+self.emit("if (obj == tmp) {", depth+1)
+self.emit("PyErr_SetString(PyExc_RuntimeError, \"Recursing fields "
+  "are not supported for AST nodes.\");", depth+2, 
reflow=False)
+self.emit("goto failed;", depth+2)
+self.emit("}", depth+1)
 self.emit("res = obj2ast_%s(tmp, &%s, arena);" %
   (field.type, field.name), depth+1)
 self.emit("if (res != 0) goto failed;", depth+1)

--
nosy: +BTaskaya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11105] Compiling evil ast crashes interpreter

2019-12-28 Thread Batuhan


Change by Batuhan :


--
versions: +Python 3.9 -Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

> I think we only need about 5 bits to store the age of each object ,  do we 
> really need to increase the object back to two word per object ?

5 bit *per object* is a lot because it scales with the number of objects. It 
will quickly obliterate any gain that we get from some objects being 
deallocated sooner (which is what we are trying to achieve). Using 
inter-generations has a constant cost that is negligible. 

> Am actually in favour of this Shaw’s steps scheme though it may also mean the 
> more delays we want, the more steps we need to create and manage while 
> changing the age threshold for objects looks simpler than creating and 
> managing steps.

I will propose maybe to only do sub-steps for the first generation (as many 
papers suggest that is where the bigger gains are). I am not sure what you mean 
with "changing the age threshold for objects looks simpler than creating and 
managing steps". If you mean changing the generational threshold, I think that 
does not fix the problem as it only delays or speeds up collections but the 
problem is scale-invariant with the number of objects.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

> What threshold is this?

> This is the different thresholds for the generations that you can get using 
> gc.get_threshold(). >They are in relationship to the number of objects in 
> every generation (there are slightly different >rules for the latest 
> generation).

I think we are on the same frequency in terms of threshold. Promotion is 
currently based on number of objects accumulated in the generation if I 
interpreted your explanation right.


>I am not sure what you mean with "copy" here. Moving objects from generations 
>or spaces is >just updating the pointers of the linked lists. Objects are not 
>"copied" but "moved". 

Yes, in terms of implementation so am thinking there must be a cost in moving 
these objects. IIRC the GC handbook you referenced may have noted this too..I 
stand to be corrected though on this.

>The reason I am proposing sub-generation steps is that making the object 
>header bigger is a >price too high to pay for this problem. We have recently 
>gone to notable efforts to reduce one >word per object by complicating the 
>code substantially using tagged pointers, so recording the >age in the object 
>seems the opposite direction. 

I think we only need about 5 bits to store the age of each object ,  do we 
really need to increase the object back to two word per object ?

>As I mentioned before, recording per-object age will be probably a no-go (the 
>solution to this >problem will yield memory gains because objects won't suffer 
>"generational nepotism" but >making the object header bigger will annihilate 
>those gains) so that is the reason I proposed >generational sub-steps.

Am actually in favour of this Shaw’s steps scheme though it may also mean the 
more delays we want, the more steps we need to create and manage while changing 
the age threshold for objects looks simpler than creating and managing steps.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39144] Align ctags and etags targets and include Python stdlib

2019-12-28 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> What threshold is this?

This is the different thresholds for the generations that you can get using 
gc.get_threshold(). They are in relationship to the number of objects in every 
generation (there are slightly different rules for the latest generation).

> This method is good but we will still incur the overhead of copying objects 
> between the semi-spaces.

I am not sure what you mean with "copy" here. Moving objects from generations 
or spaces is just updating the pointers of the linked lists. Objects are not 
"copied" but "moved". 

> I have looked at a similar problem before for a different runtime and instead 
> think to consider basing promotion on the number of collections survived by 
> objects in the young generation. This requires using five bits from one of 
> two header words of each object to record its age. The objects that reach the 
> collection threshold are promoted to the old generation. This will give the 
> young objects enough time to die thereby reducing how often objects are 
> promoted to the old generation. This in turn reduces the frequency of major 
> collections hence reduced pause times.

The reason I am proposing sub-generation steps is that making the object header 
bigger is a price too high to pay for this problem. We have recently gone to 
notable efforts to reduce one word per object by complicating the code 
substantially using tagged pointers, so recording the age in the object seems 
the opposite direction. 

> I would only consider the generational semi-spaces after we have explored 
> basing promotion on the age of an object in a generation. If this doesn't 
> work, then we can use the bucket brigade scheme.

As I mentioned before, recording per-object age will be probably a no-go (the 
solution to this problem will yield memory gains because objects won't suffer 
"generational nepotism" but making the object header bigger will annihilate 
those gains) so that is the reason I proposed generational sub-steps.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2019-12-28 Thread Henrique


Henrique  added the comment:

Sorry for not sending a proper reproducible script when submitting the issue. 
End of the day and quite frustrated with the bug, anyway, I attached a full 
script that will show the error.

This is the custom handler I used:

class MyHandler(logging.StreamHandler):
def __init__(self, resource, *args, **kwargs):
super().__init__(*args, **kwargs)
self.resource: namedtuple = resource

def emit(self, record):
record.msg += f" {self.resource.type}"
return super().emit(record)


self.resource.type will throw and AttributeError when logging, because resource 
gets converted from a namedtuple to a ConvertingTuple.

--
Added file: https://bugs.python.org/file48806/bug.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

> The most common reason is that when promotions of the youngest generations 
> happen, 
>some very young objects that just arrived in the generation are >promoted 
>because we have >reached a threshold, and its death will be >delayed.

What threshold is this? Is it based on the number of objects in the young 
generation in that if the number of objects in the young generation reaches 
some value, then promotion occurs. If this is the case, we can use another 
scheme for the start before exploring steps IMHO.

Using Shaw’s Bucket Brigade Scheme  of semi-spaces or generational steps is 
good but this means a generation with n steps guarantees n scavenges before an 
object is promoted to the next generation. The surviving objects are copied 
between these pairs of semispaces b times before they are promoted to the next 
step. An n-bucket scheme guarantees that objects will be promoted to the old 
generation If they have survived between nb and nb-1 scavenges. For example, a 
2 bucket scheme, objects are copied up to three times before being promoted to 
the next generation. This method is good but we will still incur the overhead 
of copying objects between the semi-spaces.

I have looked at a similar problem before for a different runtime and instead 
think to consider basing promotion on the number of collections survived by 
objects in the young generation. This requires using five bits from one of two 
header words of each object to record its age. The objects that reach the 
collection threshold are promoted to the old generation. This will give the 
young objects enough time to die thereby reducing how often objects are 
promoted to the old generation. This in turn reduces the frequency of major 
collections hence reduced pause times.

I would only consider the generational semi-spaces after we have explored 
basing promotion on the age of an object in a generation. If this doesn't work, 
then we can use the bucket brigade scheme.

--
nosy: +nanjekyejoannah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2019-12-28 Thread Alexander Hirner


Alexander Hirner  added the comment:

We construct a computational graph and need to validate (or search for possible 
new) edges at runtime. The data is specific to computer vision. One example is 
clipping geometry within 2D boundaries. A minimal implementation of this data 
would be:

@dataclass
class FramedGeometry:
width: PositiveInt
height: PositiveInt
geometry: Geometry

However, different properties are manifest in different encodings. Height, 
width can be meta data from an image database or inherent to a decoded image 
(as np.ndarray.shape). The transform will then 
`dataclasses.replace(geometry=...)` its attribute(s).. If width and height are 
not implemented, another transition is needed to produce them whilst only 
looking into the image header, not fully decoding potentially large and many 
images.

The read-only interface ensures that transitions are generic wrt some forms of 
inputs. The replace interface preserves runtime types.

Inputs and outputs are annotated with @dataclass or tuples of them. Those 
dataclasses are a mixin of base dataclasses that declare concrete properties 
like a URI of an image and ABCs that declare accessors like get_width(self) -> 
PositiveInt. We use @pydantic.dataclass to parse, validate and deserialize 
concrete classes to great extent [0]. 

In order to not implement accessors on top of dataclasses, we'd want that 
abstract properties are compatible with dataclasses and issubclass works with 
data protocols (given the necessary constraints).

PS:
Polymorphism for computer-vision data is an interesting problem. Other 
approaches exist, each with their own struggle to model "traits" the right way 
[1]. E.g., scaling would be valid for `FramedGeometry` since no image data is 
included but invalid when images are referenced but cannot be resized, like:

class EncodedSizedAnnotatedFrame:
width: PositiveInt
height: PositiveInt
image_bin: bytes
geometry: Geometry

Thanks!

[0] https://pydantic-docs.helpmanual.io/usage/dataclasses/
[1] https://github.com/pytorch/vision/issues/1406

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree with Pablo's analysis. And this can't be backported, since it's a new 
feature. So I'm closing this issue.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32438] PyLong_ API cleanup

2019-12-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing as a duplicate of #36048 (which isn't quite right, since this issue 
came first, but it's probably close enough).

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate implicit truncating when convert Python numbers to C 
integers: use __index__, not __int__

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-12-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

Serhiy: any thoughts about what version should be targeted for eventual removal 
of the functionality deprecated in this PR? 3.10?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32438] PyLong_ API cleanup

2019-12-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Batuhan: I think so, yes; at least, the "deprecated" part is done. The 
"eventually removed" is not, and I don't know whether we have a target version 
for that removal.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Kay Hayen


Kay Hayen  added the comment:

Thanks a lot, Batuhan, this will feel a lot more correct, from my point of 
view, this could be closed unless there would be a backport.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2019-12-28 Thread Alex Grönholm

Change by Alex Grönholm :


--
components: +asyncio
nosy: +yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2019-12-28 Thread Alex Grönholm

New submission from Alex Grönholm :

Receiving a UDP datagram using DatagramProtocol on the Proactor event loop 
results in error_received() being called with WinError 87 (Invalid Parameter). 
The low-level sock_recv() works fine, but naturally loses the sender address 
information. The attached script works fine as-is on Linux, and on Windows if 
::1 is replaced with 127.0.0.1.

There were extensive tests added for UDP support on IOCP, but unfortunately all 
of them use only IPv4 sockets so they could not catch this problem.

--
components: Windows
files: udpreceive.py
messages: 358940
nosy: alex.gronholm, asvetlov, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: DatagramProtocol + IPv6 does not work with ProactorEventLoop
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48805/udpreceive.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39145] Innocuous parent class changes multiple inheritance MRO

2019-12-28 Thread Cyker Way


Cyker Way  added the comment:

Ahhh, 1 second, I haven't really quit from this. I could open another thread 
but it's highly related to this one.

I just came up with something that looks like a bug not a feature in the 
original c3.

#!/usr/bin/env python3

#A   C
#B   D  X  A
#E  F
#G

class A(object): pass
class B(A): pass
class C(object): pass
class D(C): pass
class X(object): pass
class E(B, D, A): pass
class F(B, D, X, A): pass
class G(E, F): pass
print(G.mro())

The script fails. It cannot find GEFBDCXA, which looks valid?

You can close again if you feel this isn't a bug. I'm gone for a while.

--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39145] Innocuous parent class changes multiple inheritance MRO

2019-12-28 Thread Cyker Way


Cyker Way  added the comment:

Thank you for the links. I doubt this c3 variant could break EPG consistency 
making it c2. May run some tests later and move on to discussion board. Guess 
I'm done here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38938] Possible performance improvement for heaqq.merge()

2019-12-28 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
pull_requests: +17174
pull_request: https://github.com/python/cpython/pull/17729

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39147] using zipfile with root privilege shows FileNotFoundError

2019-12-28 Thread Patrick Liu

New submission from Patrick Liu :

When I run the python script with root privilege, it can clone the repo 
successfully but with the error message as follow.
However, it runs correctly with normal user.
Why it cannot find the html file? Thanks.

Python 3.7.4 (default, Aug 13 2019, 20:35:49) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from git_clone import git_clone
>>> git_clone('https://github.com/android9527/android9527.github.io')
13472.0 KB, 13574 KB/s, 0.99 seconds passed Traceback (most recent call 
last):
  File "", line 1, in 
  File "/root/anaconda3/lib/python3.7/site-packages/git_clone/git_clone.py", 
line 53, in git_clone
f.extractall(path + '/.')
  File "/root/anaconda3/lib/python3.7/zipfile.py", line 1619, in extractall
self._extract_member(zipinfo, path, pwd)
  File "/root/anaconda3/lib/python3.7/zipfile.py", line 1673, in _extract_member
open(targetpath, "wb") as target:
FileNotFoundError: [Errno 2] No such file or directory: 
'/mnt/fit-Knowledgezoo/test/android9527.github.io-master/2019/01/24/2019-01-24-Java
 重入锁 synchronized /index.html'
>>> exit()

--
messages: 358937
nosy: Patrick Liu
priority: normal
severity: normal
status: open
title: using zipfile with root privilege shows FileNotFoundError
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39146] too much memory consumption in re.compile unicode

2019-12-28 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +17172
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17728

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39146] too much memory consumption in re.compile unicode

2019-12-28 Thread Zhipeng Xie


Change by Zhipeng Xie <775350...@qq.com>:


--
title: to much memory consumption in re.compile unicode -> too much memory 
consumption in re.compile unicode

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39146] to much memory consumption in re.compile unicode

2019-12-28 Thread Zhipeng Xie


New submission from Zhipeng Xie <775350...@qq.com>:

when running the following script, we found python2 comsume a lot memory while 
python3 does not have the issue.

import re
import time
NON_PRINTABLE = re.compile(u'[^\U0001-\U0010]')
time.sleep( 30 )

python2:
  PID USER  PR  NIVIRTRESSHR S  %CPU  %MEM TIME+ COMMAND

 6943 root  20   0  109956  93436   3956 S   0.0   1.2   0:00.30 python

python3:
  PID USER  PR  NIVIRTRESSHR S  %CPU  %MEM TIME+ COMMAND

 6952 root  20   0   28032   8880   4868 S   0.0   0.1   0:00.02 python3

--
components: Library (Lib)
messages: 358936
nosy: Zhipeng Xie
priority: normal
severity: normal
status: open
title: to much memory consumption in re.compile unicode
type: resource usage
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37446] Undefined behavior in Python/hamt.c

2019-12-28 Thread Batuhan


Batuhan  added the comment:

> I don't get that output on 3.8.0a4+

I guess it is related with you didn't added -fsanitize=undefined option.

--
nosy: +BTaskaya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37446] Undefined behavior in Python/hamt.c

2019-12-28 Thread Batuhan


Change by Batuhan :


--
keywords: +patch
pull_requests: +17171
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17727

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32438] PyLong_ API cleanup

2019-12-28 Thread Batuhan


Batuhan  added the comment:

Is this related/resolved with issue 36048?

--
nosy: +BTaskaya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39112] Misleading documentation for tuple

2019-12-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Terry, I guess it's a duplicate of issue34118 .

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com