[issue22196] namedtuple documentation could/should mention the new Enum type

2014-08-14 Thread Lele Gaifax
New submission from Lele Gaifax: The documentation of namedtuple, near the end, talks about implementing enumerated constants and says “Enumerated constants can be implemented with named tuples, but it is simpler and more efficient to use a simple class declaration“. Maybe it should mention

[issue22195] Make it easy to replace print() calls with logging calls

2014-08-14 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22195 ___ ___

[issue22197] Allow better verbosity / output control in test cases

2014-08-14 Thread Antoine Pitrou
New submission from Antoine Pitrou: Currently, test cases have no control over output and verbosity. I would propose two possible enhancements: - give the TestCase read access to the verbosity value (as e.g. `self.verbosity`), to allow for conditional output in tests - allow test methods to

[issue22197] Allow better verbosity / output control in test cases

2014-08-14 Thread Zachary Ware
Changes by Zachary Ware zachary.w...@gmail.com: -- nosy: +zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22197 ___ ___ Python-bugs-list

[issue22195] Make it easy to replace print() calls with logging calls

2014-08-14 Thread Saimadhav Heblikar
Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com: -- nosy: +sahutd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22195 ___ ___

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
New submission from Mark Dickinson: I'm not sure it's worth fixing this, but it seems worth recording: -0.5 // float('inf') -1.0 I was expecting a value of `-0.0`, and while IEEE 754 doesn't cover the floor division operation, I'm reasonably confident that that's the value it would have

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198 ___ ___ Python-bugs-list mailing

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22198 ___ ___ Python-bugs-list

[issue15381] Optimize BytesIO to do less reallocations when written, similarly to StringIO

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Benchmark from issue22003: $ ./python0 -m timeit -s 'import i' 'i.readlines()' Before patch: 10 loops, best of 3: 36.1 msec per loop After patch: 10 loops, best of 3: 27.5 msec per loop -- ___ Python tracker

[issue22199] Embedding Python documentation error

2014-08-14 Thread Jim Carroll
New submission from Jim Carroll: On the page https://docs.python.org/2/extending/embedding.html#compiling-and-linking-under-unix-like-systems The documentation makes the following reference: ...(use sysconfig.get_makefile_filename() to find its location)... But this is incorrect. sysconfig

[issue21795] smtpd.SMTPServer should announce 8BITMIME when supported and accept SMTPUTF8 without it

2014-08-14 Thread Milan Oberkirch
Milan Oberkirch added the comment: Thanks, for the review, here's comes an updated version. -- Added file: http://bugs.python.org/file36370/issue21795v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21795

[issue22198] Odd floor-division corner case

2014-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Aug 14, 2014 at 04:47:41PM +, Mark Dickinson wrote: I'm not sure it's worth fixing this, but it seems worth recording: -0.5 // float('inf') -1.0 I was expecting a value of `-0.0`, and while IEEE 754 doesn't cover the floor division

[issue22193] Add _PySys_GetSizeOf()

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset b5114747d3ed by Serhiy Storchaka in branch '2.7': Issue #22193: Added private function _PySys_GetSizeOf() needed to implement http://hg.python.org/cpython/rev/b5114747d3ed New changeset 46504edf7594 by Serhiy Storchaka in branch '3.4': Issue

[issue15381] Optimize BytesIO to do less reallocations when written, similarly to StringIO

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 601045ceff94 by Serhiy Storchaka in branch 'default': Issue #15381: Optimized line reading in io.BytesIO. http://hg.python.org/cpython/rev/601045ceff94 -- ___ Python tracker rep...@bugs.python.org

[issue22193] Add _PySys_GetSizeOf()

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Martin. -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22193 ___

[issue22198] Odd floor-division corner case

2014-08-14 Thread Tim Peters
Tim Peters added the comment: I'm OK with -1, but I don't get that or -0.0 on 32-bit Windows Py 3.4.1: Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. -0.5 // float('inf') nan So maybe

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
Mark Dickinson added the comment: Steven: there's a set of (unwritten) rules for how the IEEE 754 operations work. (I think they actually *were* articulated explicitly in some of the 754r drafts, but didn't make it into the final version.) One of them is that ideally, a floating-point

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
Mark Dickinson added the comment: [Tim] -0.5 // float('inf') nan Urk! I wonder what's going on there. I think I like that answer even less than -1.0. IEEE 754's floor does indeed take -0.0 to -0.0. -- ___ Python tracker rep...@bugs.python.org

[issue15381] Optimize BytesIO to do less reallocations when written, similarly to StringIO

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch without just committed line reading optimization and committed in issue22193 the _PySys_GetSizeOf() function. -- Added file: http://bugs.python.org/file36371/bytesio_resized_bytes-5.patch ___ Python

[issue15381] Optimize BytesIO to do less reallocations when written, similarly to StringIO

2014-08-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can you post any benchmark? Also, if you wouldn't change the resizing factor it would make it easier to compare the two approaches on their own merits, IMO. -- ___ Python tracker rep...@bugs.python.org

[issue15381] Optimize BytesIO to do less reallocations when written, similarly to StringIO

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I posted benchmarks two years ago, in msg165795. Here are updated results: $ ./python -m timeit -s import io; n=100; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1 s=io.BytesIO(); w=s.write for x in d: w(x) s.getvalue() Before patch: 10 loops, best of 3: 42.3 msec

[issue22193] Add _PySys_GetSizeOf()

2014-08-14 Thread Christian Heimes
Christian Heimes added the comment: The code is missing an overflow check. There should be some verification that __sizeof__ returns a value smaller than SIZE_T_MAX - 24. Also 24 for GC overhead looks strange. IMHO it should be sizeof(PyGC_Head) which can be smaller than 24 bytes. Python

[issue22200] Remove distutils checks for Python version

2014-08-14 Thread Thomas Kluyver
New submission from Thomas Kluyver: We noticed the other day that distutils, despite being part of the standard library, checks the version of Python it's running under and has some different code paths - one of which is only taken for Python 2.2. We haven't managed to figure out why this is

[issue21520] Erroneous zipfile test failure if the string 'bad' appears in pwd

2014-08-14 Thread Ismail Badawi
Changes by Ismail Badawi ism...@badawi.io: -- nosy: +ismail.badawi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21520 ___ ___ Python-bugs-list

[issue22199] 2.7 sysconfig._get_makefile_filename should be sysconfig.get_makefile_filename

2014-08-14 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. After reviewing the situation, I think this is actually a code bug rather than a documentation issue; in other words, things should work like the embedding documentation states. sysconfig has a complicated history; there are currently 6

[issue21815] imaplib truncates some untagged responses

2014-08-14 Thread Lita Cho
Lita Cho added the comment: pinging for another review. I have included tests for the patch as well as documentation! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21815 ___

[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-08-14 Thread Lita Cho
Lita Cho added the comment: ping! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21933 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22195] Make it easy to replace print() calls with logging calls

2014-08-14 Thread Vinay Sajip
Vinay Sajip added the comment: This is easy enough to do, I posted about it in 2009 here: http://plumberjack.blogspot.co.uk/2009/09/how-to-treat-logger-like-output-stream.html Basically, something like class LoggerWriter(object): def __init__(self, logger, level): self.logger =

[issue22201] python -mzipfile fails to unzip files with folders created by zip

2014-08-14 Thread Antony Lee
New submission from Antony Lee: With Python 3.4.1: $ mkdir foo; zip -r foo{,}; python -mzipfile -e foo.zip dest adding: foo/ (stored 0%) Traceback (most recent call last): File /usr/lib/python3.4/runpy.py, line 170, in _run_module_as_main __main__, mod_spec) File

[issue22200] Remove distutils checks for Python version

2014-08-14 Thread Aaron Meurer
Changes by Aaron Meurer asmeu...@gmail.com: -- nosy: +Aaron.Meurer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22200 ___ ___ Python-bugs-list

[issue22202] Function Bug?

2014-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thank you for the extensive examples, but I'm afraid this is not a bug. In your code, result is a local variable, which means it only exists inside the fib() function. When you try inspecting result, it fails because there is no global variable result. Try

[issue22202] Function Bug?

2014-08-14 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22202 ___ ___

[issue17390] display python version on idle title bar

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6d41f139709b by Terry Jan Reedy in branch '2.7': Issue #17390: Adjust Editor window title. Remove 'Python', move version to end. http://hg.python.org/cpython/rev/6d41f139709b New changeset ba141f9e58b6 by Terry Jan Reedy in branch '3.4': Issue

[issue17390] display python version on idle title bar

2014-08-14 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- resolution: - fixed stage: test needed - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17390 ___

[issue22195] Make it easy to replace print() calls with logging calls

2014-08-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is easy enough to do, I posted about it in 2009 here I know it's easy. It's still annoying to have to write such boilerplate by hand (especially when everyone ends up rewriting the exact same one). -- ___

[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-08-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am working on backporting the #10291 patch and re-synchronizing 3.4 and 3.5 so revised version of this patch, including help change, and of #22065 patch can merge forward properly. -- ___ Python tracker

[issue10291] Clean-up turtledemo in-package documentation

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7708f80940b0 by Terry Jan Reedy in branch '3.4': Issue #10291: Backport 004fe3449193 with a few changes due to 22095. http://hg.python.org/cpython/rev/7708f80940b0 New changeset 68902ee48985 by Terry Jan Reedy in branch 'default': Issue #10291:

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4349bbc21ca7 by Terry Jan Reedy in branch 'default': Issue #22065: forward port the changes in c26862955342, update docstring with http://hg.python.org/cpython/rev/4349bbc21ca7 -- nosy: +python-dev ___

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 59cc3bfdac4b by Terry Jan Reedy in branch 'default': Issue #22065: Try the delete demohelp.txt part again. http://hg.python.org/cpython/rev/59cc3bfdac4b -- ___ Python tracker rep...@bugs.python.org

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- Removed message: http://bugs.python.org/msg225333 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22065 ___

[issue22053] turtledemo: clean up start and stop, fix warning

2014-08-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: After backporting 004fe3449193 (#10921 3.5 patch) with changes as 7708f80940b0, forward port to 3.5 the 3.4 patch c26862955342 that did not merge before. The 3.4 and 3.5 files are identical. Misdirected changeset notices: New changeset 4349bbc21ca7 by Terry

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- Removed message: http://bugs.python.org/msg225332 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22065 ___

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: The two misdirected and unlinked changeset notices belong to #22053. (Not completely off, as they synchronize 3.4 and 3.5 so I can start work on this.) -- ___ Python tracker rep...@bugs.python.org

[issue22053] turtledemo: clean up start and stop, fix warning

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5aa3f4863dda by Terry Jan Reedy in branch '3.4': #22053: actually remove .txt files from 3.4. http://hg.python.org/cpython/rev/5aa3f4863dda -- ___ Python tracker rep...@bugs.python.org

[issue22195] Make it easy to replace print() calls with logging calls

2014-08-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is a recurring problem. I concur with Antoine that there needs to be logging functions that are harmonized with print(). -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org

[issue22203] inspect.getargspec() returns wrong spec for builtins

2014-08-14 Thread Alexander Schepanovski
New submission from Alexander Schepanovski: inspect.getargspec() returns empty ArgSpec for map() and filter(): import inspect inspect.getargspec(map) ArgSpec(args=[], varargs=None, keywords=None, defaults=None) inspect.getargspec(filter) ArgSpec(args=[], varargs=None,

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 39c67beb483a by Terry Jan Reedy in branch '3.4': Issue #22065: Update turtledemo menu creation; don't use obsolete Menubutton. http://hg.python.org/cpython/rev/39c67beb483a -- ___ Python tracker

[issue22198] Odd floor-division corner case

2014-08-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: ideally, a floating-point operations works as though the corresponding mathematical operation were performed exactly on the inputs (considered as real numbers), followed by a rounding step that takes the resulting real number and rounds it to the

[issue22193] Add _PySys_GetSizeOf()

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This was discussed in issue15490. Such implementation is just incorrect, because we cannot allocate such much memory. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22193

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: The changes to help menu creation in #22053 required hand patching of the last chunk, but that was pretty easy. The code definitely looks better for the change. After pushing, I compared the look to 2.7. The first letters are not underlined, but Alt-first

<    1   2