Why searching in a set is much faster than in a list ?

2016-09-27 Thread ast
Hello I noticed that searching in a set is faster than searching in a list. from timeit import Timer from random import randint l = [i for i in range(100)] s = set(l) t1 = Timer("randint(0, 200) in l", "from __main__ import l, randint") t2 = Timer("randint(0, 200) in s", "from __main__ import

[issue28293] Don't completely dump the regex cache when full

2016-09-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Perhaps: _cache.pop(next(iter(_cache))) The for-loop version indirect about what it is trying to do and relies on an obscure quirk of exactly when it is an error to mutate while iterating. I do like that the side-effect of the compact dict is that is lets

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Gregory Ewing
Peng Yu wrote: On Tue, Sep 27, 2016 at 10:01 AM, Chris Angelico wrote: """In some languages, the variable bindings contained in a closure behave just like any other variables. Alas, in python they are read-only.""" This is not true, at least as of Python 3. So in Python

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Gregory Ewing
Lawrence D’Oliveiro wrote: On Wednesday, September 28, 2016 at 3:35:58 AM UTC+13, Peter Otten wrote: is Python actually a "functional language"? Yes . No, not according to what the term "functional language" usually

[issue28293] Don't completely dump the regex cache when full

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nice catch! Here is a patch that deletes the first key. -- stage: commit review -> patch review Added file: http://bugs.python.org/file44853/re_cache_del_first.patch ___ Python tracker

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Possible solutions (in any case the documentation needs changes): 1. Raise OverflowError at both ends (revert issue15421patch). The method becomes unusable for two extreme months. 2. Yield an incomplete week at both ends (apply the patch from issue26650).

[issue28293] Don't completely dump the regex cache when full

2016-09-27 Thread Xiang Zhang
Xiang Zhang added the comment: But with the compact dict implementation, popitem is not going to evict an arbitrary entry but always the last one. Will this cause two interchangeably used regexes always need to recompile? -- nosy: +xiang.zhang ___

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-27 Thread eryk sun
On Wed, Sep 28, 2016 at 2:13 AM, wrote: > If the load was distributed by the OS schedules across all cores, > does it means I can't make one core solely running a piece of codes > for me and so I have no contol on its performance? In Unix, Python's os module may have

[issue28293] Don't completely dump the regex cache when full

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: serhiy.storchaka -> rhettinger stage: patch review -> commit review ___ Python tracker ___

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Brett. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5, Python 3.6 ___ Python tracker

[issue28293] Don't completely dump the regex cache when full

2016-09-27 Thread Raymond Hettinger
New submission from Raymond Hettinger: When the regex cache gets filled, it is cleared in its entirety. Instead, it only needs to evict one arbitrary entry. This will save the us from having to rebuild and recache frequently used regexes. -- assignee: serhiy.storchaka components:

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-27 Thread Roy Williams
Roy Williams added the comment: @Brett @Berker In a similar vein, it'd be great to expose the `-b` flag in Python 3 in a similar manner to test for invalid byte comparisons. -- ___ Python tracker

Re: Nested for loops and print statements

2016-09-27 Thread Steven D'Aprano
On Wednesday 28 September 2016 12:48, Larry Hudson wrote: > As they came through in the newsgroup, BOTH run correctly, because both > versions had leading spaces only. > (I did a careful copy/paste to check this.) Copying and pasting from the news client may not be sufficient to show what

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Jussi Piitulainen
Chris Angelico writes: > On Wed, Sep 28, 2016 at 7:19 AM, Terry Reedy wrote: >> The value of the cell variable is writable from within the body of the >> closure function if declared nonlocal, but not otherwise, and not from >> without. The latter may be what Peng meant by 'change' and the

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-27 Thread Gene Heskett
On Tuesday 27 September 2016 22:13:51 jf...@ms4.hinet.net wrote: > eryk sun at 2016/9/27 11:44:49AM wrote: > > The threads of a process do not share a single core. The OS > > schedules threads to distribute the load across all cores > > hmmm... your answer overthrow all my knowledge about

[issue26072] pdb fails to access variables closed over

2016-09-27 Thread Chun-Yu Tseng
Chun-Yu Tseng added the comment: What Antony Lee mentioned are two different cases. The former is what PDB should behave because it is not reasonable to inspect a variable does not exist in the current frame. If you want to do so, you have to reference the variable `x` as a closure inside

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +calendar.prcal() output has a problem, calendar: OverflowErrors for year == 1 and firstweekday > 0 ___ Python tracker

[issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0

2016-09-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Make Calendar.itermonthdates() behave consistently in edge cases ___ Python tracker

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed superseder: -> Make Calendar.itermonthdates() behave consistently in edge cases ___ Python tracker

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-27 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: The Calendar.itermonthdates() method is defined as follows: "Return an iterator for one month. The iterator will yield datetime.date values and will always iterate through complete weeks, so it will yield dates outside the specified month." However,

Re: Nested for loops and print statements

2016-09-27 Thread Larry Hudson via Python-list
On 09/26/2016 01:57 PM, Cai Gengyang wrote: Ok it works now: for row in range(10): for column in range(10): print("*",end="") but how is it different from --- for row in

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Peng Yu
On Tue, Sep 27, 2016 at 10:01 AM, Chris Angelico wrote: > On Wed, Sep 28, 2016 at 12:01 AM, Peng Yu wrote: >> Hi, In many other functional language, one can change the closure of a >> function. Is it possible in python? >> >>

[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2016-09-27 Thread naught101
naught101 added the comment: Here you go. -- keywords: +patch Added file: http://bugs.python.org/file44851/mp.map.starmap.patch ___ Python tracker ___

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset f2aff898f7c8 by Alexander Belopolsky in branch '2.7': Issue #28253: Fixed calendar functions for extreme months: 0001-01 and -12. https://hg.python.org/cpython/rev/f2aff898f7c8 -- ___ Python tracker

[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2016-09-27 Thread naught101
naught101 added the comment: OK, one question, is Pool.map preferable to Pool.starmap in any particular cases? -- ___ Python tracker ___

[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: > What is the process? hg clone cpython, and make a patch from that and post it > here? Yes, it's exactly what you just described :) See https://docs.python.org/devguide/index.html for details. > Or is there some pull-request style process available? Not

[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2016-09-27 Thread naught101
naught101 added the comment: Happy to. What is the process? hg clone cpython, and make a patch from that and post it here? Or is there some pull-request style process available? -- ___ Python tracker

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-27 Thread jfong
eryk sun at 2016/9/27 11:44:49AM wrote: > The threads of a process do not share a single core. The OS schedules > threads to distribute the load across all cores hmmm... your answer overthrow all my knowledge about Python threads completely:-( I actually had ever considered using

Re: Python C API: How to debug reference leak?

2016-09-27 Thread dl l
When I debug in C++, I see the reference count of a PyObject is 1. I don't know where is referencing this object. How can I find out where is referencing this object? 2016-09-27 15:47 GMT+08:00 dl l : > Thanks for reply. Is there any function in C to get the reference objects

[issue23155] unittest: object has no attribute '_removed_tests'

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: The culprit is the ``test_suite='nose.collector'`` line here. It looks like this has already been fixed in nose: https://github.com/nose-devs/nose/issues/759 -- nosy: +berker.peksag resolution: -> not a bug stage: -> resolved status: open -> closed

[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-09-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I don't see any problem with switching the lookup order now, > and I agree that should be less confusing, Thanks Nick. I concur as well and will apply this. Would it be reasonable to apply this to 3.6? IMO, it isn't a new feature, it is more of a

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2016-09-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I don't have a burning desire to get this in, > I just thought it would be a nice to have. In that case, I think we should decline. -- resolution: -> rejected status: open -> closed ___ Python tracker

[issue26869] unittest longMessage docs

2016-09-27 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag versions: +Python 3.7 ___ Python tracker ___

[issue27470] -3 commandline option documented differently via man

2016-09-27 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +easy nosy: +berker.peksag stage: -> needs patch type: -> behavior ___ Python tracker

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7efba48299e9 by Alexander Belopolsky in branch 'default': Issue #28253: Added a NEWS entry. https://hg.python.org/cpython/rev/7efba48299e9 New changeset 55f11196c949 by Alexander Belopolsky in branch '3.5': Issue #28253: Added a NEWS entry.

[issue11501] distutils.archive_util should handle absence of zlib module

2016-09-27 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> fixed stage: needs patch -> resolved status: pending -> closed ___ Python tracker

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset c439bce36bf2 by Alexander Belopolsky in branch '3.5': Issue #28253: Fixed calendar functions for extreme months: 0001-01 and -12. https://hg.python.org/cpython/rev/c439bce36bf2 New changeset cd384c4b441a by Alexander Belopolsky in branch '3.6':

[issue28291] urllib/urllib2 AbstractDigestAuthHandler locked to retried count of 5

2016-09-27 Thread secynic
Changes by secynic : -- keywords: +patch versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file44850/issue28291.patch ___ Python tracker

[issue28210] argparse with subcommands difference in python 2.7 / 3.5

2016-09-27 Thread paul j3
paul j3 added the comment: Yes there was/is a bug that made subparsers optional. http://bugs.python.org/issue9253 -- nosy: +paul.j3 ___ Python tracker

[issue28219] Is order of argparse --help output officially defined?

2016-09-27 Thread paul j3
paul j3 added the comment: The display of the Action help lines is determined by the parser.format_help function https://docs.python.org/3/library/argparse.html#printing-help This function creates a Formatter, and then loads it with a 'stack' of sections. Sections are displayed in that

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: +1 from me. This would help people to port their projects to Python 3. -- nosy: +berker.peksag ___ Python tracker ___

[issue27322] test_compile_path fails when python has been installed

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: Here's an updated patch. -- Added file: http://bugs.python.org/file44849/issue27322_v3.diff ___ Python tracker ___

Getting IDLE to use correct Tcl/Tk on MacOSX 10.6?

2016-09-27 Thread Gregory Ewing
I don't normally use IDLE, but I had occasion to use it on MacOSX 10.6 to answer someone's question, and of course it didn't work properly due to Apple's broken Tcl/Tk. I followed the advice to install ActiveState Tcl 8.5.18.0, but my Python still wants to use Apple's Tcl. How do I persuade

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-27 Thread Brett Cannon
Brett Cannon added the comment: The idea seems reasonable to me. I would think this would fall under the -3 exemption if others agree this is reasonable to implement. -- nosy: +brett.cannon ___ Python tracker

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Lawrence D’Oliveiro
On Wednesday, September 28, 2016 at 4:01:36 AM UTC+13, Chris Angelico wrote: > You can also have multiple closures in the same context, and changes made by > one of them will affect the others. This is the point where it’s probably easier to wrap them all together into methods of a common class.

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Lawrence D’Oliveiro
On Wednesday, September 28, 2016 at 3:35:58 AM UTC+13, Peter Otten wrote: > is Python actually a "functional language"? Yes . -- https://mail.python.org/mailman/listinfo/python-list

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-27 Thread Brett Cannon
Changes by Brett Cannon : -- type: behavior -> enhancement ___ Python tracker ___ ___

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-27 Thread Brett Cannon
Changes by Brett Cannon : -- stage: -> test needed ___ Python tracker ___ ___

[issue28288] Expose environment variable for Py_Py3kWarningFlag

2016-09-27 Thread Brett Cannon
Changes by Brett Cannon : -- components: +Interpreter Core -2to3 (2.x to 3.x conversion tool) ___ Python tracker ___

Re: How to make a copy of chained dicts effectively and nicely?

2016-09-27 Thread Lawrence D’Oliveiro
On Wednesday, September 28, 2016 at 2:27:36 AM UTC+13, Jussi Piitulainen wrote: > Lawrence D’Oliveiro writes: >> dict(dict(d1, **d2), **d3) > > Nice expression. But that's not available if the keys are not strings: > > dict({}, **{ 1:3 }) > ==> > Traceback (most recent call last): > File "",

[issue26477] typing forward references and module attributes

2016-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed by 09cc43df4509. -- nosy: +gvanrossum resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26075] typing.Union unifies types too broadly

2016-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed by 09cc43df4509. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

Re: Nested for loops and print statements

2016-09-27 Thread Gregory Ewing
Cai Gengyang wrote: How are you running the interactive interpreter? Are you using IDLE, or are you running Python in a command window? --- IDLE I don't normally use IDLE on MacOSX, so I had to try it to find out. I think I know what your problem is now. When you type a line into IDLE ending

[issue25830] _TypeAlias: Discrepancy between docstring and behavior

2016-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed by 09cc43df4509. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28291] urllib/urllib2 AbstractDigestAuthHandler locked to retried count of 5

2016-09-27 Thread secynic
secynic added the comment: It is a very limited use case; I won't gripe about 3.7+ only support. At the end of the day, even shown in the comments of that class, it shouldn't be set to a static 5 count. At least this is a very easy patch that won't affect existing code. --

[issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled

2016-09-27 Thread Joe Jevnik
Joe Jevnik added the comment: I definitely could have used PyImport_Import and PyObject_Call to accomplish this task; however, when I looked at at the implementation of these functions it seemed like a lot of overhead and book keeping just to set a boolean. Since I was already in a C

[issue28291] urllib/urllib2 AbstractDigestAuthHandler locked to retried count of 5

2016-09-27 Thread R. David Murray
R. David Murray added the comment: For (convoluted) background, see issue 8797. A solution that uses a new would be a new feature and could only go in 3.7, but perhaps the solutions in the above issue will point to a backward compatible solution. -- nosy: +r.david.murray

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Ian Kelly
On Tue, Sep 27, 2016 at 3:19 PM, Terry Reedy wrote: > On 9/27/2016 11:01 AM, Chris Angelico wrote: >> >> On Wed, Sep 28, 2016 at 12:01 AM, Peng Yu wrote: >>> >>> Hi, In many other functional language, one can change the closure of a >>> function. Is it

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Brett Cannon
Brett Cannon added the comment: And I say don't worry about backporting. -- ___ Python tracker ___ ___

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Brett Cannon
Brett Cannon added the comment: Patch LGTM. -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___

[issue28283] test_sock_connect_sock_write_race() of test.test_asyncio.test_selector_events fails randomly on FreeBSD

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: Just saw http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.5/builds/1136/steps/test/logs/stdio and went ahead to remove the test. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed

[issue28283] test_sock_connect_sock_write_race() of test.test_asyncio.test_selector_events fails randomly on FreeBSD

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset cf93671100bf by Berker Peksag in branch '3.5': Issue #28283: Remove flaky test test_sock_connect_sock_write_race https://hg.python.org/cpython/rev/cf93671100bf New changeset b9f18dcbfc4b by Berker Peksag in branch '3.6': Issue #28283: Merge from

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Chris Angelico
On Wed, Sep 28, 2016 at 7:19 AM, Terry Reedy wrote: > The value of the cell variable is writable from within the body of the > closure function if declared nonlocal, but not otherwise, and not from > without. The latter may be what Peng meant by 'change' and the blogger by >

[issue28283] test_sock_connect_sock_write_race() of test.test_asyncio.test_selector_events fails randomly on FreeBSD

2016-09-27 Thread Yury Selivanov
Yury Selivanov added the comment: > I dislike the idea of a test for a race condition which skips itself if it fails to reproduce the race condition :-/ I like the idea of removing he unit test. OK, let's remove the test. I can do that myself in a couple of days. --

[issue28176] Fix callbacks race in asyncio.SelectorLoop.sock_connect

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: test_sock_connect_sock_write_race failure is being discussed in issue 28283. Closing this again. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue28291] urllib/urllib2 AbstractDigestAuthHandler locked to retried count of 5

2016-09-27 Thread secynic
New submission from secynic: urllib/urllib2 AbstractDigestAuthHandler is hardcoded to 5 retries (self.retried). Normally this wouldn't be an issue. Certain products link basic HTTP auth to Active Directory (yes, this shouldn't be a thing). When you have a failed login attempt lockout set on

Re: Is there a way to change the closure of a python function?

2016-09-27 Thread Terry Reedy
On 9/27/2016 11:01 AM, Chris Angelico wrote: On Wed, Sep 28, 2016 at 12:01 AM, Peng Yu wrote: Hi, In many other functional language, one can change the closure of a function. Is it possible in python? http://ynniv.com/blog/2007/08/closures-in-python.html From the blog

Re: Can this be easily done in Python?

2016-09-27 Thread Paul Rubin
TUA writes: > TransactionTerms = > that sets the variable TransactionTerms to its own name as string It's conceivably possible using messy introspection hackery, but if you're asking that question you don't want to think about doing it that way. If you describe the actual

[issue27838] test_os.test_chown() random failure on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: Perhaps running a script like below on the host would help to identify the problem? import getpass import grp import pprint pprint.pprint(getpass.getuser()) pprint.pprint([(g.gr_gid, g.gr_name) for g in grp.getgrall()]) pprint.pprint([(g.gr_gid, g.gr_name,

Re: Can this be easily done in Python?

2016-09-27 Thread Random832
On Tue, Sep 27, 2016, at 15:58, TUA wrote: > Is the following possible in Python? > > Given how the line below works > > TransactionTerms = 'TransactionTerms' > > > have something like > > TransactionTerms = > > that sets the variable TransactionTerms to its own name as string >

Re: event loop vs threads

2016-09-27 Thread Terry Reedy
On 9/27/2016 12:01 AM, srinivas devaki wrote: how does Python switch execution and maintain context i.e function stack etc,.. for co-routines and why is it less costly than switching threads which almost do the same, and both are handled by Python Interpreter itself(event loop for co-routines

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a simple patch. But I'm not sure that this is a bug. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file44848/importerror-reset-attributes.patch ___ Python tracker

[issue28117] warning: dereferencing type-punned pointer will break strict-aliasing rules

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch eliminates warnings. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file44847/keccak_warnings.patch ___ Python tracker

[issue28283] test_sock_connect_sock_write_race() of test.test_asyncio.test_selector_events fails randomly on FreeBSD

2016-09-27 Thread STINNER Victor
STINNER Victor added the comment: I dislike the idea of a test for a race condition which skips itself if it fails to reproduce the race condition :-/ I like the idea of removing he unit test. But I don't have a strong opinion on this issue. -- ___

Can this be easily done in Python?

2016-09-27 Thread TUA
Is the following possible in Python? Given how the line below works TransactionTerms = 'TransactionTerms' have something like TransactionTerms = that sets the variable TransactionTerms to its own name as string representation without having to specify it explicitly as in the line above

[issue28281] Remove year limits from calendar

2016-09-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Under my proposal year=-1 is 2 B.C. and year 0 is a leap year $ ./python.exe -mcalendar 0 2 February 0 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 This is the simplest extension and

[issue28276] test_loading.py - false positive result for "def test_find" when find_library() is not functional or the (shared) library does not exist

2016-09-27 Thread Michael Felt
Michael Felt added the comment: Actually, what may be needed are more "@skip" blocks - as ctypes has always been platform dependent. OR - have a counter or boolean that starts as zero or false and increase each time find_library() returns a value - and the test fails if the counter is still

[issue28290] BETA report: Python-3.6 build messages to stderr: AIX and "not GCC"

2016-09-27 Thread Christian Heimes
Christian Heimes added the comment: blake2 is a hash algorithm. It uses #pragma pack(push, 1) and #pragma pack(pop) to change packing rules for structs. -- nosy: +christian.heimes ___ Python tracker

[issue28281] Remove year limits from calendar

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think data range is limited by year 1 due to ambiguity of year -1. Is it 1 B.D. or 2 years before year 1 (2 B.D.)? -- ___ Python tracker

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: serhiy.storchaka -> belopolsky ___ Python tracker ___

[issue20947] -Wstrict-overflow findings

2016-09-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue20947] -Wstrict-overflow findings

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset dad879edefd2 by Serhiy Storchaka in branch '3.5': Issue #20947: Fixed a gcc warning with -Wstrict-overflow. https://hg.python.org/cpython/rev/dad879edefd2 New changeset 5ecbe8a55ccd by Serhiy Storchaka in branch '3.6': Issue #20947: Fixed a gcc

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch LGTM. You can see how itermonthdates() is used in third-party code: https://github.com/sunlightlabs/django-locksmith/blob/master/locksmith/hub/dataviews.py https://github.com/quandyfactory/Quandy/blob/master/quandy.py

[issue28290] BETA report: Python-3.6 build messages to stderr: AIX and "not GCC"

2016-09-27 Thread Michael Felt
New submission from Michael Felt: GCC and IBM xlC compilers pay attention to different things - so some of the messages are "accepted" if not harmless. e.g. this type: "./Modules/xxsubtype.c", line 293.19: 1506-196 (W) Initialization between types "void*" and "int(*)(struct _object*)" is not

[issue28290] BETA report: Python-3.6 build messages to stderr: AIX and "not GCC"

2016-09-27 Thread Michael Felt
Changes by Michael Felt : -- versions: +Python 3.6 ___ Python tracker ___ ___

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Brett Cannon
Brett Cannon added the comment: I think it's a bug, but a low priority one. -- priority: normal -> low ___ Python tracker ___

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: Thanks for triaging this, Bert. Would you like to propose a patch with a test case? Note that we can't fix this in 3.3 and 3.4 because they are in security-fix-only mode. See https://docs.python.org/devguide/index.html#status-of-python-branches for details.

[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2016-09-27 Thread Berker Peksag
Berker Peksag added the comment: I think we can add a note for starmap() in the following sentence: > [...] (it supports only one iterable argument though). (Quoted from https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.map) Would you like to write a patch?

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: ImportError.__init__ sets only specified attributes ("msg", "name" or "path"), and left not explicitly specified attributes unchanged. >>> err = ImportError('test', name='name') >>> err.args, err.msg, err.name, err.path (('test',), 'test', 'name', None)

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added a test for multiple invalid keyword arguments, added braces, fixed a leak. But there is other oddity in ImportError constructor (issue28289). -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: issue28253-4.diff should be good now. -- ___ Python tracker ___ ___

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file44837/issue28253-4.diff ___ Python tracker ___

Re: How to reduce the DRY violation in this code

2016-09-27 Thread Wildman via Python-list
On Tue, 27 Sep 2016 10:30:05 -0700, Paul Rubin wrote: > Chris Angelico writes: >> Can you elaborate on what "GoF builder" means? Presumably it's a >> special case of the builder pattern, > > I think it just means the usual builder pattern, from the Design > Patterns book by

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file44845/issue28253-4.diff ___ Python tracker ___

[issue21578] Misleading error message when ImportError called with invalid keyword args

2016-09-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9b8f0db1944f by Serhiy Storchaka in branch '3.5': Issue #21578: Fixed misleading error message when ImportError called with https://hg.python.org/cpython/rev/9b8f0db1944f New changeset 95549f4970d0 by Serhiy Storchaka in branch '3.6': Issue #21578:

[issue28253] calendar.prcal(9999) output has a problem

2016-09-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Something went wrong with issue28253-4.diff. I'll investigate and replace. -- ___ Python tracker ___

Re: How to reduce the DRY violation in this code

2016-09-27 Thread Paul Rubin
Chris Angelico writes: > Can you elaborate on what "GoF builder" means? Presumably it's a > special case of the builder pattern, I think it just means the usual builder pattern, from the Design Patterns book by the so-called Gang of Four (GoF). --

Re: Case insensitive replacement?

2016-09-27 Thread Paul Rubin
> needle = "World" > haystack = "Hello, world!" > replacement = "THERE" > result = haystack.replace(needle, replacement, ignore_case=True) > # result would be "Hello, THERE!" >>> import re >>> re.sub('(?i)world','THERE','Hello World') 'Hello THERE' --

Re: How to reduce the DRY violation in this code

2016-09-27 Thread Chris Angelico
On Wed, Sep 28, 2016 at 3:08 AM, Gerald Britton wrote: >> >> I have a class that takes a bunch of optional arguments. They're all >> optional, with default values of various types. For simplicity, let's say >> some are ints and some are floats: class Spam: >> def

[issue28275] LZMADecompressor.decompress Use After Free

2016-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed with small changes. Thank you John for your contribution. Tested that 3.4 is not affected. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

  1   2   >