[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-23 Thread INADA Naoki

INADA Naoki added the comment:


New changeset a6296d34a478b4f697ea9db798146195075d496c by INADA Naoki in branch 
'master':
bpo-31095: fix potential crash during GC (GH-2974)
https://github.com/python/cpython/commit/a6296d34a478b4f697ea9db798146195075d496c


--

___
Python tracker 

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



[issue31264] Import Package/Module through HTTP/S repository

2017-08-23 Thread R. David Murray

R. David Murray added the comment:

Indeed, I personally can't imagine a circumstance in which I'd want to use this 
feature.  Even inside an org.  It also has security implications, which would 
also make it a harder sell.

--

___
Python tracker 

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



[issue31263] Assigning to subscript/slice of literal is permitted

2017-08-23 Thread R. David Murray

R. David Murray added the comment:

Sometimes it does, sometimes we make the change in a feature release, often 
after a deprecation period.  But in this case there is doubt that the behavior 
is incorrect in the first place.

This discussion should move to the python-ideas mailing list.  I'm going to 
close the issue, at least for now.

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



[issue31264] Import Package/Module through HTTP/S repository

2017-08-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Note that we're highly unlikely to ever accept a PEP to provide this natively, 
as it couples the process of runtime module loading too tightly to what should 
be private organisational details of the software publication process (domain 
names, repository names, etc).

We already know from experience with Java component naming that these kinds of 
approaches simply don't age well for widely adopted software in a distributed 
development context, as they turn things that shouldn't have any software 
compatibility implications (renaming a development repository, moving to a 
different repository hosting provider, selling a company) into major API 
compatibility management headaches.

While there are some reasonable applications for the feature when it comes to 
private software modules that are used only within a single (relatively small) 
organisation, the existence of httpimport also shows that there aren't any 
further changes needed to the core import system to enable it.

--

___
Python tracker 

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



[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-23 Thread Alexander Mohr

Alexander Mohr added the comment:

my vote is yes due to the defaultdict issue.  We were hitting this in our prod 
env

--

___
Python tracker 

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



[issue31266] attribute error

2017-08-23 Thread emin mamedov

emin mamedov added the comment:

Thank you Peter, problem has fixed.

I think, python interpreter must understand if a "temp1.py" will start in same 
directory with file "re.py", this is not a native module for python and 
interpreter can ignore re.py from user directory and etc.

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

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2017-08-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

A couple of thoughts:

* It is okay to add a couple lines to the decimal module docs noting a Cpython 
specific implementation detail that it uses better than expected algorithms 
which can payoff nicely when used with very large numbers.

* Mersenne prime examples and whatnot belong external to our docs.  I usually 
put my recipes and examples on the ASPN Python Cookbook.  
http://code.activestate.com/recipes/langs/python/

--
nosy: +rhettinger

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2017-08-23 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Hello,

I came across this issue and was wondering if the FAQ section of the doc might 
be a good place to mention the presence of FFT, or actually fast number 
theoretic transform, as Stefan pointed out.

I was also wondering if the short code snippet for the Mersenne prime might be 
included in the recipes as an example of what decimal is capable of?

--
nosy: +csabella

___
Python tracker 

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



[issue31263] Assigning to subscript/slice of literal is permitted

2017-08-23 Thread Isaac Elliott

Isaac Elliott added the comment:

Does backward compatibility take priority over correct behavior? What process 
is followed when fixing a bug causes a breaking change?

--

___
Python tracker 

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



[issue31263] Assigning to subscript/slice of literal is permitted

2017-08-23 Thread R. David Murray

R. David Murray added the comment:

If you would disallow "a = [0]; [5, a][1][:] = [3]", then your proposal will 
not be accepted, for backward compatibility reasons if nothing else.

--
versions: +Python 3.7 -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



[issue31263] Assigning to subscript/slice of literal is permitted

2017-08-23 Thread Isaac Elliott

Isaac Elliott added the comment:

Yes I would disallow a script such as
`a = [0]; [5, a][1][:] = [3]` (note: your example of just `[5, a][1][:] = [3]` 
does not run, so I assumed it must be used in a situation like this)

Evaluating the target of an assignment is unnecessary, we can syntactically 
determine whether some left hand side can be assigned to:

* Identifiers are assignable (`a = 2`)
* Attribute accesses are assignable, provided that the left of the dot is 
assignable (`a.foo = 2`, `a.b.c.foo`, etc)
* Subscripts are assignable, provided that the outer expression is assignable 
(`a[1] = 2`, `a.foo[b] = 2`, `a[1][2][3] = 2`, `a.b[1].c[2] = 2`)
* Lists are assignable, provided that all their elements are assignable 
(`[a,b,c] = [1,2,3]`)
* Expression lists/tuples are assignable, provided that all their elements are 
assignable (`a, b = (1, 2)`, `(a,b,c) = (1,2,3)`)
* Unpackings are assignable, provided that their argument is assignable (`*a, = 
[1,2,3]`, `a, *b = [1,2,3]`)
* Slices are assignable, provided that the outer expression is assignable 
(`a[:] = [1,2,3]`, `a.foo[1:2] = [1]`
* Everything else is not assignable (did I forget anything?)

This can definitely be encoded as a context-free grammar, although I don't know 
if it will present conflicts in the parser generator.

I do think it's worth it. Python is one of the most widely used programming 
languages, and it's our responsibility to ensure it behaves correctly.

--

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-08-23 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-08-23 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +3233

___
Python tracker 

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



[issue31267] threading.Timer object is affected by changes to system time

2017-08-23 Thread Thomas Keppler

New submission from Thomas Keppler:

Hi,

I have been playing around with threading.Timer objects as timeouts for a 
project and noticed that my timeouts are affected by system time changes.

To test this, I have written a small demonstration script (timer_testcase.py) 
which you can find in the attachments. I would expect that after 120 seconds, a 
"Hello!" message will appear on the screen regardless of system time changes.

If you run the script like you would normally, you will see that it will work 
properly and my expectations are met. Now, run it again and immediately use 
"date +%T -s "HH:MM:SS"" where the time is >= 2 mins in the future. You will 
notice that the timer will latch immediately instead of waiting those 120 
seconds before latching.

I have read Lib/threading.py to a certain extent and it seems like Timer 
objects are using monotonic time already because they use Events which use 
Conditions themselves, which references a "_timer" function that is just an 
alias for time.monotonic as one can see at the top of the file.
Then I checked out if the monotonic time works as expected (test_monotonic.py) 
by just jumping back and forth "in time", everything seemed to be normal.

Am I making a mistake and if so, where?

Thanks for any of your answers.

--
Best regards
Thomas

Environment: I'm using Python 3.5.3 on Debian 9.1 "Stretch" on x86_64.

--
components: Library (Lib)
files: timer_testcase.py
messages: 300765
nosy: winfreak
priority: normal
severity: normal
status: open
title: threading.Timer object is affected by changes to system time
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file47096/timer_testcase.py

___
Python tracker 

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



[issue31267] threading.Timer object is affected by changes to system time

2017-08-23 Thread Thomas Keppler

Changes by Thomas Keppler :


Added file: http://bugs.python.org/file47097/test_monotonic.py

___
Python tracker 

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



[issue31266] attribute error

2017-08-23 Thread Peter Otten

Peter Otten added the comment:

You have probably written your own re.py file which shadows the one in the 
standard library. Once you remove or rename your re.py the error should go away.

--
nosy: +peter.otten

___
Python tracker 

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



[issue31266] attribute error

2017-08-23 Thread emin mamedov

New submission from emin mamedov:

Hello!
I am just write some program with "string module", after starting my program 
python give me error about "re module".

My program is a tutorial from DrapsTV from Youtube.

Error -->>
Traceback (most recent call last):
  File "temp1.py", line 1, in 
from string import Template
  File "/usr/lib64/python3.6/string.py", line 77, in 
class Template(metaclass=_TemplateMetaclass):
  File "/usr/lib64/python3.6/string.py", line 82, in Template
flags = _re.IGNORECASE
AttributeError: module 're' has no attribute 'IGNORECASE'

--
components: Extension Modules
files: temp1.py
messages: 300763
nosy: emin mamedov
priority: normal
severity: normal
status: open
title: attribute error
type: crash
versions: Python 3.6
Added file: http://bugs.python.org/file47095/temp1.py

___
Python tracker 

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



[issue31229] wrong error messages when too many kwargs are received

2017-08-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Oren for your contribution.

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

___
Python tracker 

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



[issue31229] wrong error messages when too many kwargs are received

2017-08-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset bf9075a0c55186d2f34df63e6c8512dd6414ff4b by Serhiy Storchaka 
(Oren Milman) in branch 'master':
bpo-31229: Fixed wrong error messages when too many keyword arguments are 
received. (#3180)
https://github.com/python/cpython/commit/bf9075a0c55186d2f34df63e6c8512dd6414ff4b


--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

INADA Naoki added the comment:

When no change happens:

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import Ordedict; od = odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' 
-- 'od.move_to_end("a", 0)' 
 
py-default: . 90.6 ns +- 1.0 ns
py-patched: . 107 ns +- 1 ns

Mean +- std dev: [py-default] 90.6 ns +- 1.0 ns -> [py-patched] 107 ns +- 1 ns: 
1.18x slower (+18%)

When change happens:

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import OrderedDict as odict; od = 
odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' -- 'od.move_to_end("y", 0); 
od.move_to_end("z", 0)'
py-default: . 233 ns +- 4 ns
py-patched: . 304 ns +- 2 ns

Mean +- std dev: [py-default] 233 ns +- 4 ns -> [py-patched] 304 ns +- 2 ns: 
1.30x slower (+30%)

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about move_to_end(last=False)?

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

INADA Naoki added the comment:

Another idea is making "dict preserves insertion order" as language spec.
There are still some difference between dict and odict: .move_to_end() and 
__eq__.

But most use cases of odict is just keep insertion order.
For example, parsing config file, json, or csv.
In such cases, people can get all benefits (less memory and faster creation, 
iteration and deallocation) of dict if it's guaranteed.

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

INADA Naoki added the comment:

od.move_to_end() is slower too:

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import OrderedDict as odict; od = 
odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' -- 'od.move_to_end("a"); 
od.move_to_end("b")'
py-default: . 196 ns +- 4 ns
py-patched: . 227 ns +- 3 ns

Mean +- std dev: [py-default] 196 ns +- 4 ns -> [py-patched] 227 ns +- 3 ns: 
1.16x slower (+16%)

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import OrderedDict as odict; od = 
odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' -- 'od.move_to_end("z")'
py-default: . 74.7 ns +- 0.4 ns
py-patched: . 91.1 ns +- 3.5 ns

Mean +- std dev: [py-default] 74.7 ns +- 0.4 ns -> [py-patched] 91.1 ns +- 3.5 
ns: 1.22x slower (+22%)

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import OrderedDict as odict; od1 = odict.fromkeys(range(1)); 
od2=odict.fromkeys(range(1))' -- 'od1==od2'
py-default: . 451 us +- 3 us
py-patched: . 632 us +- 6 us

Mean +- std dev: [py-default] 451 us +- 3 us -> [py-patched] 632 us +- 6 us: 
1.40x slower (+40%)


# pros

* 1000 less lines of code
* 50% less memory usage
* 15% faster creation
* 100% (2x) faster iteration

# cons

* Some inconsistency against pure Python implementation
* 20% slower move_to_end
* 40% slower comparison

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

INADA Naoki added the comment:

I think typical usage is: get, set (incl, creating), and iterate.

* get: there is no difference
* set: inserting new key is little faster since no updating linked list
* iterate: in typical case, new odict is faster because current odict iterator 
do lookup for each key.

$ ./py-patched -m perf timeit --compare-to `pwd`/py-default \
  -s 'from collections import OrderedDict as odict; od = 
odict.fromkeys(range(1))' -- 'list(od)'

py-default: . 223 us +- 10 us
py-patched: . 93.7 us +- 3.3 us
Mean +- std dev: [py-default] 223 us +- 10 us -> [py-patched] 93.7 us +- 3.3 
us: 2.38x faster (-58%)


On the other hand, there are some cases new odict is slower:

* iterating sparse dict. (but same speed as normal dict)
* comparing two odict, because new odict do `list(od1) == list(od2)` to compare 
keys.

For now, new odict uses dict's iterator (with adding `reversed` order support) 
and it's weak
against modify while iterating.  That's why I used temporal list while 
comparing.
And there is one failing test for modify-while-iterate case.

So I'm thinking about implementing robust odict iterator which detect modify 
for now.

--

___
Python tracker 

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



[issue31264] Import Package/Module through HTTP/S repository

2017-08-23 Thread R. David Murray

R. David Murray added the comment:

This kind of proposal should start with a discussion on the python-ideas 
mailing list.  You can reopen the issue if there is a consensus for moving 
forward...but I wouldn't be surprised if this was considered to be a PEP level 
proposal.

--
nosy: +brett.cannon, eric.snow, ncoghlan, r.david.murray
resolution:  -> later
stage:  -> resolved
status: open -> closed
versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue31263] Assigning to subscript/slice of literal is permitted

2017-08-23 Thread R. David Murray

R. David Murray added the comment:

I'm don't have a lot of experience with parsers, but I suspect that we consider 
the cost of making the grammar more complex to be more significant than the 
benefit we'd get from catching these at compile time.  And as Vedran says, 
defining what can be caught without breaking legitimate things is distinctly 
non-trivial.

I vote to just close this issue.  If you come up with a proposal we can reopen.

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I like the idea. Actually I wanted to write such patch myself, but this is very 
delicate thing and needs to be very careful. The largest benefit is not just 
memory saving and performance, but robustness. Currently it is easy to went 
OrderedDict in incorrect state by using pure dict API. This can cause crashes, 
hangs or invalid bahavior (see issue24726 and issue25410). The new 
implementation should pass all existing tests and also fix the above issues.

See also issue28239. lru_cache uses simplified version of ordered dict.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26601] Use new madvise()'s MADV_FREE on the private heap

2017-08-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> needs patch
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I would be very careful going down this path.  Regular dict ordering is not yet 
guaranteed and is subject to change.  Its design was primarily about compaction 
and the ordering was a side-effect.  In contrast, the data structure for 
collections.OrderedDict() was designed specifically for maintaining order.  It 
is likely that there are some workloads where the regular dict would degrade 
significantly compared to ordered dicts.

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-08-23 Thread Christian H

Christian H added the comment:

I was also bitten by this bug, and would like to see it merged. The patch 
22536-subprocess-exception-filename-2.patch looks fine to me.

--
nosy: +Christian H

___
Python tracker 

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



[issue31263] Assigning to subscript/slice of literal is permitted

2017-08-23 Thread Vedran Čačić

Vedran Čačić added the comment:

There is no such thing as "sliced literal" per se. And [1,2,3] is in fact _not_ 
a literal (it's a _list display_, at least it was the last time I learned 
Python's vocabulary.) [1,2,3][0] is an expression, which is a slice. When you 
write [0] = 2,  is evaluated, and the result's __setitem__ 
is called. It is perfectly well-defined if the result is a list. Python doesn't 
care if it is a fresh list, or an already known one.

I guess it would be possible to change the grammar to disallow that, but do you 
really think it's worth it? And would you throw away also things such as 
[5,a][1][:]=[3]?

--
nosy: +veky

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

INADA Naoki added the comment:

There are some failing tests remaining, and I want to discuss about
some of them here.

Traceback (most recent call last):
  File "/home/inada-n/work/python/nodebug/Lib/test/test_ordered_dict.py", line 
261, in test_pop
self.assertEqual(m.pop('a', default=6), 6)
TypeError: pop() takes no keyword arguments

dict.pop doesn't take keyword argument.
Since OrderedDict is pure Python at first, C implementation of
OrderedDict.pop() takes keyword too.
May I change `dict.pop()` to take keyword too. It reduce odict
specific method.

Some test expect KeyError in some edge cases.
But new implementation behaves differently.
For example,

def test_dict_delitem(self):
OrderedDict = self.OrderedDict
od = OrderedDict()
od['spam'] = 1
od['ham'] = 2
dict.__delitem__(od, 'spam')
with self.assertRaises(KeyError):
repr(od)

Since current implementation uses linked list, it raises KeyError.
But this is totally OK for new C implementation.

---

Personally speaking, I want to stop keeping compatibility with pure Python
implementation.
Is it possible to make "builtin _collections.OrderedDict" as requirement for
all Python 3.7 implementations and remove pure Python implementation stdlib?

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +3232

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki

New submission from INADA Naoki:

Since dict preserves insertion order, doubly linked list in OrderedDict
can be removed.

There is small performance improvement for odict creation:

$ curl https://api.github.com/orgs/python/repos > repos.json
$ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from 
collections import OrderedDict as od; import json; 
data=open("repos.json").read()' -- 'json.loads(data, object_pairs_hook=od)'
py-default: . 1.53 ms +- 0.01 ms
py-patched: . 1.30 ms +- 0.01 ms

Mean +- std dev: [py-default] 1.53 ms +- 0.01 ms -> [py-patched] 1.30 ms +- 
0.01 ms: 1.18x faster (-15%)

And more memory efficient:

$ ./py-default -c 'from collections import OrderedDict; import sys; 
print(sys.getsizeof(OrderedDict.fromkeys(range(1000'
85416

$ ./py-patched -c 'from collections import OrderedDict; import sys; 
print(sys.getsizeof(OrderedDict.fromkeys(range(1000'
36992

But most important benefit is smaller code.  It make easy to maintain.

--
components: Interpreter Core
messages: 300748
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Remove doubly-linked list from C OrderedDict
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



[issue31264] Import Package/Module through HTTP/S repository

2017-08-23 Thread John Torakis

New submission from John Torakis:

A module presented in "https://github.com/operatorequals/httpimport; which 
provides functionality for package/module loading through HTTP/S, like the 
golang's "import github.com/someusr/somepkg/subpkg", but for any directory 
served with HTTP/S.

I believe that this module has to become a core feature, after, of course, the 
necessary scrutiny!

--
components: Extension Modules
hgrepos: 372
messages: 300747
nosy: operatorequals
priority: normal
severity: normal
status: open
title: Import Package/Module through HTTP/S repository
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue31244] IDLE: work around shortcuts bug in Windows' IMEs and tk

2017-08-23 Thread Constantine Ketskalo

Constantine Ketskalo added the comment:

Bug is not in Python? Then where? Windows?

- I assume that the alt menu shortcuts work...
- NO! And I've written that before as well! Alt + combinations don't work 
neither with 

cyrillic!

- Does it affect all Cyrillic IMEs?
- Yes, I've written that before already - shortcuts don't work neither with 
Ukrainian, nor 

with Russian
- If so, do different cyrillic keyboards have the the alphabetic chars in 
different 

places, so that a separate workaround is needed for every IME, even for letter 
chars?
- Yes and no. Most letters in different cyrillic alphabets are the same, so 
they have the 

same place on the keyboard(as well as the same encoding), but some of them are 
different, 

so in different IMEs same key gives different letter.
For instance English 's' in Ukrainian is 'і' and in Russian is 'ы'. But English 
'c' is in 

both Ukrainian and Russian 'с' (looks the same, has different encoding then 
English, but 

has same encoding for Ukrainian and Russian).

--

___
Python tracker 

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



[issue31243] checks whether PyArg_ParseTuple returned a negative int

2017-08-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +IO
nosy: +benjamin.peterson, stutzbach

___
Python tracker 

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



[issue31244] IDLE: work around shortcuts bug in Windows' IMEs and tk

2017-08-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it affects all Cyrillic layouts, as well as Greek and other alphabetical 
systems. It also affects layouts for Western-European languages with keys for 
accented characters. Different Cyrillic keyboards have different characters on 
the same key, but I don't know if they have different keys for the same 
character. Fortunately all Cyrillic languages use the same ANSI encoding. But I 
think there are conflicts between Cyrillic and non-Cyrillic layouts. Different 
keys on different keyboards can produce the same code (which means different 
characters in different codepages).

--

___
Python tracker 

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



[issue31024] typing.Tuple is class but is defined as data inside https://docs.python.org/3.6/objects.inv

2017-08-23 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

TBH, I think this is a Sphinx problem, not a Python problem. And concerning 
``Tuple`` being an actual class I think this is an implementation detail, so 
that I am closing this as "won't fix".

--
resolution:  -> wont fix
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