[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with the others.  This is unnecessary feature creep that doesn't make 
sense for typical use cases.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29944] Argumentless super() fails in classes constructed with type()

2017-04-08 Thread Dan Snider

Dan Snider added the comment:

Just wanted to add that I found this when I was trying to find a way to 
decorate all methods in a class without using a metaclass or modifying 
__getattr__.


Using Josh's workaround, here's a simple demonstration that (at least at first 
glance) prints a message when a method is called and when it is finished:

def mydec(*, enter=True, exit=True):
def make_closure(__class__):
return (lambda: super).__closure__
def outer(cls):
def wrapper(method):
@functools.wraps(method)
def inner(*args, **kwargs):
if enter:
print('entering', method.__qualname__)
r = method(*args, **kwargs)
if exit:
print('exiting', method.__qualname__)
return method(*args, **kwargs)
return inner
for name, value in cls.__dict__.items():
if isinstance(value, types.FunctionType):
method = types.FunctionType(getattr(cls, name).__code__,
globals(),
closure=make_closure(cls))
setattr(cls, name, wrapper(method))
return cls
return outer

--

___
Python tracker 

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



[issue23674] super() documentation isn't very clear

2017-04-08 Thread Martin Panter

Martin Panter added the comment:

The magical no-argument call could also be clarified:

8. Define in the main text what happens when you omit the first argument (the 
subclass) to “super”. At the moment, I think the reader could infer that it is 
the method’s class, but this is only hinted by reading the comment in the 
illustration and Raymond’s external web page. The documentation should also 
clarify how it works, or at least be clear when it is not supported (e.g. one 
method assigned to multiple classes, functions defined outside a class 
definition, decorators that re-create the class, “super” renamed).

9. The no-argument call creates an instance bound to the first argument of the 
method, not an unbound instance. Determining the “self” argument is also 
magical: it does not seem to work with default arguments, variable positional 
arguments, nor keyword-only arguments. List comprehensions, generator 
expressions, etc seem to override it, and the argument is not seen by exec and 
eval.

--

___
Python tracker 

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



[issue29944] Argumentless super() fails in classes constructed with type()

2017-04-08 Thread Martin Panter

Martin Panter added the comment:

In Issue 23674, I posted a patch that changes to consistent parameter names 
(subclass, self). The exception message would avoid “type”, becoming

super(subclass, self): self must be an instance or subtype of subclass

--
nosy: +martin.panter

___
Python tracker 

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



[issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher

2017-04-08 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple

2017-04-08 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Should we have concerns about performances? Accessing a namedtuple value is 
almost 4x times slower compared to a plain tuple [1] and os.walk() may iterate 
hundreds of times.

http://stackoverflow.com/questions/2646157/what-is-the-fastest-to-access-struct-like-object-in-python

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-04-08 Thread Mike Gilbert

Mike Gilbert added the comment:

Thanks for the reply.

OpenSSL 1.1.0 added functions to control the SSL/TLS version used by SSL 
contexts created using TLS_method(). You might consider updating the code for 
existing Python branches to use these functions.

SSL_CTX_set_min_proto_version
SSL_CTX_set_max_proto_version

https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html

--

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I vote -1 too.

1. As was said, this doesn't work with all attribute names.
2. This adds circular dependency between operator and collections modules.
3. This increases memory consumption and startup time for small programs that 
don't use the collections module.
4. Performance. Creating a namedtuple is slower than creating a tuple, and many 
code is optimized for raw tuples.
5. This increases the complexity of attrgetter() implementation and can 
introduce new bugs.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30008] OpenSSL 1.1.0 deprecated functions

2017-04-08 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your report.

Python is going to require legacy functions like TLSv1_method() for a while. 
They are required to provide constants like PROTOCOL_TLSv1. I have deprecated 
these constants in 3.6 and they will be removed in 3.8. In the mean time Python 
is not compatible with OpenSSL api=1.1.0.

--

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Christian Heimes

Christian Heimes added the comment:

I'm with RDM and vote -1, too.

A namedtuple is a bit more costly than a normal tuple. That's especially try 
for dynamic attrgetter() that are defined ad-hoc, e.g. as key function for 
sorted(). The creation of type classes doesn't come for free.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread R. David Murray

R. David Murray added the comment:

This is a clever idea, but I vote -1 for this proposal.  I think it makes 
attrgetter more complex for little purpose.  The fact that only some attribute 
names work and the others get mangled makes the API very ugly and not, IMO, 
desirable.

Finally, if you want this, you can pretty easily write a function that wraps 
attrgetter to do it.  I don't think it has enough utility to justify being in 
the stdlib.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue30014] Speedup DefaultSelectors.modify() by 2x

2017-04-08 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

For the sake of experiment I'm attaching a toy echo server which uses modify() 
to switch between EVENT_READ and EVENT_WRITE. Without patch I get 35000 
req/sec, with patch around 39000 req/sec (11.4% faster).
To be entirely honest a smarter echo server would switch between EVENT_READ / 
EVENT_WRITE only in case of BlockingIOError on send() or recv(), but 
unfortunately it's a condition which (for send()) does not occur often by 
testing on localhost (for recv() it naturally occurs +27000 times out of 
39000). On the other hand, by experimenting with a real network it occurs quite 
soon:

import socket
sock = socket.socket()
sock.connect(('google.com', 80))
sock.setblocking(False)
print(sock.send(b'x' * 5))
print(sock.send(b'x' * 5))  # raise BlockingIOError

So basically my benchmark is emulating a worst case scenario in which send() 
always blocks on the first call and succeed on the next one, in order to mimic 
recv() which blocks half of the times.
The whole point is that the speedup entirely depends on how many times send() 
or recv() will block in a real world app connected to the internet (because 
that's when modify() is supposed to be used) but that's hard to determine, 
especially under heavy server loads which is hard to emulate. This also 
involves the SSL handshake when it fails with WANT_READ / WANT_WRITE, which is 
another circumstance where modify() is going to be used and for which I have no 
benchmarks.
I personally don't mind about selectors module per-se, but given that it's the 
core of important libs such as asyncio and curio I would like to hear a better 
rationale than "let's reject this 1.5x speedup because DRY does not apply in 
this case".
Also please consider that Tornado, Twisted and gevent use native modify() 
method.

--
Added file: http://bugs.python.org/file46792/echo_server.py

___
Python tracker 

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



[issue30014] Speedup DefaultSelectors.modify() by 2x

2017-04-08 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


Added file: http://bugs.python.org/file46793/echo_client.py

___
Python tracker 

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



[issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher

2017-04-08 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

bump to close issue now that PR was merged

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29963] Remove obsolete declaration PyTokenizer_RestoreEncoding in tokenizer.h

2017-04-08 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


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



[issue29944] Argumentless super() fails in classes constructed with type()

2017-04-08 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Isaac Morland

Isaac Morland added the comment:

What are the "other issues"?

As to the issue you raise here, that's why I use rename=True.

First create a type with an underscore attribute:

>>> t = namedtuple ('t', ['a', '1234'], rename=True)

(just an easy way of creating such a type; used of namedtuple specifically is 
admittedly a bit of a red herring)

Now create an object and illustrate its attributes:

>>> tt = t ('c', 'd')
>>> tt.a
'c'
>>> tt._1
'd'

Now use my modified attrgetter to get the attributes as a namedtuple:

>>> attrgetter ('a', '_1') (tt)
attrgetter(a='c', _1='d')
>>> 

And the example from the help, used in the test file I've already attached, 
illustrates that the dotted attribute case also works.

Essentially, my patch provides no benefit for attrgetter specified attributes 
that aren't valid namedtuple attribute names, but because of rename=True it 
still works and doesn't break anything.  So if you give "a" as an attribute 
name, the output will have an "a" attribute; if you give "_b" as an attribute 
name, the output will have an "_1" (or whatever number) attribute.  Similarly, 
it doesn't help with dotted attributes, but it doesn't hurt either.

--

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Aside from other issues, namedtuples can't have fields beginning with 
underscores, attrgetter can get attributes beginning with underscores (and 
dotted attributes for that matter). There isn't going to be an obvious or 
intuitive mapping to apply here.

--
nosy: +josh.r

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2017-04-08 Thread KINEBUCHI Tomohiko

KINEBUCHI Tomohiko added the comment:

Oh, I have overlooked these sentences.
I will create an additional pull request to remove duplication.

--

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-08 Thread Berker Peksag

Berker Peksag added the comment:

> row_factory seems to be another parameter that can be set in the Cursor 
> object.
> https://github.com/python/cpython/blob/master/Modules/_sqlite/cursor.c#L65 
> 
> This can addressed in a different issue/ pr.

Like I already said in msg290943, Cursor.row_factory is kept for backwards 
compatibility reasons and it shouldn't be documented.

--

___
Python tracker 

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



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2017-04-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Multi-inheritance is tricky to get right, both for the class being extended and 
the class extending it.  The APIs mentioned here were never designed for 
multiple inheritance and aren't supposed to support it.

Your use case would probably be better served by using composition rather than 
inheritance.  Speaking personally, I almost never subclass Thread, instead I 
make it an attribute of whatever class I'm writing.

--
nosy: +pitrou

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Isaac Morland

Isaac Morland added the comment:

I've attached a file which illustrates what I'm proposing to happen with the 
examples from the help.  Note that attrgetter (attr) is not affected, only 
attrgetter (*attrs) for more than one attribute.  The idea is that tuples 
resulting from attrgetter functions will retain the attribute names from the 
original object.  In some work I have done recently this would have been very 
handy with groupby.

I had some initial confusion because changing the Python attrgetter 
implementation didn't make any difference.  Once I realized I needed to turn 
off import of the C implementation, I figured the rest out fairly quickly.  
Here is the diff:

diff --git a/Lib/operator.py b/Lib/operator.py
index 0e2e53e..9b2a8fa 100644
--- a/Lib/operator.py
+++ b/Lib/operator.py
@@ -247,8 +247,12 @@ class attrgetter:
 else:
 self._attrs = (attr,) + attrs
 getters = tuple(map(attrgetter, self._attrs))
+
+from collections import namedtuple
+nt = namedtuple ('attrgetter', self._attrs, rename=True)
+
 def func(obj):
-return tuple(getter(obj) for getter in getters)
+return nt._make (getter(obj) for getter in getters)
 self._call = func
 
 def __call__(self, obj):
@@ -409,7 +413,7 @@ def ixor(a, b):
 
 
 try:
-from _operator import *
+pass
 except ImportError:
 pass
 else:

There are some issues that still need to be addressed.  The biggest is that 
I've turned off the C implementation.  I assume that we'll need a C 
implementation the new version.  In addition to this:

1) I just call the namedtuple type "attrgetter".  I'm thinking something 
obtained by mashing together the field names or something similar might be more 
appropriate.  However, I would prefer not to repeat the logic within namedtuple 
that deals with field names that aren't identifiers.  So I'm wondering if maybe 
I should also modify namedtuple to allow None as the type name, in which case 
it would use an appropriate default type name based on the field names.

2) I import from collections inside the function.  It didn't seem to work at 
the top-level, I'm guessing because I'm in the library and collections isn't 
ready when operator is initialized.  This may be fine I just point it out as 
something on which I could use advice.

I'm hoping this provides enough detail for people to understand what I'm 
proposing and evaluate whether this is a desireable enhancement.  If so, I'll 
dig into the C implementation next, although I may need assistance with that.

--
Added file: http://bugs.python.org/file46791/test_attrgetter.py

___
Python tracker 

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



[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue30006] Deadlocks in `concurrent.futures.ProcessPoolExecutor`

2017-04-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +bquinlan, davin, pitrou
stage:  -> patch review

___
Python tracker 

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



[issue30022] Get rid of using EnvironmentError and IOError

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1203

___
Python tracker 

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



[issue30022] Get rid of using EnvironmentError and IOError

2017-04-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

EnvironmentError and IOError now are aliases to OSError. But some code still 
use them. Proposed patch replaces all uses of EnvironmentError and IOError 
(except tests and scripts) with OSError. This will make the code cleaner and 
more uniform.

--
messages: 291332
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Get rid of using EnvironmentError and IOError
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PR 1049 and PR 1050 restore ABI compatibility in 3.5 and 2.7. Unfortunately 
this restores the original bug with using PySlice_GetIndicesEx in third-party 
code (but CPython core and standard extensions no longer use 
PySlice_GetIndicesEx).

Can we consider 3.6.0 rather than 3.6.1 as broken release?

--
components: +Interpreter Core
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1202

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1201

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

New changeset b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8 by Serhiy Storchaka in 
branch 'master':
Expand the PySlice_GetIndicesEx macro. (#1023)
https://github.com/python/cpython/commit/b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8

New changeset c26b19d5c7aba51b50a4d7fb5f8291036cb9da24 by Serhiy Storchaka in 
branch '3.6':
Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)
https://github.com/python/cpython/commit/c26b19d5c7aba51b50a4d7fb5f8291036cb9da24

New changeset fa25f16a4499178d7d79c18d2d68be7f70594106 by Serhiy Storchaka in 
branch '3.5':
Expand the PySlice_GetIndicesEx macro. (#1023) (#1045)
https://github.com/python/cpython/commit/fa25f16a4499178d7d79c18d2d68be7f70594106

--

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e41390aca51e4e3eb455cf3b70f5d656a2814db9 by Serhiy Storchaka in 
branch '2.7':
bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)
https://github.com/python/cpython/commit/e41390aca51e4e3eb455cf3b70f5d656a2814db9


--

___
Python tracker 

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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e63f8f293a96ceebf06de15b4e1c97dbbff0f6a8 by Serhiy Storchaka in 
branch '3.5':
bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) 
(#1043)
https://github.com/python/cpython/commit/e63f8f293a96ceebf06de15b4e1c97dbbff0f6a8


--

___
Python tracker 

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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset af685f9050416da8050e0ec11a8dff9afd4130e7 by Serhiy Storchaka in 
branch '3.6':
bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) 
(#1042)
https://github.com/python/cpython/commit/af685f9050416da8050e0ec11a8dff9afd4130e7


--

___
Python tracker 

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



[issue30021] Add examples for re.escape()

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1200

___
Python tracker 

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



[issue30021] Add examples for re.escape()

2017-04-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds examples of using re.escape().

See also issue29995.

--
assignee: docs@python
components: Documentation, Regular Expressions
messages: 291326
nosy: docs@python, ezio.melotti, mrabarnett, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add examples for re.escape()
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb

2017-04-08 Thread Peter

Peter added the comment:

OK, thanks. Given this is regarded as an enhancement rather than a bug fix, I 
understand the choice not to change this in Python 2.7.

--

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1198

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1197

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1199

___
Python tracker 

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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1196

___
Python tracker 

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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1195

___
Python tracker 

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



[issue29914] Incorrect signatures of object.__reduce__() and object.__reduce_ex__()

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29998] Pickling and copying ImportError doesn't preserve name and path

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset b785396ab451b0c9d6ae9ee5a9e56c810209a6cb by Serhiy Storchaka in 
branch 'master':
bpo-29998: Pickling and copying ImportError now preserves name and path (#1010)
https://github.com/python/cpython/commit/b785396ab451b0c9d6ae9ee5a9e56c810209a6cb


--

___
Python tracker 

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



[issue29914] Incorrect signatures of object.__reduce__() and object.__reduce_ex__()

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9 by Serhiy Storchaka in 
branch 'master':
bpo-29914: Fix default implementations of __reduce__ and __reduce_ex__(). (#843)
https://github.com/python/cpython/commit/205e00c5cfd495a4dc6dae8e8fa0fb828fb3dca9


--

___
Python tracker 

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



[issue29956] math.exp documentation is misleading

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Not always. For example for x = 0 both methods give the same exact result.

--

___
Python tracker 

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



[issue23894] lib2to3 doesn't recognize rb'...' and f'...' in Python 3.6

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Should this issue be closed now?

--

___
Python tracker 

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



[issue30020] Make attrgetter use namedtuple

2017-04-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Before writing a patch that may be rejected, can you explain in detail what 
change you propose? Example(s) will be good.

For example:

py> from operator import attrgetter
py> f = attrgetter('keys')
py> f({})


I don't see a tuple here, so what (if anything) are you planning to change?


How about the example from help(attrgetter)?

 |  After h = attrgetter('name.first', 'name.last'), the call h(r) returns
 |  (r.name.first, r.name.last).

--
nosy: +steven.daprano

___
Python tracker 

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



[issue30017] zlib.error: Error -2 while flushing: inconsistent stream state

2017-04-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1194

___
Python tracker 

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



[issue30017] zlib.error: Error -2 while flushing: inconsistent stream state

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree, that close() should be an idempotent operation. Proposed patch fixes 
this.

--
assignee:  -> serhiy.storchaka
components: +Library (Lib)
stage: needs patch -> patch review
versions: +Python 3.7

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2017-04-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 7f85947106aff5b1f166a57f644f987db4d38bf0 by Serhiy Storchaka 
(cocoatomo) in branch '2.7':
[2.7] bpo-19225: Lack of c api exceptions doc (#964)
https://github.com/python/cpython/commit/7f85947106aff5b1f166a57f644f987db4d38bf0


--

___
Python tracker 

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