[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread Georg Brandl

Georg Brandl added the comment:

Addressing review comments.

--
Added file: 
http://bugs.python.org/file36789/pyobject_issubclass_isinstance_speedup_v2.patch

___
Python tracker 

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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Antoine Pitrou

New submission from Antoine Pitrou:

>>> inf = float('inf')
>>> z = complex(-0.0, -inf)
>>> cmath.log(z)
(inf-1.5707963267948966j)
>>> cmath.log10(z)
(inf-0.6821881769209206j)
>>> cmath.log(z, 10)
(inf+nan*j)

--
components: Library (Lib)
messages: 228307
nosy: eric.smith, lemburg, mark.dickinson, pitrou, stutzbach
priority: low
severity: normal
status: open
title: Inconsistent cmath.log behaviour
type: behavior
versions: 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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f33a4a2b425 by Georg Brandl in branch 'default':
Closes #22540: speed up PyObject_IsInstance and PyObject_IsSubclass in the 
common case that the second argument has metaclass "type".
https://hg.python.org/cpython/rev/4f33a4a2b425

--
nosy: +python-dev
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



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

2014-10-03 Thread anon

anon added the comment:

Since I'm not familiar with the process I'd request someone creates the PEP. 
But if really necessary I can try.

I just really want to see this in Python 3.5 - it's really essential to a 
number of scientific methods. I know several open source projects that would 
benefit from it.

--

___
Python tracker 

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



[issue11975] Fix referencing of built-in types (list, int, ...)

2014-10-03 Thread Florent Rougon

Changes by Florent Rougon :


--
nosy: +frougon

___
Python tracker 

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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Antoine Pitrou

New submission from Antoine Pitrou:

>>> complex(-0.0)
0j
>>> complex(-0.0).real
-0.0

--
components: Interpreter Core
messages: 228310
nosy: eric.smith, lemburg, mark.dickinson, pitrou, stutzbach
priority: normal
severity: normal
status: open
title: incomplete complex repr() with negative zeroes
type: behavior
versions: 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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread STINNER Victor

STINNER Victor added the comment:

A buildbot is failing since your change.

http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/1261/steps/test/logs/stdio

==
ERROR: test_decimal_fraction_comparison (test.test_decimal.CUsabilityTest)
--
Traceback (most recent call last):
  File 
"/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_decimal.py", 
line 1711, in test_decimal_fraction_comparison
self.assertLess(D(0), F(1,9))
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", 
line 1174, in assertLess
if not a < b:
TypeError: unorderable types: decimal.Decimal() < Fraction()

==
FAIL: test_abc (test.test_decimal.CPythonAPItests)
--
Traceback (most recent call last):
  File 
"/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_decimal.py", 
line 2404, in test_abc
self.assertTrue(issubclass(Decimal, numbers.Number))
AssertionError: False is not true

==
ERROR: test_mixed_comparisons (test.test_numeric_tower.ComparisonTest)
--
Traceback (most recent call last):
  File 
"/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_numeric_tower.py",
 line 173, in test_mixed_comparisons
self.assertLess(first, second)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", 
line 1174, in assertLess
if not a < b:
TypeError: unorderable types: decimal.Decimal() < Fraction()

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue22515] Implement partial order on Counter

2014-10-03 Thread Ram Rachum

Ram Rachum added the comment:

Attached patch of implementation with tests. I haven't actually run this 
(because I don't know how to run Python's test suite) so there are likely to be 
bugs. if there's general agreement about this direction I'll figure out how to 
run the test so I could ensure it works.

--
keywords: +patch
Added file: http://bugs.python.org/file36790/patch.patch

___
Python tracker 

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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The test_decimal failure can be reproduced using:

  ./python  -m test -W test_datetime test_decimal

--

___
Python tracker 

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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Eric V. Smith

Eric V. Smith added the comment:

Where are you seeing this?

On an Ubuntu 13.10 x86 box, I see:

>>> complex(-0.0)
(-0+0j)

This is with 2.7.5+, 3.3.2+ (from Ubuntu distro), and with 3.5.0a0 and 
3.4.2rc1+ built locally.

--

___
Python tracker 

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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Oh, my bad. This is with an Anaconda build of Python.

--
resolution:  -> works for me
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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Eric V. Smith

Eric V. Smith added the comment:

No problem!

For completeness, I also see the correct behavior on cygwin 32-bit 2.7.3 and 
3.2.3. I don't have access to a straight Windows version.

--

___
Python tracker 

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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6cfe929d1de5 by Antoine Pitrou in branch 'default':
Make test_datetime a better citizen (issue #22540)
https://hg.python.org/cpython/rev/6cfe929d1de5

--

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-03 Thread Tommy Andersen

New submission from Tommy Andersen:

The format documentation for the Format Specification Mini-Language for python 
3.3 (perhaps newer and older as well) at: 
https://docs.python.org/3.3/library/string.html 

States for type '' (for floating point numbers):

Similar to 'g', except with at least one digit past the decimal point and a 
default precision of 12. This is intended to match str(), except you can add 
the other format modifiers.

This appears not to be true, the following code example, run in Python 3.3.2:

>>> '{}'.format(3.14159265358979323846264338327950288419)
'3.141592653589793'

As it can be seen form the output the default precision appears to be 15.

--
assignee: docs@python
components: Documentation
messages: 228318
nosy: Barium, docs@python
priority: normal
severity: normal
status: open
title: Wrong default precision in documentation for format
versions: Python 3.3

___
Python tracker 

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



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

I think this is mostly unavoidable: cmath.log(z, 10) is a compound operation 
that does the equivalent of cmath.log(z) / cmath.log(10), while cmath.log10 is 
doing everything at once.

If anything, this is a problem in how complex division is done: it's arguable 
that division by a complex number with zero imaginary part should be 
special-cased here.

>>> inf = float('inf')
>>> z = complex(-0.0, -inf)
>>> cmath.log(10)
(2.302585092994046+0j)
>>> cmath.log(z)
(inf-1.5707963267948966j)
>>> cmath.log(z) / cmath.log(10)
(inf+nanj)

A simpler example just involving division:

>>> complex(2.0, inf) / 2.0   # expect 1 + infj.
(nan+infj)

--

___
Python tracker 

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



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

One other option that doesn't involve changing the behaviour of complex 
division would be to special-case `cmath.log` in the case when the second 
argument is a float or an int.

--

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-03 Thread Geert Jansen

Geert Jansen added the comment:

New patch attached. This patch makes SSLSocket use SSLObject. The big benefit 
here is obviously test coverage.

I decided against using SSLObject as a mixin, because all methods need to be 
reimplemented anyway because for SSLSocket they need to handle the non-SSL 
case. Instead, I made SSLSocket._sslobj an SSLObject rather than a 
_ssl._SSLSocket. The patch is rather small, so I kept it incremental to patch4.

Test suite runs fine. I had to update one SSL test 
(test_unknown_channel_binding). Because the test for the binding type is now in 
SSLObject, a non-connected SSLSocket will return None even for an unknown 
binding. Arguably this is even more correct because the binding type can depend 
on the cryptographic protocol used, e.g. tls-unique doesn't work for SSLv2 
(it's currently not checked and nobody cares about SSLv2, I'm just arguing from 
theory here).

A second change is that the private _sslobj is now a different type. However 
since this is clearly an internal attribute, I think people that are using this 
should expect breakage.

Antoine, please let me know if this is now ready for merging in your view or if 
not what you'd like me to do still. Thanks.

--
Added file: http://bugs.python.org/file36791/ssl-memory-bio-4-incr2.patch

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well... I would have expected this approach to yield a bigger reduction in code 
size. If it doesn't shrink the code, then I'm not sure it's worthwhile. What do 
you think?

(also, why do you have to add an "owner" attribute?)

--

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-03 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith, mark.dickinson

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-03 Thread Eric V. Smith

Eric V. Smith added the comment:

I think this is a result of changing the precision of str() to match repr().

2.7 prints:
'3.14159265359'

--

___
Python tracker 

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



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue21965] Add support for Memory BIO to _ssl

2014-10-03 Thread Geert Jansen

Geert Jansen added the comment:

> Well... I would have expected this approach to yield a bigger reduction in 
> code size. If it doesn't shrink the code, then I'm not sure it's worthwhile. 
> What do you think?

I think the improved test coverage might still make it worthwhile. All tests 
are now exercising the SSLObject methods via SSLSocket. Also it's more future 
proof as the risk is less that you'd add a new method to SSLSocket without 
adding it to SSLObject as well.

It's not clear cut. Either way is fine I think.

> (also, why do you have to add an "owner" attribute?)

That is to support the first argument passed to the sever name callback set 
with set_servername_callback(). This will be an SSLSocket or an SSLObject 
instance depending on who's using it.

--

___
Python tracker 

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



[issue19468] Relax the type restriction on reloaded modules

2014-10-03 Thread Brett Cannon

Brett Cannon added the comment:

I think the check can be removed as long as an AttributeError is caught when 
trying to access module.__name__ and a message mentioning that the user 
probably meant to pass in a module is used, e.g.:

try:
name = module.__spec__.name
except AttributeError:
try:
name = module.__name__
except AttributeError:
raise TypeError("argument should be a module")

--

___
Python tracker 

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



[issue22543] -W option cannot use non-standard categories

2014-10-03 Thread Brett Cannon

Brett Cannon added the comment:

Doing the initialization later is not really an option as there can be warnings 
in the parser so it has to be resolved very early on.

I guess some form could be a possibility, but that's also tricky as subclass 
matching also still needs to work. I think we would need to see a patch on the 
proposed solution before considering its acceptance.

Another option would to parse it twice: once early on for Python internals and 
then again later once site-packages and various other things have been set up. 
Once again I would need to look at a patch before making a decision on whether 
it's an acceptable solution.

--
versions:  -Python 2.7, Python 3.1, Python 3.2, 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



[issue17848] can't compile with clang and build a shared lib due to libffi

2014-10-03 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue17848] can't compile with clang and build a shared lib due to libffi

2014-10-03 Thread Brett Cannon

Changes by Brett Cannon :


--
title: issue about compile with clang and build a shared lib -> can't compile 
with clang and build a shared lib due to libffi

___
Python tracker 

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



[issue8627] Unchecked PyErr_WarnPy3k return value in Objects/typeobject.c

2014-10-03 Thread Brett Cannon

Brett Cannon added the comment:

Is there any cleanup to worry about as the comment suggests? If not then the 
patch LGTM if it does lead to any memory leak.

--

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum

Changes by Ram Rachum :


--
components: Library (Lib)
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Implement an informative `BoundArguments.__repr__`
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



[issue12780] Clean up tests for pyc/pyo in __file__

2014-10-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1745fd612d73 by R David Murray in branch '3.4':
#12780: update inspect test skipIf for PEP 3147.
https://hg.python.org/cpython/rev/1745fd612d73

New changeset 8120de25932f by R David Murray in branch 'default':
Merge: #12780: update inspect test skipIf for PEP 3147.
https://hg.python.org/cpython/rev/8120de25932f

--

___
Python tracker 

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



[issue12780] Clean up tests for pyc/pyo in __file__

2014-10-03 Thread R. David Murray

R. David Murray added the comment:

It is not true that __file__ will always end with '.py'.  If *only* the .pyc or 
.pyo file exists (not the PEP 3147 version, but just modname.pyc on the 
pythonpath), then __file__ will end with .pyc.  It is also the case that 
__file__ may end with something *else*, such as .so on unix and .pyd on 
Windows, as it does in this particular case.

So, dropping the extension check is the wrong logic fix.  The correct fix is to 
make sure it isn't '.py', because the original check was making sure there 
wasn't source code to load.  When might unicodedata be a python file and not a 
sourceless (from inspect's point of view) binary?  pypy :)  I have no idea if 
this is actually an issue on pypy, but I'd hate to introduce a new failure for 
them in the process of doing a cleanup.

The reason for the __file__ check is that we are looking for an *external* 
compiled module for the test.  Originally I used time, but that failed on 
windows because time is part of the main binary on windows and has no __file__ 
attribute.  The idea behind doing the __file__ check is that someone 
re-packaging python might move unicodedata into the main binary on windows, 
since if I understand correctly which modules are included there is somewhat 
arbitrary.

--
nosy: +r.david.murray
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
versions: +Python 3.4, Python 3.5 -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



[issue17848] can't compile with clang and build a shared lib due to libffi

2014-10-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Leon,

Are you trying to run compiled python binary before it was installed?  If so, 
this is expected and not specific to clang or libffi.

If your issue is something else - please explain how to reproduce it and post 
the error messages that you see.

--

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2014-10-03 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Yury Selivanov

New submission from Yury Selivanov:

Can you propose a format for it?

I'm not sure that including all arguments and their reprs is a good idea, as it 
will make BA's repr too long.

--
nosy: +yselivanov

___
Python tracker 

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



[issue22508] Remove __version__ string from email

2014-10-03 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

Looks like a safe change. There is only one user in all Debian sources, and 
it's on Python 2:

http://codesearch.debian.net/search?q=email.__version__

--
nosy: +tshepang

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum

Ram Rachum added the comment:

Something like 

I have no problem with truncation when it gets too long.

--

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Yury Selivanov

Yury Selivanov added the comment:

How about we just list bound arguments names, without values?

--

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum

Ram Rachum added the comment:

Em, that kind of defeats the purpose of describing the object, doesn't it?

--

___
Python tracker 

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



[issue22508] Remove __version__ string from email

2014-10-03 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Oct 03, 2014, at 04:19 PM, Tshepang Lekhonkhobe wrote:

>Looks like a safe change. There is only one user in all Debian sources, and 
>it's on Python 2:
>
>http://codesearch.debian.net/search?q=email.__version__

Hahahahahahahaha

--

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Yury Selivanov

Yury Selivanov added the comment:

Yes and no ;)

You can have partially bound args, you can bind just one argument and use 
defaults for the rest, etc. I agree that it's not an ideal solution, but it is 
a sane compromise.

--

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum

Ram Rachum added the comment:

I think the point of `__init__` is to know what the object is, and if you're 
hiding the values then someone has to access the attributes to find out the 
values and that sucks.

--

___
Python tracker 

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



[issue22540] speed up isinstance and issubclass for the usual cases

2014-10-03 Thread Georg Brandl

Georg Brandl added the comment:

Thanks for fixing! I did run "make test" locally, but that did not produce the 
failure.

--

___
Python tracker 

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



[issue22508] Remove __version__ string from email

2014-10-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 67f9e757f21b by R David Murray in branch 'default':
#22508: Drop email __version__ string.  It no longer means anything.
https://hg.python.org/cpython/rev/67f9e757f21b

--
nosy: +python-dev

___
Python tracker 

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



[issue22508] Remove __version__ string from email

2014-10-03 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> fixed
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



[issue21831] integer overflow in 'buffer' type allows reading memory

2014-10-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5ef28c22dc24 by doko in branch '2.7':
- Add CVE number for Issue #21831
https://hg.python.org/cpython/rev/5ef28c22dc24

--

___
Python tracker 

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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Out of interest, what caused Anaconda to behave differently?  Is there some 
fragility that needs fixing in the Python core code?

--

___
Python tracker 

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2014-10-03 Thread lkraav

Changes by lkraav :


--
nosy: +lkraav

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Antoine Pitrou

New submission from Antoine Pitrou:

This may be a parser limitation...

>>> z = -0.-0.j
>>> z
(-0+0j)
>>> z.imag
0.0
>>> z = 0.-0.j
>>> z.imag
0.0

--
components: Interpreter Core
messages: 228343
nosy: benjamin.peterson, mark.dickinson, pitrou
priority: low
severity: normal
status: open
title: Bogus parsing of negative zeros in complex literals
type: behavior
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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

This is not a bug, but a known and difficult-to-avoid issue with signed zeros 
and creating complex numbers from real and imaginary parts.  The safe way to do 
it is to use the `complex(real_part, imag_part)` construction.

In the first example, you're subtracting a complex number (0.j) from a float 
(-0.0).  The float gets promoted to a complex (by filling in an imaginary part 
of +0.0), and the imaginary literal is similarly treated as a complex number 
(by filling  in a 0.0 for the real part).  So the subtraction is doing:

  complex(-0.0, 0.0) - complex(0.0, -0.0)

which as expected gives a real part of -0.0, and an imaginary part of +0.0.

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2014-10-03 Thread lkraav

lkraav added the comment:

I may be seeing this running tracd-1.1.2b1 on python 2.7.7

http://trac.edgewall.org/ticket/11772

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Sorry; that should be:

  complex(-0.0, 0.0) - complex(0.0, 0.0)

The imaginary part is then worked out as (0.0 - 0.0), which (in all rounding 
modes but round-towards-negative) is 0.0.

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

P.S.  The C standardisation folks tried to introduce the Imaginary type 
(optional for a conforming implementation) to get around exactly this type of 
problem, but it doesn't seem to have caught on in most mainstream compilers.

--

___
Python tracker 

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



[issue22549] bug in accessing bytes, inconsistent with normal strings and python 2.7

2014-10-03 Thread Kevin Hendricks

New submission from Kevin Hendricks:

Hi,

I am working on porting my ebook code from Python 2.7 to work with both Python 
2.7 and Python 3.4 and have found the following inconsistency I think is a bug 
...

KevinsiMac:~ kbhend$ python3
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> o = '123456789'

>>> o[-3]
'7'

>>> type(o[-3])


>>> type(o)


the above is what I expected but under python 3 for bytes you get the following 
instead:

>>> o = b'123456789'

>>> o[-3]
55

>>> type(o[-3])


>>> type(o)

 


When I compare this to Python 2.7 for both bytestrings and unicode I see the 
expected behaviour. 

Python 2.7.7 (v2.7.7:f89216059edf, May 31 2014, 12:53:48) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


>>> o = '123456789'

>>> o[-3]
'7'

>>> type(o[-3])


>>> type(o)



>>> o = u'123456789'

>>> o[-3]
u'7'

>>> type(o[-3])


>>> type(o)



I would consider this a bug as it makes it much harder to write python code 
that works on both python 2.7 and python 3.4

--
components: Interpreter Core
messages: 228348
nosy: kevinbhendricks
priority: normal
severity: normal
status: open
title: bug in accessing bytes, inconsistent with normal strings and python 2.7
type: behavior
versions: 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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Actually, I realize it's not even Anaconda. I was just using a 2.6 interpreter, 
which apparently had a differently complex repr().

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

FTR, a similar issue with regular floats:

>>> -0.0-0.0
-0.0
>>> (-0.0)-0.0
-0.0
>>> z = -0.0
>>> z - z
0.0

--

___
Python tracker 

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



[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Ah yes, that would make sense.  I vaguely remember fixing this between Python 
2.6 and Python 2.7.

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Nope, no float issue here. :-)  Which part of the output do you think is wrong?

Your last (z - z) is doing ((-0.0) - (-0.0)), not (-0.0 - 0.0).  This is all 
following the IEEE 754 rules.

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, the last part is ok. It's the preceding parts that are a bit surprising.

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Oops, I get it now. Sorry.

--

___
Python tracker 

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



[issue8627] Unchecked PyErr_WarnPy3k return value in Objects/typeobject.c

2014-10-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

How did you detect a leak Mark?

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

> Oops, I get it now.

Okay. :-)

Just for the record, for anyone encountering this issue in the future, here's 
the relevant extract from section 6.3 of IEEE 754-2008:

"""
When the sum of two operands with opposite signs (or the difference of two 
operands with like signs) is exactly zero, the sign of that sum (or difference) 
shall be +0 in all rounding-direction attributes except roundTowardNegative; 
under that attribute, the sign of an exact zero sum (or difference) shall be 
−0. However, x + x = x − (−x) retains the same sign as x even when x is zero.
"""

It doesn't cover the "sum with like signs" or "difference with opposite signs" 
cases, I suppose because it should be obvious what happens in those cases.

--

___
Python tracker 

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What is tracd doing? This issue should only appear when calling one of the 
debugging functions in the gc module, AFAICT.

--

___
Python tracker 

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



[issue8627] Unchecked PyErr_WarnPy3k return value in Objects/typeobject.c

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Whoops; make that two years ago, not four.  The rest stands, though.

--

___
Python tracker 

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



[issue8627] Unchecked PyErr_WarnPy3k return value in Objects/typeobject.c

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

> How did you detect a leak Mark?

Um.  It was four years ago.  I have no idea. :-)

I suspect I was just looking at the C code and being my usual nasty suspicious 
self.

--

___
Python tracker 

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



[issue22548] Bogus parsing of negative zeros in complex literals

2014-10-03 Thread Mark Dickinson

Mark Dickinson added the comment:

> It doesn't cover the "sum with like signs"

Ah, sorry, yes it does;  it's in the previous paragraph.

"""
[...] the sign of a sum, or of a difference x−y regarded as a sum x+(−y), 
differs from at most one of the addends’ signs
"""

--

___
Python tracker 

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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-10-03 Thread Stefan Krah

Stefan Krah added the comment:

Okay, the whole thing isn't that urgent either.


Sorry for the confusion w.r.t slicing: I misremembered what the
latest numpy version did:

a)

   >>> x = np.array([[1,2,3,]])
   >>> x.strides
   (9223372036854775807, 8)


b)
 
   >>> x = np.array([[1,2,3], [4,5,6]])[:1]
   >>> x.strides
   (24, 8)


Somehow I thought that case b) would also produce the special marker,
but it doesn't, so all is well.

--
priority: normal -> low

___
Python tracker 

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



[issue22550] issubclass can fail after module reloading

2014-10-03 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Inspired by test failure in issue22540. This is still looks as a bug to me:

>>> import sys, decimal, numbers
>>> issubclass(decimal.Decimal, numbers.Number)
True
>>> del sys.modules['numbers']
>>> import numbers
>>> issubclass(decimal.Decimal, numbers.Number)
False

--
messages: 228362
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: issubclass can fail after module reloading
type: behavior
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



[issue22550] issubclass can fail after module reloading

2014-10-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

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



[issue22549] bug in accessing bytes, inconsistent with normal strings and python 2.7

2014-10-03 Thread R. David Murray

R. David Murray added the comment:

Agreed, but that is a design decision that was taken long ago (regretted by 
more than a few but defended by others).  You can find a number of discussions 
of this by searching the python-dev archives, including some more recent 
discussions on possibilities for lessening the pain, but I don't remember if 
any of those turned into real proposals.

For now, you can find some helpers in six, or you can write your code using 
slice notation (b'abc'[1:2] == b'b').

--
nosy: +r.david.murray
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



[issue22550] issubclass can fail after module reloading

2014-10-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

How would Decimal know that someone has swapped the decimal module in 
sys.modules?

--

___
Python tracker 

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



[issue16066] Truncated POST data in CGI script on Windows 7

2014-10-03 Thread Eyal Gruss

Eyal Gruss added the comment:

i can confirm on win 7 and python 3.4.1

--
nosy: +Eyal.Gruss

___
Python tracker 

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



[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-03 Thread Matthias Klose

Matthias Klose added the comment:

no, it doesn't. at least when testing the installed python installation, it 
just fails:

https://jenkins.qa.ubuntu.com/job/utopic-adt-python2.7/39/?

--
nosy: +doko
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue22546] Wrong default precision in documentation for format

2014-10-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

"The precision is a decimal number indicating how many digits should be 
displayed ... before and after the decimal point for a floating point value 
formatted with 'g' or 'G'. It seems that str, repr, and '' are using precision 
16, and the doc should be changed to match.

>>>str(.314159265358979323846264338327950288419)
'0.3141592653589793' # 16, not counting 0.

>>> '{}'.format(3.14159265358979323846264338327950288419)
'3.141592653589793'
>>> '{:.16g}'.format(3.14159265358979323846264338327950288419)
'3.141592653589793'
>>> str(3.14159265358979323846264338327950288419)
'3.141592653589793'  # 16

But I discovered this 'anomaly' (bug?)
>>> str(31.4159265358979323846264338327950288419)
'31.41592653589793'
>>> str(33.14159265358979323846264338327950288419)
'33.1415926535898'  # precision 15
I expected this last to be
'33.14159265358979'
as 32... rounds down, not up.

repr and '{}'.format act the same.

--
nosy: +terry.reedy
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.4, Python 3.5 -Python 3.3

___
Python tracker 

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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2014-10-03 Thread Mark Lawrence

Mark Lawrence added the comment:

How do we take this forward, also considering #12939, #21859 and #14243 and 
possibly others?

--
nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

For insufficient memory not an incorrect fix, though?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue16700] Document that bytes OS API can returns unusable results on Windows

2014-10-03 Thread Mark Lawrence

Mark Lawrence added the comment:

As #13247 has been closed "not a bug" and #16656 "won't fix" shouldn't this be 
done sooner rather than later?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2014-10-03 Thread Mark Lawrence

Mark Lawrence added the comment:

This is one of several Windows file related issues, see also #12939, #21859, 
#15244 and possibly others.  How can we take this forward? If it's of any use I 
can help with testing as I've a new Windows 8.1 HP laptop with 8G of memory.

--
nosy: +BreamoreBoy, steve.dower, zach.ware -brian.curtin
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-10-03 Thread Ben Roberts

Ben Roberts added the comment:

Any thoughts/reviews on the patch?

--

___
Python tracker 

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



[issue22551] Anything results in a SyntaxError after -i -u -c on 2.7.8 on Windows 7

2014-10-03 Thread Taylor Marks

New submission from Taylor Marks:

On Python 2.7.8, on Windows 7, if I start up the Python interactive console 
using the flags -i -u -c, nothing else will be considered valid syntax from 
that point forward.

My understanding is:

-i tells Python to enter interactive mode after it's done running whatever else 
it's told to do
-u tells Python to not buffer output
-c tells Python to treat any further arguments as Python code and to run it
None of these flags should be causing the issues that I'm seeing, I don't think.

Example:

$ python -i -u -c "print('Test')"
Test
>>> print('verify')
  File "", line 1
print('verify')
^
SyntaxError: invalid syntax

This doesn't occur on my computer running OS X Mavericks (10.9.4) and Python 
2.7.6 which leads me to think this may be a platform or version specific 
issue...

--
components: Interpreter Core, Windows
messages: 228373
nosy: Taylor.Marks
priority: normal
severity: normal
status: open
title: Anything results in a SyntaxError after -i -u -c on 2.7.8 on Windows 7
type: behavior
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



[issue22515] Implement partial order on Counter

2014-10-03 Thread Ram Rachum

Ram Rachum added the comment:

Fixed patch attached. Still needs someone to run it and see whether there are 
any bugs.

--
Added file: http://bugs.python.org/file36792/patch2.patch

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2014-10-03 Thread Alex Gaynor

Alex Gaynor added the comment:

Attached patch also adds a test -- I'm not convinced this is the best way to 
test this, but I don't see any other way either.

--
Added file: http://bugs.python.org/file36793/issue22449.diff

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Context: inspect.signature returns an inspect.Signature instance. Its .bind and 
.bind_partial methods return ab inspect.BoundArguments instance with a standard 
<...@ 0x...> representation.

>>> import inspect
>>> def foo(a, b=10): pass

>>> ba = inspect.signature(foo).bind(5)
>>> ba


BAs already have 3 data access methods
>>> ba.arguments  # I believe this describes the object pretty fully
OrderedDict([('a', 5)])
>>> ba.args
(5,)
>>> ba.kwargs
{}

A possible proposal for this case would be .  However, 
this contains the same info as ba.arguments but in a less accessible form.

Listing all parameters (and their default values if any) would be wrong as the 
additional info is not part of the object.  The doc says to use 
Signature.parameters for full info, and it shows how to do that.  So I am 
negative on the proposal.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Ram Rachum

Ram Rachum added the comment:

Another thing I proposed in python-ideas is to have `__getitem__` delegate to 
`.arguments`, so this proposal is similar in spirit, because I want to have 
`__repr__` show information from `.arguments`.

To be honest I don't see the point in having to access `.arguments` manually 
for anything. `BoundArguments` is all about arguments. I don't see a reason to 
waste anyone's time with accessing an attribute on it to get to the arguments. 
There isn't much more to get on the thing. So this applies both to __repr__ and 
__getitem__.

--

___
Python tracker 

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



[issue18903] IDLE file-completion is case-sensitive in Windows

2014-10-03 Thread Mark Lawrence

Mark Lawrence added the comment:

@Terry can you comment on Westley's patch please.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Yury Selivanov

Yury Selivanov added the comment:

> Another thing I proposed in python-ideas is to have `__getitem__` delegate to 
> `.arguments`, so this proposal is similar in spirit, because I want to have 
> `__repr__` show information from `.arguments`.

Big -1 on __getitem__

> To be honest I don't see the point in having to access `.arguments` manually 
> for anything. `BoundArguments` is all about arguments.

I agree. I'll take a look.

--
assignee:  -> yselivanov
nosy: +larry, ncoghlan

___
Python tracker 

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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2014-10-03 Thread Steve Dower

Steve Dower added the comment:

As much as I like the idea of using OS handles everywhere, the compatibility 
issues are probably too significant, and you can't mix CRT methods with OS 
methods because the CRT does its own buffering. Of course, you can open a file 
with the Win32 API and immediately call open_osfhandle() safely enough.

It seems this should be solvable with the opener argument of open(). Was that 
discussed and I missed it? Would the ability to write "open(f, 
opener=with_same_sharing_as(f))" be okay/useful/relevant for all platforms?

--

___
Python tracker 

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



[issue22547] Implement an informative `BoundArguments.__repr__`

2014-10-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

.arguments returns a mutable (ordered) dict that can be modified.  See the 
example in the doc
https://docs.python.org/3.4/library/inspect.html#inspect.BoundArguments

--

___
Python tracker 

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



[issue19472] inspect.getsource() raises a wrong exception type

2014-10-03 Thread Yury Selivanov

Yury Selivanov added the comment:

> @Yury do you agree with this?

I think it's a perfectly normal behaviour. OSError is raised for valid kind of 
objects, and TypeError is raised when you're passing something weird. That's a 
pretty common practice is Python.

--

___
Python tracker 

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



[issue19472] inspect.getsource() raises a wrong exception type

2014-10-03 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-03 Thread Matthias Klose

Matthias Klose added the comment:

maybe, but then you should skip the test, or expect at least a MemoryError.

--

___
Python tracker 

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



[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

How much memory does that whatever is running that test have?

On Fri, Oct 3, 2014, at 17:17, Matthias Klose wrote:
> 
> Matthias Klose added the comment:
> 
> maybe, but then you should skip the test, or expect at least a
> MemoryError.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue22549] bug in accessing bytes, inconsistent with normal strings and python 2.7

2014-10-03 Thread Kevin Hendricks

Kevin Hendricks added the comment:

Thanks for letting me know this was expected behaviour.  I see the same "issue" 
holds true while using:

for c in b'0123456789':
   print(ord(c))
 
I ended up using slices nearly everyplace.  Still ran into iterator issues.  
Horrible hack really.  

I think I will spend some time reading the python dev archives to figure out 
how anyone could defend this approach.

FWIW, introducing a bytes class that works exactly like byte (non-unicode 
strings) in python 2.X but disallowing any automatic up-conversion to full 
unicode (like during concatenation), would have been a useful step.  

I work on decoding binary formatted ebook files all of the time, and python 3's 
second class treatment of bytes makes no sense to me.  Perfectly valid code can 
be written using only utf-8 and latin-1 encoded bytestrings with no need to 
upconvert to anything.  It is practically impossible to support code like that 
in Python 3.

Boggles the mind.

Thanks again for the fast response.

Kevin

--

___
Python tracker 

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



[issue22550] issubclass can fail after module reloading

2014-10-03 Thread Yury Selivanov

Yury Selivanov added the comment:

I don't think it a bug or that it's possible to do something about it. 
Reloading modules in Python should usually be just avoided by all means.

--
nosy: +brett.cannon, yselivanov

___
Python tracker 

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



[issue22551] Anything results in a SyntaxError after -u on 2.7.8 on Windows 7

2014-10-03 Thread Taylor Marks

Taylor Marks added the comment:

I checked a few other combinations of flags:

-i -c works fine.
-u has the same issue as described in my opening message.

This occurs in both cmd and PowerShell, running as admin.

--
title: Anything results in a SyntaxError after -i -u -c on 2.7.8 on Windows 7 
-> Anything results in a SyntaxError after -u on 2.7.8 on Windows 7

___
Python tracker 

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



[issue22551] Anything results in a SyntaxError after -u on 2.7.8 on Windows 7

2014-10-03 Thread Taylor Marks

Taylor Marks added the comment:

Sorry for multiple consecutive posts... I don't see a way to edit prior posts. 
The stack trace I posted in my first message has the arrow in the wrong spot. 
It should actually be pointing to the first space after the closing brace.

Here's a simpler (and correct) stack trace:

$ python -u
>>> print("Test")
  File "", line 1
print("Test")
 ^
SyntaxError: invalid syntax

--

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2014-10-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9c52836aec8 by Benjamin Peterson in branch '2.7':
also use openssl envvars to find certs on windows (closes #22449)
https://hg.python.org/cpython/rev/d9c52836aec8

New changeset e1f453e13f8d by Benjamin Peterson in branch '3.4':
also use openssl envvars to find certs on windows (closes #22449)
https://hg.python.org/cpython/rev/e1f453e13f8d

New changeset f1113c568c60 by Benjamin Peterson in branch 'default':
merge 3.4 (#22449)
https://hg.python.org/cpython/rev/f1113c568c60

--
nosy: +python-dev
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



[issue22551] Anything results in a SyntaxError after -u on 2.7.8 on Windows 7

2014-10-03 Thread Taylor Marks

Taylor Marks added the comment:

I found someone else describing the same behavior in 2.4 here, I guess the 
conclusion is it isn't a bug:

http://bytes.com/topic/python/answers/162599-windows-python-2-4-unbuffered-flag-causes-syntaxerror-interactive-sessions

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



[issue22515] Implement partial order on Counter

2014-10-03 Thread Ethan Furman

Ethan Furman added the comment:

Testing the patch...

--

___
Python tracker 

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



[issue19453] pydoc.py doesn't detect IronPython, help(foo) can hang

2014-10-03 Thread Mark Lawrence

Mark Lawrence added the comment:

There's a two line patch inline in msg201750.  If it's acceptable I'll do a 
formal patch myself unless someone else wants to pick this up.

--
nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



  1   2   >