[issue26914] Fix formatting of lists in PEP 420

2016-05-02 Thread Georg Brandl

Georg Brandl added the comment:

Looks pretty rampant to me :)

Anyway, +1 for fixing, you can just do it without review if you have the time.

--

___
Python tracker 

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



[issue26914] Fix formatting of lists in PEP 420

2016-05-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue26914] Fix formatting of lists in PEP 420

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For references:

PEP 0302: New Import Hooks
PEP 0327: Decimal Data Type
PEP 0339: Design of the CPython Compiler
PEP 0362: Function Signature Object
PEP 0364: Transitioning to the Py3K Standard Library
PEP 0372: Adding an ordered dictionary to collections
PEP 0380: Syntax for Delegating to a Subgenerator
PEP 0382: Namespace Packages
PEP 0393: Flexible String Representation
PEP 0400: Deprecate codecs.StreamReader and codecs.StreamWriter
PEP 0403: General purpose decorator clause (aka "@in" clause)
PEP 0404: Python 2.8 Un-release Schedule
PEP 0410: Use decimal.Decimal type for timestamps
PEP 0416: Add a frozendict builtin type
PEP 0418: Add monotonic time, performance counter, and process time functions
PEP 0420: Implicit Namespace Packages
PEP 0426: Metadata for Python Software Packages 2.0
PEP 0432: Simplifying the CPython startup sequence
PEP 0433: Easier suppression of file descriptor inheritance
PEP 0437: A DSL for specifying signatures, annotations and argument converters
PEP 0446: Make newly created file descriptors non-inheritable
PEP 0457: Syntax For Positional-Only Parameters
PEP 0461: Adding % formatting to bytes and bytearray
PEP 0472: Support for indexing with keyword arguments
PEP 0488: Elimination of PYO files
PEP 0498: Literal String Interpolation
PEP 0628: Add ``math.tau``
PEP 3103: A Switch/Case Statement
PEP 3104: Access to Names in Outer Scopes
PEP 3108: Standard Library Reorganization
PEP 3121: Extension Module Initialization and Finalization
PEP 3127: Integer Literal Support and Syntax
PEP 3131: Supporting Non-ASCII Identifiers
PEP 3137: Immutable Bytes and Mutable Buffer
PEP 3141: A Type Hierarchy for Numbers
PEP 3147: PYC Repository Directories
PEP 3149: ABI version tagged .so files
PEP 3150: Statement local namespaces (aka "given" clause)
PEP 3156: Asynchronous IO Support Rebooted: the "asyncio" Module

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18766] IDLE: Autocomplete in editor doesn't work for un-imported modules

2016-05-02 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26710] ConfigParser: Values in DEFAULT section override defaults passed to constructor

2016-05-02 Thread Marc Abramowitz

Marc Abramowitz added the comment:

Well my thought is that the configuration file has defaults that a user may 
want to override at runtime using an environment variable or command-line 
switch.

I guess as SilentGhost pointed out, maybe this is not the responsibility of the 
ConfigParser as this behavior is not related to config files per se, though 
it's curious that the ConfigParser allows the user to pass in values in the 
constructor.

Since two people are -1 on this, it seems pretty clear that I am on the wrong 
track with this, so I think we can close this.

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

___
Python tracker 

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



[issue26914] Fix formatting of lists in PEP 420

2016-05-02 Thread Ned Batchelder

Ned Batchelder added the comment:

OK, "rampant" was overly dramatic... :)

These PEPs seem to have the same issue:

pep-0302.html
pep-0327.html
pep-0339.html
pep-0362.html
pep-0364.html
pep-0372.html
pep-0380.html
pep-0382.html
pep-0393.html
pep-0400.html
pep-0403.html
pep-0404.html
pep-0410.html
pep-0416.html
pep-0418.html
pep-0426.html
pep-0432.html
pep-0433.html
pep-0437.html
pep-0446.html
pep-0457.html
pep-0461.html
pep-0472.html
pep-0488.html
pep-0498.html
pep-0628.html
pep-3103.html
pep-3104.html
pep-3108.html
pep-3121.html
pep-3127.html
pep-3131.html
pep-3137.html
pep-3141.html
pep-3147.html
pep-3149.html
pep-3150.html
pep-3156.html

--

___
Python tracker 

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



[issue16385] evaluating literal dict with repeated keys gives no warnings/errors

2016-05-02 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Raising an error on duplicates also has precedent:

>>> dict(a=3, b=4, a=5)
  File "", line 1
SyntaxError: keyword argument repeated

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue26710] ConfigParser: Values in DEFAULT section override defaults passed to constructor

2016-05-02 Thread Łukasz Langa

Łukasz Langa added the comment:

Having both `defaults` and `overrides` would confuse the API, especially given 
that we already have `fallback` arguments to `get*` methods.

What's the point of having overrides *over* a file? Defaults were thought of as 
a way to say: "unless the user bothered to modify those, the values are as 
follows". That's the point of configuration. We have defaults, that the *user* 
overrides. Why would you want to override what the user specified? I fail to 
understand the logic behind this.

--

___
Python tracker 

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



[issue26812] ExtendedInterpolation drops user-defined 'vars' during _interpolate_some() recursion

2016-05-02 Thread Łukasz Langa

Łukasz Langa added the comment:

This is true. Care to author a patch?

--
assignee:  -> lukasz.langa

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-05-02 Thread Łukasz Langa

Łukasz Langa added the comment:

Closing this as setuptools switched to RawConfigParser.

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

___
Python tracker 

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



[issue26537] ConfigParser has optionxform, but not sectionxform

2016-05-02 Thread Łukasz Langa

Changes by Łukasz Langa :


--
assignee:  -> lukasz.langa

___
Python tracker 

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



[issue26537] ConfigParser has optionxform, but not sectionxform

2016-05-02 Thread Łukasz Langa

Łukasz Langa added the comment:

I agree sectionxform would be nice. Care to author a patch?

The current workaround is modifying the SECTCRE regular expression.

--

___
Python tracker 

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



[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2016-05-02 Thread Łukasz Langa

Łukasz Langa added the comment:

At this point I agree with Robert. It's public API that predates my changes 
which was inadequately mocked.

I've seen similar problems in the past when we've changed reading file objects 
to use plain iteration instead of the .readlines() method. I've had people 
complain that their "file-like object" implementation provided just 
.readlines() and suddenly stopped working.

I can relate to how this caused painful churn. We do try to minimize it. 
However, it's hard to evolve any code if we can't touch it based on fear of 
breaking incompletely duck typed third-party code :(

Barry, would you still like this to be reverted on Python 3.4?

--

___
Python tracker 

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



[issue26914] Fix formatting of lists in PEP 420

2016-05-02 Thread Ned Batchelder

New submission from Ned Batchelder:

The numbered and bulletted lists are indented from the body text, which looks 
good in the .rst, but causes the lists themselves to be blockquotes.  This 
leads to confusing formatting on python.org: 
https://www.python.org/dev/peps/pep-0420/

BTW: this formatting error is rampant among the PEPs... :(

--
assignee: docs@python
components: Documentation
files: pep-0420.patch
keywords: patch
messages: 264677
nosy: docs@python, nedbat
priority: normal
severity: normal
status: open
title: Fix formatting of lists in PEP 420
Added file: http://bugs.python.org/file42686/pep-0420.patch

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

All sounds good. Glad the issue of long-running loops is at least on your
radar.

--

___
Python tracker 

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



[issue26913] statistics.mean of bools

2016-05-02 Thread R. David Murray

R. David Murray added the comment:

Already fixed: #24068.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> statistics module - incorrect results with boolean input

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> OK, I get it. I think it would be really helpful if issue 26110 was updated, 
> reviewed and committed -- it sound like a good idea on its own, and it needs 
> some burn-in time due to the introduction of two new opcodes. (That's 
> especially important since there's also a patch introducing wordcode, i.e. 
> issue 26647 and undoubtedly the two patches will conflict.) It also needs to 
> show benchmark results on its own (but I think you've got that).

Right.  Victor asked me to review the wordcode patch (and maybe even commit), 
and I'll try to do that this week.  LOAD_METHOD/CALL_METHOD patch needs some 
refactoring, right now it's a PoC-quality.  I agree it has to go first.

> I am also happy to see the LOAD_GLOBAL optimization, and it alone may be 
> sufficient to save PEP 509 (though I would recommend editing the text of the 
> PEP dramatically to focus on a brief but crisp description of the change 
> itself and the use that LOAD_GLOBAL would make of it and the microbench 
> results; it currently is a pain to read the whole thing).

Alright.  I'll work on this with Victor.

> I have to read up on what you're doing to LOAD_ATTR/LOAD_METHOD. In the mean 
> time I wonder how that would fare in a world where most attr lookups are in 
> namedtuples.

I think there will be no difference, but I can add a microbenchmark and see.

> As a general recommendation I would actually prefer more separate patches 
> (even though it's harder on you), just with very clearly stated relationships 
> between them.

NP. This is a big change to review, and the last thing I want is to 
accidentally make CPython slower.

> A question about the strategy of only optimizing code objects that are called 
> a lot. Doesn't this mean that a "main" function containing a major inner loop 
> doesn't get the optimization it might deserve?

Right, the "main" function won't be optimized.  There are two reasons of why I 
added this threshold of 1000 calls before optimizations:

1. We want to limit the memory overhead.  We, generally, don't want to optimize 
module code objects, and code objects that are called just a few times over 
long periods of time.  We can introduce additional heuristic to detect long 
running loops, but I'm afraid that it will add overhead to the loops that don't 
need this optimization.

2. We want the environment to become stable -- the builtins and globals 
namespaces to be fully populated (and, perhaps, mutated), classes fully 
initialized etc.

> PS. I like you a lot but there's no way I'm going to "bare" with you. :-)

Haha, this is my typo of the month, I guess ;)

--

___
Python tracker 

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



[issue26912] test/test_email/torture_test.py (and test_asian_codecs.py) has a broken import

2016-05-02 Thread R. David Murray

R. David Murray added the comment:

torture_test is not currently run, and this is intentional (it uses a large 
external resource).  It is kept for reference and in case anyone wants to run 
it by hand[*].  The import should be fixed.

test_asian_codecs is run automatically by the unittest load tests protocol.  
That import should be fixed as well since it is picking up the class from the 
wrong location.

[*] At one point I was working on making it run when the largefile resource is 
asserted, by downloading the resource.  But I'm not convinced it is a good 
idea, so I abandonded that.

--

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-05-02 Thread Rohit Jamuar

Rohit Jamuar added the comment:

Just so that I understand it clearly - Inside MSVCCompiler class (in 
_msvccompiler.py / msvccompiler.py / msvc9compiler.py ), current implementation 
of find_exe() finds compiler / linker / ... after parsing PATH. Should the 
changes be so, that if DISTUTILS_USE_SDK is set to the environment, the values 
set to CC / AR / LD, etc. are used verbatim? Or did you mean to say, that just 
as CC, LD and AR are being read from the environment, the same way rc.exe, 
mc.exe and mt.exe should be read as well, in case DISTUTILS_USE_SDK is set to 
the environment?

--

___
Python tracker 

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



[issue26913] statistics.mean of bools

2016-05-02 Thread Zachary Ware

Changes by Zachary Ware :


--
versions:  -Python 3.4

___
Python tracker 

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



[issue26912] test/test_email/torture_test.py (and test_asian_codecs.py) has a broken import

2016-05-02 Thread Zachary Ware

Changes by Zachary Ware :


--
components: +email
nosy: +barry, r.david.murray
versions: +Python 3.6

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, I get it. I think it would be really helpful if issue 26110 was updated, 
reviewed and committed -- it sound like a good idea on its own, and it needs 
some burn-in time due to the introduction of two new opcodes. (That's 
especially important since there's also a patch introducing wordcode, i.e. 
issue 26647 and undoubtedly the two patches will conflict.) It also needs to 
show benchmark results on its own (but I think you've got that).

I am also happy to see the LOAD_GLOBAL optimization, and it alone may be 
sufficient to save PEP 509 (though I would recommend editing the text of the 
PEP dramatically to focus on a brief but crisp description of the change itself 
and the use that LOAD_GLOBAL would make of it and the microbench results; it 
currently is a pain to read the whole thing).

I have to read up on what you're doing to LOAD_ATTR/LOAD_METHOD. In the mean 
time I wonder how that would fare in a world where most attr lookups are in 
namedtuples.

As a general recommendation I would actually prefer more separate patches (even 
though it's harder on you), just with very clearly stated relationships between 
them.

A question about the strategy of only optimizing code objects that are called a 
lot. Doesn't this mean that a "main" function containing a major inner loop 
doesn't get the optimization it might deserve?

PS. I like you a lot but there's no way I'm going to "bare" with you. :-)

--

___
Python tracker 

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



[issue26913] statistics.mean of bools

2016-05-02 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue26913] statistics.mean of bools

2016-05-02 Thread Peter Norvig

New submission from Peter Norvig:

mean([True, True, True, False]) should be 0.75, but it returns 0.25.

The fix is to change _sum so that when the type is bool, the result should be 
coerced to int, not bool.

Why it is important for statistics.mean to work with bools:
It is natural to say something like
mean(x > threshold for x in data)
and expect to get the percentage of items in data that are above threshold.

--
components: Library (Lib)
messages: 264670
nosy: Peter.Norvig
priority: normal
severity: normal
status: open
title: statistics.mean of bools
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-05-02 Thread Oren Milman

Oren Milman added the comment:

thanks for the review!

I replied to both of your comments, though I am not sure what is expected of me 
in the rest of the process.
Whatever it is, I would be happy to help as much as I can.

--

___
Python tracker 

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



[issue26905] from multiprocessing.pool import Pool bug on linux

2016-05-02 Thread Josh Rosenberg

Josh Rosenberg added the comment:

The Queue module (queue on Py3) is for communication between threads, not 
processes; what you've written wouldn't behave correctly on any version of 
Python. You want to use multiprocessing's Queue class, not Queue.Queue, and to 
avoid possible deadlocks, you want to populate it after the pool workers are 
running.

In any event, id(q) is expected to match on Linux, which has fork semantics (so 
the memory space in parent and child is initially identical). On Windows it 
differs because spawn based multiprocessing means the objects are recreated in 
the child processes, rather than inherited directly.

This is a problem with your code and understanding on forking, not a problem in 
Python.

--
nosy: +josh.r

___
Python tracker 

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



[issue26912] test/test_email/torture_test.py (and test_asian_codecs.py) has a broken import

2016-05-02 Thread Ivan Zakharyaschev

New submission from Ivan Zakharyaschev:

(An issue similar to http://bugs.python.org/issue26911 , but with a different 
source file from the tests)

Lib/test/test_email/torture_test.py:15:from email.test.test_email import 
TestEmailBase

should be:

from test.test_email import TestEmailBase

because the first variant has a non-existing path.

(This makes the auto-requirements generator in ALT Sisyphus to generate a 
broken/unsatisfiable dependency on email.test.test_email when building the 
package from http://git.altlinux.org/people/imz/packages/python3.git .)

Similarly,

Lib/test/test_email/test_asian_codecs.py:8:from test.test_email.test_email 
import TestEmailBase

should better not have an extra "test_email" component in the path.

All other imports of test_email in Python 3.5.1 sources are of the form I'm 
suggesting:

$ git --no-pager grep -Fn .test_email
Lib/test/test_email/__init__.py:9:from test.test_email import __file__ as 
landmark
Lib/test/test_email/__main__.py:1:from test.test_email import load_tests
Lib/test/test_email/test__encoded_words.py:4:from test.test_email import 
TestEmailBase
Lib/test/test_email/test__header_value_parser.py:6:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/test_asian_codecs.py:8:from test.test_email.test_email 
import TestEmailBase
Lib/test/test_email/test_contentmanager.py:2:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/test_defect_handling.py:6:from test.test_email import 
TestEmailBase
Lib/test/test_email/test_email.py:42:from test.test_email import openfile, 
TestEmailBase
Lib/test/test_email/test_generator.py:8:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/test_headerregistry.py:8:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/test_inversion.py:11:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/test_message.py:5:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/test_parser.py:5:from test.test_email import TestEmailBase
Lib/test/test_email/test_pickleable.py:9:from test.test_email import 
TestEmailBase, parameterize
Lib/test/test_email/torture_test.py:15:from email.test.test_email import 
TestEmailBase
Misc/HISTORY:1733:- Issue #8315: (partial fix) python -m unittest 
test.test_email now works.

BTW, I'm not sure these two files are used anywhere, because grep gives no 
results for their names.

--
components: Tests
messages: 264667
nosy: imz
priority: normal
severity: normal
status: open
title: test/test_email/torture_test.py (and test_asian_codecs.py) has a broken 
import
type: compile error
versions: Python 3.5

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-05-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue13610] On Python parsing numbers.

2016-05-02 Thread Vladimir Rutsky

Changes by Vladimir Rutsky :


--
nosy: +rutsky

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

If there are a lot of Android issue maybe you could get a tracker manager
to add a new keyword or category or whatever?

--

___
Python tracker 

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



[issue26911] lib2to3/tests/pytree_idempotency.py has a broken import

2016-05-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue26911] lib2to3/tests/pytree_idempotency.py has a broken import

2016-05-02 Thread Ivan Zakhryaschev

Ivan Zakhryaschev added the comment:

BTW, this source file seems to be not used anywhere.

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> I'm confused by the relationship between this and issue 26110.


This patch embeds the implementation of 26110.  I'm no longer sure it was a 
good idea to have two issues instead of one, everybody seems to be confused 
about that ;)


> That seems to be a much simpler patch (which also doesn't apply cleanly). If 
> 26110 really increases method calls by 20%, what does this add? (By which I 
> mean (a) what additional optimizations does it have, and (b) what additional 
> speedup does it have?)


I'm sorry for the long response, please bare with me.  This issue is complex, 
and it's very hard to explain it all in a short message.


The patch from 26110 implements LOAD_METHOD/CALL_METHOD pair of opcodes.  The 
idea is that we can avoid instantiation of BoundMethod objects for code that 
looks like "something.method(...)'.  I wanted to first get in shape the patch 
from 26110, commit it, and then, use the patch from this issue to add 
additional speedups.


This patch implements a generic per-opcode cache.  Using that cache, it speeds 
up LOAD_GLOBAL, LOAD_ATTR, and LOAD_METHOD (from 26110) opcodes.  The cache 
works on per-code object basis, only optimizing code objects that were run more 
than 1,000 times.


* LOAD_GLOBAL uses cache to store pointers for requested names.  Since the 
cache is per-opcode, the name is always the same for the given LOAD_GLOBAL.  
The cache logic uses PEP 509 to invalidate the cache (although the cache is 
almost never invalidated for real code).

This optimization makes micro optimizations like "def smth(len=len)" obsolete.  
LOAD_GLOBAL becomes much faster, almost as fast as LOAD_FAST.


* LOAD_ATTR uses Armin Rigo's clever types cache, and a modified PyDict_GetItem 
(PyDict_GetItemHint), which accepts a suggested position of the value in the 
hash table.  Basically, LOAD_ATTR stores in its cache a pointer to the type of 
the object it works with, its tp_version_tag, and a hint for 
PyDict_GetItemHint.  When we have a cache hit, LOAD_ATTR becomes super fast, 
since it only needs to lookup key/value in type's dict by a known offset (the 
real code is a bit more complex, to handle all edge cases of descriptor 
protocol etc).

Python programs have a lot of LOAD_ATTRs.  It also seems that dicts of classes 
are usually stable, and that objects rarely shadow class attributes.


* LOAD_METHOD is optimized very similarly to LOAD_ATTR.  The idea is that if 
the opcode is optimized, then we simply store a pointer to the function we want 
to call with CALL_METHOD.  Since 'obj.method' usually implies that 'method' is 
implemented on 'obj.__class__' this optimization makes LOAD_METHOD even faster. 
 That's how `s.startswith('abc')` becomes as fast as `s[:3] == 'abc'`.


> If 26110 really increases method calls by 20%, what does this add? 

Speeds up method calls another 15%, speeds up global name lookups and attribute 
lookups.


> (b) what additional speedup does it have

Here're some benchmark results: 
https://gist.github.com/1st1/b1978e17ee8b82cc6432

- call_method micro benchmark is 35% faster
- 2to3 is 7-8% faster
- richards - 18% faster
- many other benchmarks are 10-15% faster.  Those that appear slower aren't 
stable, i.e. one run they are slower, another they are faster.

I'd say each of the above optimizations speeds up macro-benchmarks by 2-4%.  
Combined, they speed up CPython 7-15%.


> I'm asking because I'm still trying to look for reasons why I should accept 
> PEP 509, and this is brought up as a reason.

Re PEP 509 and these patches:

1. I want to first find time to finish up and commit 26110.
2. Then I'll do some careful benchmarking for this patch and write another 
update with results.
3. This patch adds to the complexity of ceval, but if it really speeds up 
CPython it's well worth it.  PEP 509 will need to be approved if we decide to 
move forward with this patch.

I'd say that if you aren't sure about PEP 509 right now, then we can wait a 
couple of months and decide later.

--

___
Python tracker 

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



[issue26911] lib2to3/tests/pytree_idempotency.py has a broken import

2016-05-02 Thread Ivan Zakhryaschev

New submission from Ivan Zakhryaschev:

Line 21 of lib2to3/tests/pytree_idempotency.py:

import pgen2

This seems to be broken, because it should be:

import lib2to3.pgen2

(This makes the auto-requirements generator in ALT Sisyphus to generate a 
broken/unsatisfiable dependency on pgen2 when packaging this into an RPM.)

All other uses of pgen2 in Python 3.5.1 sources use other forms of import: 
either relative or the absolute one as I suggest:

$ git grep -F pgen2
lib2to3/btm_matcher.py:# from .pgen2 import token // 
token.__dict__.items():
lib2to3/btm_utils.py:from .pgen2 import grammar, token
lib2to3/fixer_util.py:from .pgen2 import token
lib2to3/fixes/fix_apply.py:from ..pgen2 import token
lib2to3/fixes/fix_dict.py:from ..pgen2 import token
lib2to3/fixes/fix_except.py:from ..pgen2 import token
lib2to3/fixes/fix_filter.py:from ..pgen2 import token
lib2to3/fixes/fix_has_key.py:from ..pgen2 import token
lib2to3/fixes/fix_map.py:from ..pgen2 import token
lib2to3/fixes/fix_ne.py:from ..pgen2 import token
lib2to3/fixes/fix_next.py:from ..pgen2 import token
lib2to3/fixes/fix_numliterals.py:from ..pgen2 import token
lib2to3/fixes/fix_print.py:from ..pgen2 import token
lib2to3/fixes/fix_raise.py:from ..pgen2 import token
lib2to3/fixes/fix_throw.py:from ..pgen2 import token
lib2to3/fixes/fix_tuple_params.py:from ..pgen2 import token
lib2to3/fixes/fix_types.py:from ..pgen2 import token
lib2to3/fixes/fix_unicode.py:from ..pgen2 import token
lib2to3/fixes/fix_ws_comma.py:from ..pgen2 import token
lib2to3/patcomp.py:from .pgen2 import driver, literals, token, tokenize, parse, 
grammar
lib2to3/pgen2/__init__.py:"""The pgen2 package."""
lib2to3/pgen2/conv.py:from pgen2 import grammar, token
lib2to3/pgen2/token.py:#   originally monkeypatched in by pgen2.tokenize
lib2to3/pgen2/tokenize.py:from lib2to3.pgen2.token import *
lib2to3/pygram.py:from .pgen2 import token
lib2to3/pygram.py:from .pgen2 import driver
lib2to3/pytree.py:# from .pgen2 import token // token.__dict__.items():
lib2to3/refactor.py:from .pgen2 import driver, tokenize, token
lib2to3/tests/pytree_idempotency.py:import pgen2
lib2to3/tests/pytree_idempotency.py:from pgen2 import driver
lib2to3/tests/pytree_idempotency.py:except pgen2.parse.ParseError 
as err:
lib2to3/tests/support.py:from lib2to3.pgen2 import driver
lib2to3/tests/test_parser.py:from lib2to3.pgen2 import tokenize
lib2to3/tests/test_parser.py:from ..pgen2.parse import ParseError
lib2to3/tests/test_refactor.py:from lib2to3.pgen2 import token
lib2to3/tests/test_util.py:from lib2to3.pgen2 import token

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 264663
nosy: imz
priority: normal
severity: normal
status: open
title: lib2to3/tests/pytree_idempotency.py has a broken import
type: compile error
versions: Python 3.5

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-05-02 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Stefan has already commited and closed some of the issues listed at issue 
#26865. Martin has closed issue #22359, a blocker for the cross-compilation of 
python.

I will enter an issue for all the failures listed at 
https://bitbucket.org/xdegaye/pyona/wiki/testsuite and add them to the list in 
the android meta-issue.

--

___
Python tracker 

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



[issue26910] dictionary literal should not allow duplicate keys

2016-05-02 Thread R. David Murray

R. David Murray added the comment:

Since this has been previously rejected, I'm closing this issue as a duplicate.

If you want to reopen the discussion of the merits, the python-ideas mailing 
list is the appropriate forum.  I encourage you to raise it there.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> evaluating literal dict with repeated keys gives no 
warnings/errors

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm also looking for some example code that would show clearly the kind of 
speedup we're talking about.

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

This patch doesn't apply cleanly any more. Is it easy to update?

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm confused by the relationship between this and issue 26110. That seems to be 
a much simpler patch (which also doesn't apply cleanly). If 26110 really 
increases method calls by 20%, what does this add? (By which I mean (a) what 
additional optimizations does it have, and (b) what additional speedup does it 
have?)

I'm asking because I'm still trying to look for reasons why I should accept PEP 
509, and this is brought up as a reason.

--

___
Python tracker 

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



[issue26910] dictionary literal should not allow duplicate keys

2016-05-02 Thread Luigi Semenzato

New submission from Luigi Semenzato:

This was already discussed and rejected at https://bugs.python.org/issue16385.  
I am reopening because I am not convinced that the discussion presented all 
arguments properly.

The original problem description:

lives_in = { 'lion': ['Africa', 'America],
 'parrot': ['Europe'],
 #... 100+ more rows here
 'lion': ['Europe'],
 #... 100+ more rows here
   }

The above constructor overwrites the 'lion' entry silently, often causing 
unexpected behavior.

These are the arguments presented in favor of the rejection, followed by my 
rebuttals.

1. "An error is out of the question for compatibility reasons".  No real 
rebuttal here, except I wonder if exceptions are ever made and under what 
circumstances.  I should point out that a warning may also create 
incompatibilities.

2. "There are ways to rewrite this as a loop on a list".  Yes of course, but 
the entire point of the dictionary literal is to offer a concise and convenient 
notation for entering a dictionary as program text.

3. "Being able to re-write keys is fundamental to Python dicts and why they can 
be used for Python's mutable namespaces".  This is fine but it applies to the 
data structure, not the literal constructor.

4. "A code generator could depend on being able to write duplicate keys without 
having to go back and erase previous output".  Yes, but it seems wrong to 
facilitate automated code generation at the expense of human code writing.  For 
hand-written code, I claim that in most (all?) cases it would be preferable to 
have the compiler detect key duplications.  It is easier for an automated code 
generator to check for duplications than it is for a human.

5. "There is already pylint".  True, but it forces an additional step, and 
seems like a cop-out for not wanting to do the "right thing" in the language.

For context, someone ran into this problem in my team at Google.  We fixed it 
using pylint, but I really don't see the point of having these constructor 
semantics.  From the discussions I have seen, it seems just an oversight in the 
implementation/specification of dictionary literals (search keywords: dict 
constructor, dict literal).  I'd be happy to hear stronger reasoning in favor 
of the status quo.

--
components: Interpreter Core
messages: 264657
nosy: Luigi Semenzato
priority: normal
severity: normal
status: open
title: dictionary literal should not allow duplicate keys
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue26908] "1and 0" evaluated a zero, instead of SyntaxError

2016-05-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. This is a duplicate of issue 13610. You can read issue 
13610 for more information.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> On Python parsing numbers.

___
Python tracker 

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



[issue26909] Serious performance loss (10 times) when NOT using .drain()

2016-05-02 Thread Марк Коренберг

New submission from Марк Коренберг:

https://github.com/python/asyncio/issues/338

(example of program shows bug resides on github)

--
components: asyncio
messages: 264655
nosy: gvanrossum, haypo, mmarkk, yselivanov
priority: normal
severity: normal
status: open
title: Serious performance loss (10 times) when NOT using .drain()
type: performance
versions: Python 3.5

___
Python tracker 

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



[issue26908] "1and 0" evaluated a zero, instead of SyntaxError

2016-05-02 Thread Vladimir Rutsky

New submission from Vladimir Rutsky:

Looks like there is no need to place space separators after numbers:

$ python3.5 -c "print(1and 0)"
0
$ python3.5 -c "print([1for i in range(1)])"
[1]

Not sure is this a bug or a feature, but I would expect that this should be 
SyntaxError, same as here:

$ python3.5 -c "1 and0"
  File "", line 1
1 and0
 ^
SyntaxError: invalid syntax

If this is a feature, can anyone give reasoning for it?

--
messages: 264654
nosy: rutsky
priority: normal
severity: normal
status: open
title: "1and 0" evaluated a zero, instead of SyntaxError
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-05-02 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, I'll wait until Android support is closer. Do you have a core dev who's 
mentoring/reviewing here?

--

___
Python tracker 

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



[issue23903] Generate PC/python3.def by scraping headers

2016-05-02 Thread Zachary Ware

Zachary Ware added the comment:

> There is a code for parsing preprocessor instructions in Argument Clinic.
> May be it can be reused here.

It already is, actually; its availability was a major factor in my thinking 
this would be possible and starting to work on it.

--

___
Python tracker 

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



[issue22656] `help` ignores `__doc__` of descriptors

2016-05-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26905] from multiprocessing.pool import Pool bug on linux

2016-05-02 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +jnoller, sbt -larry
type:  -> behavior

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch makes method descriptors types to be explicitly initialized as 
in 3.x.

--
components: +Interpreter Core
keywords: +patch
nosy: +serhiy.storchaka
stage:  -> patch review
Added file: http://bugs.python.org/file42685/init_method_descr_types.patch

___
Python tracker 

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



[issue25392] setup.py --quiet doesn't silence "no previously-included directories" warnings from MANIFEST.in

2016-05-02 Thread Berker Peksag

Changes by Berker Peksag :


--
components: +Distutils
nosy: +berker.peksag, dstufft, eric.araujo
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue26907] Add missing getsockopt constants

2016-05-02 Thread Christian Heimes

New submission from Christian Heimes:

The socket doesn't expose some constants for getsockopt() and setsockopt():

Get domain and protocol from socket fd
SO_DOMAIN
SO_PROTOCOL

enable/disable passing of credentials
SO_PASSCRED

get security context (SELinux context)
SO_PEERSEC

enable/disable passing of security context
SO_PASSSEC

--
assignee: christian.heimes
messages: 264649
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Add missing getsockopt constants
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue18391] socket.fromfd()'s API is difficult or impossible to use correctly in general

2016-05-02 Thread Christian Heimes

Christian Heimes added the comment:

fromfd() can be simplified after #26907 has landed.

--
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-02 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith
type:  -> behavior

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-02 Thread Antti Haapala

Antti Haapala added the comment:

s/explicitly do/explicitly access/

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-02 Thread Antti Haapala

New submission from Antti Haapala:

This is an annoying heisenbug; it seems that some objects cannot be formatted 
until you explicitly do obj.__format__. For example `object.__reduce__` behaves 
like this:

Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> format(object.__reduce__)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Type method_descriptor doesn't define __format__
>>> format(object.__reduce__)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Type method_descriptor doesn't define __format__
>>> object.__reduce__.__format__

>>> format(object.__reduce__)
""

I can replicate this in 2.7.9, .10 and .11 on Ubuntu and Debian, though it 
works on Windows Python, works in 2.6.6, and Pythons 3 wherever I've tried, but 
I've heard this also failing on Python 3.

--
title: __reduce__ format -> format(object.__reduce__) fails intermittently

___
Python tracker 

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



[issue26906] __reduce__ format

2016-05-02 Thread Antti Haapala

Changes by Antti Haapala :


--
nosy: ztane
priority: normal
severity: normal
status: open
title: __reduce__ format
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



[issue18766] IDLE: Autocomplete in editor doesn't work for un-imported modules

2016-05-02 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue24766] Subclass of property doesn't preserve instance __doc__ when using doc= argument

2016-05-02 Thread Erik Bray

Erik Bray added the comment:

Thanks for the updated patch. LGTM.

--

___
Python tracker 

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



[issue26881] modulefinder should reuse the dis module

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is pretty simple patch and I'm going to push it in short time if there are 
no objections. This can make the patch for issue26647 simpler since handling 
extended args is isolated in one function.

Alternative names for _unpack_args() are welcome.

An alternative way is to use public function get_instructions(), but this adds 
more overhead and don't work for 2.7.

--
assignee:  -> serhiy.storchaka
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue22656] `help` ignores `__doc__` of descriptors

2016-05-02 Thread Berker Peksag

Berker Peksag added the comment:

The attached patch should solve this. We probably need to add more tests. 
test_property_subclass depends on issue 24766.

--
keywords: +patch
nosy: +berker.peksag
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file42684/issue22656.diff

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I should mention a change in dis which hasn't come up for the sake of 
> explicit discussion: I modified dis to not print EXTENDED_ARG.

This may be a problem since jumps can now point on address not output in 
disassemble.

May be this is good idea (I'm +0), but it deserves separate issue.

--

___
Python tracker 

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



[issue24766] Subclass of property doesn't preserve instance __doc__ when using doc= argument

2016-05-02 Thread Berker Peksag

Berker Peksag added the comment:

test_property_decorator_doc_writable fix has already been committed in 
cc1aa0e88626.

Here's an updated patch:

* Synced with the default branch
* Adapted the test from duplicate issue 25757 (written by Torsten Landschoff)

--
nosy: +berker.peksag, torsten
stage: test needed -> patch review
Added file: http://bugs.python.org/file42683/issue24766.diff

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2016-05-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Torsten. This is a duplicate of issue 24766. Your patch 
is almost identical (except the behavior change) to the patch in issue 24766. I 
will adapt your test and attribute your name in commit message.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Subclass of property doesn't preserve instance __doc__ when 
using doc= argument

___
Python tracker 

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



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For example here is a patch that partially reverts issue26243 by making "data" 
positional parameter, but keeping "level" positional-or-keyword parameter.

--
Added file: 
http://bugs.python.org/file42682/zlib_compress_positional_only_data.patch

___
Python tracker 

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



[issue26282] Add support for partial keyword arguments in extension functions

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Removed development code from tests (thanks Martin for catching this) and adds 
support in Argument Clinic. Now the patch is complete and ready for final 
review.

--
components: +Argument Clinic, Interpreter Core
stage:  -> patch review
Added file: 
http://bugs.python.org/file42681/pyarg_parse_positional_only_and_keywords_2.patch

___
Python tracker 

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



[issue26905] from multiprocessing.pool import Pool bug on linux

2016-05-02 Thread Larry Hastings

Larry Hastings added the comment:

This has nothing to do with Argument Clinic, which is an internal tool used in 
the Python 3.x series.

--
components:  -Argument Clinic
nosy:  -859911096

___
Python tracker 

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



[issue26905] from multiprocessing.pool import Pool bug on linux

2016-05-02 Thread yangming

New submission from yangming:

When my code run on windows,it's right,but on linux,id(q) print same RAM 
address.

--
components: Argument Clinic
files: pool.py
messages: 264637
nosy: 859911096, larry
priority: normal
severity: normal
status: open
title: from multiprocessing.pool import Pool bug on linux
versions: Python 2.7
Added file: http://bugs.python.org/file42680/pool.py

___
Python tracker 

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



[issue26890] inspect.getsource gets source copy on disk even when module has not been reloaded

2016-05-02 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +yselivanov

___
Python tracker 

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



[issue26888] Multiple memory leaks after raw Py_Initialize and Py_Finalize.

2016-05-02 Thread SilentGhost

Changes by SilentGhost :


--
components: +Interpreter Core -Library (Lib)
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue26904] Difflib quick_ratio() could use Counter()

2016-05-02 Thread Wolfgang Maier

Wolfgang Maier added the comment:

Given your comment about sum((fullacount & fullbcount).values()), why not use 
its in-place version:

fullacount &= fullbcount
matches = sum(fullacount.values())

?

--
nosy: +wolma

___
Python tracker 

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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-05-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue26858] setting SO_REUSEPORT fails on android

2016-05-02 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The patch was not intended to be proposed as a way to fix this problem, but as 
an indication of what the problem is. This issue is a dependency of issue 
#26865: Meta-issue: support of the android platform.

I should have posted instead the result of running 'python -m test -v 
test_asyncio' on an android emulator running an x86 system image at API level 
21, which is:

==
ERROR: test_create_datagram_endpoint_sockopts 
(test.test_asyncio.test_base_events.BaseEventLoopWithS
electorTests)
--
Traceback (most recent call last):
  File 
"/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_asyncio/test_base_events.py",
 line 1506,
 in test_create_datagram_endpoint_sockopts
socket.SOL_SOCKET, socket.SO_REUSEPORT))
OSError: [Errno 92] Protocol not available

==
ERROR: test_create_server_reuse_port 
(test.test_asyncio.test_events.EPollEventLoopTests)
--
Traceback (most recent call last):
  File 
"/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_asyncio/test_events.py", 
line 830, in te
st_create_server_reuse_port
socket.SOL_SOCKET, socket.SO_REUSEPORT))
OSError: [Errno 92] Protocol not available

==
ERROR: test_create_server_reuse_port 
(test.test_asyncio.test_events.PollEventLoopTests)
--
Traceback (most recent call last):
  File 
"/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_asyncio/test_events.py", 
line 830, in te
st_create_server_reuse_port
socket.SOL_SOCKET, socket.SO_REUSEPORT))
OSError: [Errno 92] Protocol not available

==
ERROR: test_create_server_reuse_port 
(test.test_asyncio.test_events.SelectEventLoopTests)
--
Traceback (most recent call last):
  File 
"/sdcard/org.bitbucket.pyona/lib/python3.6/test/test_asyncio/test_events.py", 
line 830, in te
st_create_server_reuse_port
socket.SOL_SOCKET, socket.SO_REUSEPORT))
OSError: [Errno 92] Protocol not available

--
Ran 991 tests in 16.528s

FAILED (errors=4, skipped=2)
test test_asyncio failed
1 test failed:
test_asyncio
Total duration: 0:00:18

--

___
Python tracker 

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



[issue18916] Various out-of-date Lock text in 3.2+

2016-05-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the path, Christopher.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +berker.peksag, docs@python
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue18916] Various out-of-date Lock text in 3.2+

2016-05-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 203c9c4ccb2a by Berker Peksag in branch '3.5':
Issue #18916: Update thread module docstrings
https://hg.python.org/cpython/rev/203c9c4ccb2a

New changeset 57a475e0e378 by Berker Peksag in branch 'default':
Issue #18916: Update thread module docstrings
https://hg.python.org/cpython/rev/57a475e0e378

--
nosy: +python-dev

___
Python tracker 

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



[issue26305] Make Argument Clinic to generate PEP 7 conforming code

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch for 3.5 that allows to not repeat braces too much. This will 
help to backport new fixes to 3.5.

--
Added file: http://bugs.python.org/file42679/clinic_escape_braces.patch

___
Python tracker 

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



[issue23867] Argument Clinic: inline parsing code for 1-argument functions

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Because new generated code contains "if" statements and braces (and PEP 7 
requires even more braces than current patch adds). The patch for issue26305 
allows to repeat braces only twice instead of 4 times.

--

___
Python tracker 

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



[issue26902] Argument Clinic incorrectly works with custom converter and renamed parameter

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You are right. Sorry for the noise.

--

___
Python tracker 

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



[issue23867] Argument Clinic: inline parsing code for 1-argument functions

2016-05-02 Thread Larry Hastings

Larry Hastings added the comment:

Why is this dependent on #26305?

--

___
Python tracker 

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



[issue26305] Make Argument Clinic to generate PEP 7 conforming code

2016-05-02 Thread Larry Hastings

Larry Hastings added the comment:

I'm not excited by this new addition to PEP 7, so I'm excusing myself from this 
issue.

--

___
Python tracker 

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



[issue26902] Argument Clinic incorrectly works with custom converter and renamed parameter

2016-05-02 Thread Larry Hastings

Larry Hastings added the comment:

This is caused by your "meth_o inline" code, which isn't checked in yet.  A 
clean checkout of CPython trunk generates this correct code:

if (!PyArg_Parse(arg, "O&:test", PyUnicode_FSConverter, ))

Maybe you don't need to use bugs.python.org as your personal bug tracker; maybe 
you don't need to add me to your private bugs.

--
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



[issue23903] Generate PC/python3.def by scraping headers

2016-05-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also closely related issue26900.

--

___
Python tracker 

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



[issue24225] Idlelib: changing file names

2016-05-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For back compatibility reasons, I rejected a 'simple renaming', much as I would 
like to do it for reasons already given, and closed *this* issue in msg250451.  
As I said then here and elsewhere, I instead propose to add new files with new 
names.  As I said above, I will propose a specific, revised plan in a new issue 
that I will open after some sleep. Please wait for that to discuss anything 
other than specific new names.

--

___
Python tracker 

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



[issue23903] Generate PC/python3.def by scraping headers

2016-05-02 Thread Steve Dower

Steve Dower added the comment:

As I recall, the tool is ready to go. The problem is the argument over what to 
do with all the APIs that currently are incorrect. Zach had a list at PyCon 
last year, and the consensus seemed to be that "someone" should figure out 
whether each API should be stable or not. Since Zach understandably doesn't 
want to be that someone, there's really no way to reliably tool this process 
when there are a number of existing violations.

(FWIW, I believe we should just add them to the stable list, as that's the only 
way to guarantee source compatibility. They've already shipped in 3.5 and 
people can use them on non-Windows OSs.)

--

___
Python tracker 

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