[issue33823] A BUG in concurrent/asyncio

2018-06-11 Thread Python++


Python++  added the comment:

First Kind of resutl sets:

=

Process-2:<4816> is ProcessExecuting [0]
MainThread:<4816> is ThreadExecuting [0]
exe_iter:0 sub_iter:0
Run for Wheel and result:0
callback number:1
MainThread:<4816> is ThreadExecuting [1]
exe_iter:0 sub_iter:1
Run for Wheel and result:2
callback number:2
Process-1:<4512> is ProcessExecuting [1]
MainThread:<4512> is ThreadExecuting [0]
exe_iter:1 sub_iter:0
Run for Wheel and result:0
callback number:1
MainThread:<4512> is ThreadExecuting [1]
exe_iter:1 sub_iter:1
Run for Wheel and result:2
callback number:2
==
Program runs with different Threads:
Tread ID: 4816 and 4512
callback numbers are 1, 2; 1, 2


Second Kind of resutl sets:

==
Process-1:<7360> is ProcessExecuting [0]
MainThread:<7360> is ThreadExecuting [0]
exe_iter:0 sub_iter:0
Run for Wheel and result:0
callback number:1
MainThread:<7360> is ThreadExecuting [1]
exe_iter:0 sub_iter:1
Run for Wheel and result:2
callback number:2
Process-1:<7360> is ProcessExecuting [1]
MainThread:<7360> is ThreadExecuting [0]
exe_iter:1 sub_iter:0
Run for Wheel and result:0
callback number:3
MainThread:<7360> is ThreadExecuting [1]
exe_iter:1 sub_iter:1
Run for Wheel and result:2
callback number:4
=

Program runs with the same and only Thread:
Tread ID: 7360
callback numbers are 1, 2; 3, 4

Based on the above situation, it is impossible to ensure that multiple
processes will run the program all the way by employing Process Pool.

2018-06-11 2:18 GMT+08:00 Yury Selivanov :

>
> Yury Selivanov  added the comment:
>
> > which results in the resulting statistics of the last code run cannot be
> promised to be separated.
>
> I'm sorry but I cannot parse your message and the attached code snippet.
> Please try to formulate the actual bug/feature request more clearly.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33823] A BUG in concurrent/asyncio

2018-06-11 Thread Python++


Python++  added the comment:

First Kind of resutl sets:

=

Process-2:<4816> is ProcessExecuting [0]
MainThread:<4816> is ThreadExecuting [0]
exe_iter:0 sub_iter:0
Run for Wheel and result:0
callback number:1
MainThread:<4816> is ThreadExecuting [1]
exe_iter:0 sub_iter:1
Run for Wheel and result:2
callback number:2
Process-1:<4512> is ProcessExecuting [1]
MainThread:<4512> is ThreadExecuting [0]
exe_iter:1 sub_iter:0
Run for Wheel and result:0
callback number:1
MainThread:<4512> is ThreadExecuting [1]
exe_iter:1 sub_iter:1
Run for Wheel and result:2
callback number:2
==
Program runs with different Threads:
Tread ID: 4816 and 4512
callback numbers are 1, 2; 1, 2


Second Kind of resutl sets:

==
Process-1:<7360> is ProcessExecuting [0]
MainThread:<7360> is ThreadExecuting [0]
exe_iter:0 sub_iter:0
Run for Wheel and result:0
callback number:1
MainThread:<7360> is ThreadExecuting [1]
exe_iter:0 sub_iter:1
Run for Wheel and result:2
callback number:2
Process-1:<7360> is ProcessExecuting [1]
MainThread:<7360> is ThreadExecuting [0]
exe_iter:1 sub_iter:0
Run for Wheel and result:0
callback number:3
MainThread:<7360> is ThreadExecuting [1]
exe_iter:1 sub_iter:1
Run for Wheel and result:2
callback number:4
=

Program runs with the same and only Thread:
Tread ID: 7360
callback numbers are 1, 2; 3, 4

Based on the above situation, it is impossible to ensure that multiple
processes will run the program all the way by employing Process Pool.

2018-06-11 15:09 GMT+08:00 Python++ :

>
> Python++  added the comment:
>
> First Kind of resutl sets:
>
> =
>
> Process-2:<4816> is ProcessExecuting [0]
> MainThread:<4816> is ThreadExecuting [0]
> exe_iter:0 sub_iter:0
> Run for Wheel and result:0
> callback number:1
> MainThread:<4816> is ThreadExecuting [1]
> exe_iter:0 sub_iter:1
> Run for Wheel and result:2
> callback number:2
> Process-1:<4512> is ProcessExecuting [1]
> MainThread:<4512> is ThreadExecuting [0]
> exe_iter:1 sub_iter:0
> Run for Wheel and result:0
> callback number:1
> MainThread:<4512> is ThreadExecuting [1]
> exe_iter:1 sub_iter:1
> Run for Wheel and result:2
> callback number:2
> ==
> Program runs with different Threads:
> Tread ID: 4816 and 4512
> callback numbers are 1, 2; 1, 2
> 
>
> Second Kind of resutl sets:
>
> ==
> Process-1:<7360> is ProcessExecuting [0]
> MainThread:<7360> is ThreadExecuting [0]
> exe_iter:0 sub_iter:0
> Run for Wheel and result:0
> callback number:1
> MainThread:<7360> is ThreadExecuting [1]
> exe_iter:0 sub_iter:1
> Run for Wheel and result:2
> callback number:2
> Process-1:<7360> is ProcessExecuting [1]
> MainThread:<7360> is ThreadExecuting [0]
> exe_iter:1 sub_iter:0
> Run for Wheel and result:0
> callback number:3
> MainThread:<7360> is ThreadExecuting [1]
> exe_iter:1 sub_iter:1
> Run for Wheel and result:2
> callback number:4
> =
>
> Program runs with the same and only Thread:
> Tread ID: 7360
> callback numbers are 1, 2; 3, 4
>
> Based on the above situation, it is impossible to ensure that multiple
> processes will run the program all the way by employing Process Pool.
>
> 2018-06-11 2:18 GMT+08:00 Yury Selivanov :
>
> >
> > Yury Selivanov  added the comment:
> >
> > > which results in the resulting statistics of the last code run cannot
> be
> > promised to be separated.
> >
> > I'm sorry but I cannot parse your message and the attached code snippet.
> > Please try to formulate the actual bug/feature request more clearly.
> >
> > --
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33827] Generators with lru_cache can be non-intuituve

2018-06-11 Thread Michel Albert


New submission from Michel Albert :

Consider the following code:

# filename: foo.py

from functools import lru_cache


@lru_cache(10)
def bar():
yield 10
yield 20
yield 30


# This loop will work as expected
for row in bar():
print(row)

# This loop will not loop over anything.
# The cache will return an already consumed generator.
for row in bar():
print(row)


This behaviour is natural, but it is almost invisible to the caller of "foo".

The main issue is one of "surprise". When inspecting the output of "foo" it is 
clear that the output is a generator:

>>> import foo
>>> foo.bar()


**Very** careful inspection will reveal that each call will return the same 
generator instance.

So to an observant user the following is an expected behaviour:

>>> result = foo.bar()
>>> for row in result:
...print(row)
...
10
20
30
>>> for row in result:
... print(row)
...
>>>

However, the following is not:

>>> import foo
>>> result = foo.bar()
>>> for row in result:
... print(row)
...
10
20
30
>>> result = foo.bar()
>>> for row in result:
... print(row)
...
>>>


Would it make sense to emit a warning (or even raise an exception) in 
`lru_cache` if the return value of the cached function is a generator?

I can think of situation where it makes sense to combine the two. For example 
the situation I am currently in:

I have a piece of code which loops several times over the same SNMP table. 
Having a generator makes the application far more responsive. And having the 
cache makes it even faster on subsequent calls. But the gain I get from the 
cache is bigger than the gain from the generator. So I would be okay with 
converting the result to a list before storing it in the cache.

What is your opinion on this issue? Would it make sense to add a warning?

--
messages: 319279
nosy: exhuma
priority: normal
severity: normal
status: open
title: Generators with lru_cache can be non-intuituve
type: behavior

___
Python tracker 

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



[issue24356] venv documentation incorrect / misleading

2018-06-11 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue32469] Generator and coroutine repr could be more helpful

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Isn't it too verbose? For comparison, the repr of function doesn't contain the 
file path and the line number. And the hexadecimal address in the middle looks 
distractive.

--
components: +Interpreter Core
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +7239
stage: backport needed -> patch review

___
Python tracker 

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



[issue33827] Generators with lru_cache can be non-intuituve

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No, this will break cases when you need to cache generators.

There are many ways of using lru_cache improperly, and we can't distinguish 
incorrect uses from intentional correct uses.

--
assignee:  -> rhettinger
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 9d6171ded5c56679bc295bacffc718472bcb706b by Ned Deily in branch 
'master':
bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7620)
https://github.com/python/cpython/commit/9d6171ded5c56679bc295bacffc718472bcb706b


--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7240

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 144493dd7f2640f7e9091862ece3e0a6aca07884 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7620) (GH-7621)
https://github.com/python/cpython/commit/144493dd7f2640f7e9091862ece3e0a6aca07884


--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +7241

___
Python tracker 

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



[issue33828] Add versionchanged notes for string.Formatter

2018-06-11 Thread Xiang Zhang


New submission from Xiang Zhang :

I propose to add versionchanged note about auto-numbering feature of 
string.Formatter, introduced in #13598. It's quite confusing which version 
could I use the feature reading the doc. Also it's better to note in 2.7 the 
feature is not available.

Currently the doc gives me the feeling string.Formatter and str.format share 
the same feature and the auto-numbering feature is available in 2.7 and >3.1.

--
assignee: docs@python
components: Documentation
messages: 319284
nosy: docs@python, eric.smith, xiang.zhang
priority: normal
severity: normal
stage: needs patch
status: open
title: Add versionchanged notes for string.Formatter
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 1b5731e2761a9a1b7394b3a81ed267f94fde42ca by Ned Deily in branch 
'3.6':
bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7622)
https://github.com/python/cpython/commit/1b5731e2761a9a1b7394b3a81ed267f94fde42ca


--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +7242

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +7243

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 4fde701133643d09354ec4bda6bdf78d85aed797 by Ned Deily in branch 
'2.7':
bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7624)
https://github.com/python/cpython/commit/4fde701133643d09354ec4bda6bdf78d85aed797


--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:

I've updated and synced the What's New files across master, 3.7, 3.6, 3.5 (PR 
pending RM merge), and 2.7.  So I think we are finally done here.

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

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2018-06-11 Thread Bartosz Gołaszewski

New submission from Bartosz Gołaszewski :

If we want to call an object's method from C code and pass it the args and 
kwargs tuples unchanged, we need to first retrieve the callable object using 
PyObject_GetAttrString(), then call it using PyObject_Call().

I would like to propose wrapping the two calls in a new helper.

--
components: Extension Modules
messages: 319288
nosy: Bartosz Gołaszewski
priority: normal
severity: normal
status: open
title: C API: provide new object protocol helper
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2018-06-11 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +7244
stage:  -> patch review

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Is this case common enough for adding special API? The name 
PyObject_CallMethodArgs looks too similar to the existing name 
PyObject_CallMethodObjArgs, this will make confusion. If add an API that 
accepts the method name as C string, you need to add also an API for method 
name passed as Python string and a private API for method name passed as 
`struct _Py_Identifier *`. Adding new API has a non-zero cost. It adds 
maintenance burden for core developers, it increases the number of things that 
should be learned by users, and can leads to generating less optimal code by 
the compiler, because it will need to analyze more code in the same file, and 
it can optimize less common paths and left more common paths unoptimized.

Are you aware that you can pass the args tuple unchanged by using 
PyObject_CallMethod()? PyObject_CallMethod(obj, name, "O", args)

--
nosy: +serhiy.storchaka, vstinner

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2018-06-11 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +7245
stage: needs patch -> patch review

___
Python tracker 

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



[issue33830] example output error

2018-06-11 Thread Aifu LIU


New submission from Aifu LIU :

The output of this line:
print r2.status, r2.reason
should same as:
print r1.status, r1.reason

from https://docs.python.org/2.7/library/httplib.html

>>> import httplib
>>> conn = httplib.HTTPSConnection("www.python.org")
>>> conn.request("GET", "/")
>>> r1 = conn.getresponse()
>>> print r1.status, r1.reason
200 OK
>>> data1 = r1.read()
>>> conn.request("GET", "/")
>>> r2 = conn.getresponse()
>>> print r2.status, r2.reason
404 Not Found
>>> data2 = r2.read()
>>> conn.close()

--
assignee: docs@python
components: Documentation
messages: 319290
nosy: Aifu LIU, docs@python
priority: normal
severity: normal
status: open
title: example output error
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



[issue1529353] Squeezer - squeeze large output in the interpreter

2018-06-11 Thread Tal Einat


Tal Einat  added the comment:

New PR ready for review.

I've updated the code for recent master and cleaned up the deprecation warnings 
from the tests.

--
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8 -Python 3.4

___
Python tracker 

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



[issue2053] IDLE - standardize dialogs

2018-06-11 Thread Tal Einat


Tal Einat  added the comment:

I suggest that we close this issue. IMO the potential benefit is too small 
relative to the work required, and the interest is too low.

--

___
Python tracker 

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



[issue33738] PyIndex_Check conflicts with PEP 384

2018-06-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7246

___
Python tracker 

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



[issue33830] example output error

2018-06-11 Thread Martin Panter


Martin Panter  added the comment:

Looks like poor application of a Python 3 patch in Issue 24118. The second 
request was meant to be for /parrot.spam.

--
nosy: +benjamin.peterson, martin.panter

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-06-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Would it be easier to split it into 3 issues? One for unixdll, one for 
> netstat, and one for test_uuid?

One issue for AIX should be enough.

--

___
Python tracker 

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



[issue33825] Change mentions of "magic" attributes to "special"

2018-06-11 Thread Andrés Delfino

Andrés Delfino  added the comment:

ok :)

--
resolution:  -> not a bug
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



[issue33738] PyIndex_Check conflicts with PEP 384

2018-06-11 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 Windows8.1 Non-Debug 3.x buildbot is back to green.

--

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2018-06-11 Thread STINNER Victor


STINNER Victor  added the comment:

> PyObject_CallMethodArgs(PyObject *obj, const char *name, PyObject *args, 
> PyObject *kwargs)

This API is not efficient. It requires to create a temporary tuple and 
dictionary to pass position and keyword arguments. Look at FASTCALL which has a 
very different API. Sadly, FASTCALL APIs are currently private.

--

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread Andrés Delfino

New submission from Andrés Delfino :

The start command understands the first quoted string as the window title, so 
nothing is being executed right now.

PR fixes this.

--
components: Windows
messages: 319298
nosy: adelfino, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Make htmlview work in make.bat
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread Andrés Delfino

Change by Andrés Delfino :


--
keywords: +patch
pull_requests: +7247
stage:  -> patch review

___
Python tracker 

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



[issue1927] Change input() to always prompt to stderr

2018-06-11 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue32356] asyncio: Make transport.pause_reading()/resume_reading() idempotent; add transport.is_reading()

2018-06-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7248

___
Python tracker 

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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2018-06-11 Thread STINNER Victor


STINNER Victor  added the comment:

"Since it a minor change we can reconsider it as s bug fix. Feel free
to make a pr."

Ok, I created https://github.com/python/cpython/pull/7629/ for bpo-32356

--

___
Python tracker 

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



[issue33832] Make "magic methods" a little more discoverable in the docs

2018-06-11 Thread Andrés Delfino

New submission from Andrés Delfino :

PR adds "magic method" to the glossary, and adds a mention in Data Model 3.3. 
Special method names.

--
assignee: docs@python
components: Documentation
messages: 319300
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: Make "magic methods" a little more discoverable in the docs
type: enhancement
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33832] Make "magic methods" a little more discoverable in the docs

2018-06-11 Thread Andrés Delfino

Change by Andrés Delfino :


--
keywords: +patch
pull_requests: +7249
stage:  -> patch review

___
Python tracker 

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



[issue33738] PyIndex_Check conflicts with PEP 384

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5cbefa99198729a1d4e93d93f890c066039ee1d2 by Serhiy Storchaka in 
branch 'master':
Clean up after bpo-33738. (GH-7627)
https://github.com/python/cpython/commit/5cbefa99198729a1d4e93d93f890c066039ee1d2


--

___
Python tracker 

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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +7250
stage:  -> patch review

___
Python tracker 

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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.7, Python 3.8 -Python 3.5

___
Python tracker 

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



[issue17286] Make subprocess handling text output with universal_newlines more obious

2018-06-11 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> subprocess.run should alias universal_newlines to text

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-06-11 Thread twisteroid ambassador


New submission from twisteroid ambassador :

Sometimes when a socket transport under ProactorEventLoop is writing while the 
peer closes the connection, asyncio logs an AssertionError. 

Attached is a script that fairly reliably reproduces the behavior on my 
computer.

This is caused by _ProactorBasePipeTransport._force_close() being called 
between two invocations of _ProactorBaseWritePipeTransport._loop_writing(), 
where the latter call asserts self._write_fut has not changed after being set 
by the former call.

--
components: asyncio
files: test_proactor_force_close.py
messages: 319302
nosy: asvetlov, twisteroid ambassador, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop raises AssertionError
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47639/test_proactor_force_close.py

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-06-11 Thread twisteroid ambassador


Change by twisteroid ambassador :


--
type:  -> behavior

___
Python tracker 

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



[issue33833] ProactorEventLoop raises AssertionError

2018-06-11 Thread twisteroid ambassador


Change by twisteroid ambassador :


--
keywords: +patch
pull_requests: +7251
stage:  -> patch review

___
Python tracker 

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



[issue33834] Test for ProactorEventLoop logs InvalidStateError

2018-06-11 Thread twisteroid ambassador


New submission from twisteroid ambassador :

When running the built-in regression tests, although 
test_sendfile_close_peer_in_the_middle_of_receiving on ProactorEventLoop 
completes successfully, an InvalidStateError is logged.

Console output below:

test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_events.ProactorEventLoopTests) ... Exception in 
callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ne, 64, 
None)>)
handle: )>
Traceback (most recent call last):
  File "\cpython\lib\asyncio\windows_events.py", line 428, in finish_recv
return ov.getresult()
OSError: [WinError 64] The specified network name is no longer available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\cpython\lib\asyncio\proactor_events.py", line 255, in 
_loop_reading
data = fut.result()
  File "\cpython\lib\asyncio\windows_events.py", line 732, in _poll
value = callback(transferred, key, ov)
  File "\cpython\lib\asyncio\windows_events.py", line 432, in finish_recv
raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer 
available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\cpython\lib\asyncio\events.py", line 88, in _run
self._context.run(self._callback, *self._args)
  File "\cpython\lib\asyncio\proactor_events.py", line 282, in 
_loop_reading
self._force_close(exc)
  File "\cpython\lib\asyncio\proactor_events.py", line 117, in 
_force_close
self._empty_waiter.set_exception(exc)
concurrent.futures._base.InvalidStateError: invalid state
ok

--
components: asyncio
messages: 319303
nosy: asvetlov, twisteroid ambassador, yselivanov
priority: normal
severity: normal
status: open
title: Test for ProactorEventLoop logs InvalidStateError
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue24403] Missing fixer for changed round() behavior

2018-06-11 Thread Tal Einat


Change by Tal Einat :


--
nosy:  -taleinat

___
Python tracker 

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



[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2018-06-11 Thread Tal Einat


Tal Einat  added the comment:

Since this is a small enhancement proposal that is not sure to be approved, and 
there has been no followup for years, I vote to close this.

--

___
Python tracker 

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



[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2018-06-11 Thread floyd


floyd  added the comment:

Yes, I agree this should be closed. Especially because my proposed code is so 
incredibly bad (e.g. regarding performance) that it should be rejected. Back 
then I was horribly wrong and didn't understand the problem well enough yet.

If somebody would like to have such a function, this is all it needs:

def quick_ratio_ge(self, a, b, threshold):
return threshold <= 2.0*(len(a))/(len(a)+len(b))

Here is how I actually use it in code: 
https://github.com/modzero/burp-ResponseClusterer/blob/master/ResponseClusterer.py#L343

Sorry for the fuzz

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



[issue33833] ProactorEventLoop raises AssertionError

2018-06-11 Thread Yury Selivanov


Yury Selivanov  added the comment:

Adding Victor as he's been helping with asyncio/proactor lately.

--
nosy: +vstinner

___
Python tracker 

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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread R. David Murray


R. David Murray  added the comment:


New changeset 2c071cebe67f517f191f4074757a79b0f597d886 by R. David Murray 
(Zackery Spytz) in branch 'master':
bpo-30820: Remove incorrect docs for email.contentmanager.raw_data_manager 
(#7631)
https://github.com/python/cpython/commit/2c071cebe67f517f191f4074757a79b0f597d886


--

___
Python tracker 

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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7253

___
Python tracker 

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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7252

___
Python tracker 

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



[issue33835] Too strong side effect?

2018-06-11 Thread X. Yan


New submission from X. Yan :

I am familiar with quite a few languages such as C++, C, PASCAL, Matlab, etc., 
but starting to practice Python. When I tested the code:

def f(a, L=[]):
L.append(a)
return L

followed by calls as follows,

v1 = f(1)
v2 = f(2)

, to my surprise, I saw the v1's content was changed from initial [1] to [1, 
2], when the second call, v2=f(2), was executed. This means when you produce 
the new value for v2, you have to be very very careful for all the results 
produced by this function previously, such as what in the v1. They can be 
changed in the background! I wonder if this side-effect was designed on 
purpose, or is actually a BUG, because it is too dangerous.

--
messages: 319308
nosy: xgyan
priority: normal
severity: normal
status: open
title: Too strong side effect?
type: behavior
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



[issue33835] Too strong side effect?

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See 
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
 .

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue33837] Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening

2018-06-11 Thread Yury Selivanov


Yury Selivanov  added the comment:

Andrew, do you have time to take a look into this?

--

___
Python tracker 

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



[issue33836] [Good first-time issue] Recommend keyword-only param for memoization in FAQ

2018-06-11 Thread Zachary Ware


New submission from Zachary Ware :

In 
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
 there is an example showing memoization using `def expensive(arg1, arg2, 
_cache={}):`.  We should change the signature in that example to make `_cache` 
a keyword-only parameter and possibly adjust the comment to note that that's 
been done to prevent accidental calls with three positional arguments.



Note to existing contributors: if this wouldn't be within your first couple of 
patches, please leave this for a new contributor to find.  Thanks!

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 319310
nosy: docs@python, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: [Good first-time issue] Recommend keyword-only param for memoization in 
FAQ
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33837] Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening

2018-06-11 Thread Martin Liska


New submission from Martin Liska :

When calling asyncio.Server.close, the method calls 
asyncio.AbstractEventLoop._stop_serving for each of its sockets in turn.

The implementation of this method in asyncio.ProactorEventLoop calls the 
_stop_accept_futures method which seems to cancel "accept" futures of all 
sockets running on the loop, not just the one that was supposed to be stopped. 
This means that closing one server closes sockets of all existing servers.

With asyncio.SelectorEventLoop there is no such issue.

--
components: asyncio
messages: 319311
nosy: asvetlov, mliska, yselivanov
priority: normal
severity: normal
status: open
title: Closing asyncio.Server on asyncio.ProactorEventLoop causes all active 
servers to stop listening
type: behavior
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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread R. David Murray


R. David Murray  added the comment:


New changeset b06fc2d244f95f8a497cbcdc6e2fbeb9b8133ca3 by R. David Murray (Miss 
Islington (bot)) in branch '3.7':
bpo-30820: Remove incorrect docs for email.contentmanager.raw_data_manager 
(GH-7631) (#7633)
https://github.com/python/cpython/commit/b06fc2d244f95f8a497cbcdc6e2fbeb9b8133ca3


--

___
Python tracker 

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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread R. David Murray


R. David Murray  added the comment:


New changeset bbbc3d99dca41bc95a9402d702f6ab833d3003c7 by R. David Murray (Miss 
Islington (bot)) in branch '3.6':
bpo-30820: Remove incorrect docs for email.contentmanager.raw_data_manager 
(GH-7631) (#7634)
https://github.com/python/cpython/commit/bbbc3d99dca41bc95a9402d702f6ab833d3003c7


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Tal, welcome back to Python and IDLE development.  3.5 only gets security 
fixes. 

Please post here a draft doc paragraph.  Before reading the code in detail, I 
will pull it into my repository and try to test it as a 'naive user' who has 
only read that paragraph.

'Large text' has two meanings: long lines and lots of lines.  The former bog 
down and eventually freeze tkinter Texts.  (tk 8.7.0, now in alpha, will 
feature a re-written Text widget that should solve this.)  Lots of (short) 
lines, at least up to a million, is not a problem for Text, but is for users 
scrolling back.  Which problem does squeezer attack?  Both?

As the comment at the top of tooltips.py says, it is currently unused. It is 
also untested.   Calltips uses a version of the code. Hence, I was planning to 
sometime delete tooptips.py.  If it to be kept, I would like to see if it can 
be revised (at least TooltipBase) so it can be used both by calltips_w.py and 
any new code, such as squeezer.  It needs docstrings and a complete test.  This 
would be a separate issue that is a dependency of this one.  Since the file is 
so short, TooltipBase might eventually be put in another file with something 
else.

--
assignee: kbk -> terry.reedy
nosy:  -ajaksu2, gpolo, kbk, roger.serwy
priority: low -> normal
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



[issue30820] email.contentmanager.raw_data_manager fails to create multipart messages

2018-06-11 Thread R. David Murray


R. David Murray  added the comment:

Thanks, Zachery.

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Last fall, we converted built-in 'extensions' to regular features.  I am 
reluctant to add new 'extensions'.  But I can review the patch as an extension 
before we worry about this.

--

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread Steve Dower

Steve Dower  added the comment:


New changeset 0e5f901508dea6437dc9ee89b434feca721d45be by Steve Dower (Andrés 
Delfino) in branch 'master':
bpo-33831: Make htmlview run again (GH-7628)
https://github.com/python/cpython/commit/0e5f901508dea6437dc9ee89b434feca721d45be


--

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7254

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7255

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +7256

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2018-06-11 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the warm welcome, Terry :)

> 3.5 only gets security fixes.

Yup, my mistake.

> 'Large text' has two meanings: long lines and lots of lines. [...]

Squeezer handles both long lines and/or large numbers of lines.

> As the comment at the top of tooltips.py says, it is currently unused. [...]

I'd noticed, but it's still there and it works.  I'll be happy to refactor it 
and add tests.

> Last fall, we converted built-in 'extensions' to regular features.  I am 
> reluctant to add new 'extensions'.  But I can review the patch as an 
> extension before we worry about this.

I'd noticed this too, but decided to postpone refactoring this more until I got 
some updated feedback.  If you'd prefer this be added in non-extension form, I 
can do that.

> Please post here a draft doc paragraph.

Here's a revised version of the module's doc-string:


A common problem in IDLE's interactive shell is printing large
amounts of text into the shell.  This can cause IDLE to become
very slow, even to the point of being completely unusable.  It
can also make using the scrollbar awkward.

Squeezer automatically replaces long texts with a small button,
which can be used to access the original long text in several
ways, such as copying it to the clipboard.

Additionally, any output can be manually "squeezed" by the
user.  This includes output written to the standard error
stream ("stderr"), such as exception tracebacks.

--

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset 904cdbaa9b660d111f5d5f639b38205192715106 by Miss Islington (bot) 
in branch '3.7':
bpo-33831: Make htmlview run again (GH-7628)
https://github.com/python/cpython/commit/904cdbaa9b660d111f5d5f639b38205192715106


--
nosy: +miss-islington

___
Python tracker 

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



[issue33831] Make htmlview work in make.bat

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset 860d8c4a5e0d7cd96dd23f3f7996c97693ae3d55 by Miss Islington (bot) 
in branch '3.6':
bpo-33831: Make htmlview run again (GH-7628)
https://github.com/python/cpython/commit/860d8c4a5e0d7cd96dd23f3f7996c97693ae3d55


--

___
Python tracker 

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



[issue33835] Too strong side effect?

2018-06-11 Thread X. Yan


X. Yan  added the comment:

Hi Serhiy,

Thanks for your reply. However, the issue I reported was not about sharing the 
default value. I understand that the parameter L would keep its value [1] from 
function f's first run, and used it in the second run to get [1, 2].

My point is that the variable v1 only got involved in f's first run. It should 
keep the result [1] since then. The second calling v2=f(2) is irrelevant to v1, 
therefore, v1's content shouldn't be changed. v1 should be independent from f's 
later activities. Please let me know if this makes sense.

--
status: closed -> open

___
Python tracker 

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



[issue33838] Very slow upload with http.client on Windows when setting timeout

2018-06-11 Thread Ivan Konovalov


New submission from Ivan Konovalov :

Normally, when I upload files using the PUT request I get upload speed of about 
100 Mb/s.
But as soon as I set the timeout, the speed drops to about 4 Mb/s (can vary 
depending on the server):

# Running on Windows 10, using Python 3.6.5

from io import BytesIO
import http.client

def upload(timeout=None):
test_file = BytesIO(b"0" * 15 * 1024**2)

if timeout is not None:
conn = http.client.HTTPConnection("httpbin.org", timeout=timeout)
else:
conn = http.client.HTTPConnection("httpbin.org")

conn.request("PUT", "/put", body=test_file)

conn.getresponse().read()

upload(25) # Painfully slow
upload() # Pretty fast

This problem seems to only affect Windows.

--
components: IO, Library (Lib), Windows
messages: 319323
nosy: ivknv, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Very slow upload with http.client on Windows when setting timeout
type: performance
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



[issue33835] Too strong side effect?

2018-06-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See 
https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x
 .

--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +7257

___
Python tracker 

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



[issue33835] Too strong side effect?

2018-06-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Both names "v1" and "v2" refer to the same object. Python does not make copies 
of objects on assignment, so if you write:

a = []
b = a

then a and b both refer to the same list object, and the names "a" and "b" are 
effectively aliases. This is standard object-sharing behaviour used by many 
languages, including Lisp, Ruby, Javascript and Java.

If you are familiar with languages like Pascal and C++ you are probably 
thinking that variables are boxes at fixed memory locations, and assignment 
copies values into that box. That is not a good model for Python (and others).

This is not a bug. If you are unfamiliar with this object model, it can seem a 
bit strange at first, but for people who are used to Python, the C and Pascal 
model seems strange too.

Some people call this distinction Values Types (like Pascal and C) versus 
Reference Types (like Python, Ruby, Javascript)

https://softwareengineering.stackexchange.com/questions/314808/why-variables-in-python-are-different-from-other-programming-languages

--
nosy: +steven.daprano

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 800415e3df69f494afe9f95a8563ce17609fe1da by Terry Jan Reedy in 
branch 'master':
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
https://github.com/python/cpython/commit/800415e3df69f494afe9f95a8563ce17609fe1da


--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 8a05f559ce5064df68c8d4ebd7d4ed28381d9971 by Terry Jan Reedy in 
branch 'master':
bpo-33656: Add entry to What's New 3.7. (GH-7638)
https://github.com/python/cpython/commit/8a05f559ce5064df68c8d4ebd7d4ed28381d9971


--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7258

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7259

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7260

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset 144a8670f24a157642c5f7fbaf518e87c7c1b969 by Miss Islington (bot) 
in branch '3.7':
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
https://github.com/python/cpython/commit/144a8670f24a157642c5f7fbaf518e87c7c1b969


--
nosy: +miss-islington

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset 0404d35f9dc89748949935a9178d28bedde9d8c8 by Miss Islington (bot) 
in branch '3.6':
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
https://github.com/python/cpython/commit/0404d35f9dc89748949935a9178d28bedde9d8c8


--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thanks everyone for the help.  I think this is the right patch, but as with 
many IDLE patches, it is hard to be sure until it is in use.  At least there is 
no question here of tk Windows-Linux-MacOS differences.  I checked that the Win 
7 buildbots are OK with the PR.

Serhiy: My interpretation of the tk scaling doc is that 1, not 2, is the right 
argument.  But we can test to be sure.  I meant 'spare monitor', not 'space 
monitor'.  But I need to find one with a substantially different DPI.

Steve: changing the binaries' manifests is a separate issue, not limited to 
IDLE or even tkinter.  And 3.8 enhancements do nothing for IDLE on 3.6 and 3.7. 
 Ditto for a new WinAPI.

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Reopening, temporarily, to add change requested by Eryk Sun after the merge.

--
status: closed -> open

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +7261
stage: resolved -> patch review

___
Python tracker 

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



[issue33835] Too strong side effect?

2018-06-11 Thread R. David Murray


Change by R. David Murray :


--
status: open -> closed

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset fd88f319a4f40682b989b63f0b6378d69465fda4 by Terry Jan Reedy in 
branch 'master':
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
https://github.com/python/cpython/commit/fd88f319a4f40682b989b63f0b6378d69465fda4


--

___
Python tracker 

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



[issue33835] Too strong side effect?

2018-06-11 Thread X. Yan


X. Yan  added the comment:

I see.

Thanks for the detailed explanations.

Best,

Xiaogang

On 6/11/2018 2:00 PM, Steven D'Aprano wrote:
> Steven D'Aprano  added the comment:
>
> Both names "v1" and "v2" refer to the same object. Python does not make 
> copies of objects on assignment, so if you write:
>
> a = []
> b = a
>
> then a and b both refer to the same list object, and the names "a" and "b" 
> are effectively aliases. This is standard object-sharing behaviour used by 
> many languages, including Lisp, Ruby, Javascript and Java.
>
> If you are familiar with languages like Pascal and C++ you are probably 
> thinking that variables are boxes at fixed memory locations, and assignment 
> copies values into that box. That is not a good model for Python (and others).
>
> This is not a bug. If you are unfamiliar with this object model, it can seem 
> a bit strange at first, but for people who are used to Python, the C and 
> Pascal model seems strange too.
>
> Some people call this distinction Values Types (like Pascal and C) versus 
> Reference Types (like Python, Ruby, Javascript)
>
> https://softwareengineering.stackexchange.com/questions/314808/why-variables-in-python-are-different-from-other-programming-languages
>
> --
> nosy: +steven.daprano
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7262

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7263

___
Python tracker 

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



[issue33582] formatargspec deprecated but does nto emit DeprecationWarning.

2018-06-11 Thread Ned Deily


Change by Ned Deily :


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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset d26277a73b61277ad9568cff6503d55deef07223 by Miss Islington (bot) 
in branch '3.7':
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
https://github.com/python/cpython/commit/d26277a73b61277ad9568cff6503d55deef07223


--

___
Python tracker 

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



[issue33582] formatargspec deprecated but does nto emit DeprecationWarning.

2018-06-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7264

___
Python tracker 

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



[issue33582] formatargspec deprecated but does nto emit DeprecationWarning.

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 46c5cd0f6e22bdfbdd3f0b18f1d01eda754e7e11 by Ned Deily (Matthias 
Bussonnier) in branch 'master':
bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)
https://github.com/python/cpython/commit/46c5cd0f6e22bdfbdd3f0b18f1d01eda754e7e11


--
nosy: +ned.deily

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset afa1ea5bfd18947aa732a1ea09220aefbed81e1c by Miss Islington (bot) 
in branch '3.6':
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
https://github.com/python/cpython/commit/afa1ea5bfd18947aa732a1ea09220aefbed81e1c


--

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in the interpreter

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Since this is the sort of addition that I want to test and evaluate in extended 
use before release, this is a good time to revive this.  3.6.6rc1 and 3.7.0rc1 
are due tonight.  3.6.7 and 3.7.1 will be open for patches by tomorrow.

I opened #33839 to redoing tooltip.py.  I can test PR 7626 as is while tooltip 
is worked on.

--
dependencies: +IDLE tooltips.py: refactor and add docstrings and tests

___
Python tracker 

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



[issue33839] IDLE tooltips.py: refactor and add docstrings and tests

2018-06-11 Thread Terry J. Reedy


New submission from Terry J. Reedy :

calltip_w.py code is partly based on tooltip.py.  The latter is currently 
unused.  But it is needed, with changes, for squeezer (#1529353).  So I would 
like to see if we can make an improved Tooltip class that can be used or 
subclassed by both.

The current subclasses should be deleted unless actually used.  Docstrings 
should be added to what remains.  Then test_tooltip, with 100% coverage, should 
be added.  If needed, code can be changed to make testing easier.

--
assignee: terry.reedy
components: IDLE
messages: 319337
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE tooltips.py: refactor and add docstrings and tests
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue27397] email.message.Message.get_payload(decode=True) raises AssertionError that "should never happen"

2018-06-11 Thread Ned Deily


Ned Deily  added the comment:

> See #33770, which will make recognizing and handling this case 
> straightforward.

The fix for #33770 is only in 3.7.0 and later, so does this mean this change 
should not be backported to 3.6?  Updating the the versions accordingly.  If it 
is appropriate for 3.6, we can add that back in.

--
nosy: +ned.deily
versions: +Python 3.7, Python 3.8 -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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +7265

___
Python tracker 

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



[issue33656] IDLE: Turn on DPI awareness on Windows

2018-06-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Since there should be time before .rcs are cut, I changed the idlelib NEWS.txt 
entry to mention color changes, based on editing with the change in place.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue33582] formatargspec deprecated but does nto emit DeprecationWarning.

2018-06-11 Thread miss-islington


miss-islington  added the comment:


New changeset 60b8274fec3ff029591d8718650223c5ce78a05c by Miss Islington (bot) 
in branch '3.7':
bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)
https://github.com/python/cpython/commit/60b8274fec3ff029591d8718650223c5ce78a05c


--
nosy: +miss-islington

___
Python tracker 

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



  1   2   >