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

2014-08-14 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger priority: normal -> low ___ Python tracker ___ ___

[issue22192] dict_values objects are hashable

2014-08-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Do you want to submit a patch and tests? Also take a look at the collections.abc MappingViews. -- assignee: -> rhettinger nosy: +gvanrossum priority: normal -> low stage: -> needs patch ___ Python tracker

[issue20334] make inspect Signature hashable

2014-08-14 Thread Antony Lee
Antony Lee added the comment: The hash function of the Signature class is actually incompatible with the definition of Signature equality, which doesn't consider the order of keyword-only arguments: >>> from inspect import signature >>> s1 = signature(lambda *, x, y: None); s2 = signature(lamb

[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- works, a

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

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

[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

[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=N

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

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

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

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- Removed message: http://bugs.python.org/msg225332 ___ Python tracker ___ ___ Python-bugs-list mailing l

[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 : -- Removed message: http://bugs.python.org/msg225333 ___ Python tracker ___ ___ Python-bugs-list mailing l

[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

[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 ___ Py

[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: null

[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

[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). -- ___ Pyt

[issue17390] display python version on idle title bar

2014-08-14 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> fixed stage: test needed -> resolved status: open -> closed ___ Python tracker ___ ___

[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 #1739

[issue22202] Function Bug?

2014-08-14 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[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".

[issue22200] Remove distutils checks for Python version

2014-08-14 Thread Aaron Meurer
Changes by Aaron Meurer : -- nosy: +Aaron.Meurer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[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 "/usr/lib/python3.

[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 = log

[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 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/ma

[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 ___ _

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

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

2014-08-14 Thread Ismail Badawi
Changes by Ismail Badawi : -- nosy: +ismail.badawi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[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

[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 3.5.

[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

[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

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

[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

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

[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

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

[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

[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 #22193:

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

[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

[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

[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

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +tim.peters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue22198] Odd floor-division corner case

2014-08-14 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

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

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

2014-08-14 Thread Saimadhav Heblikar
Changes by Saimadhav Heblikar : -- nosy: +sahutd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

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

2014-08-14 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

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

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

2014-08-14 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: +BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

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

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

2014-08-14 Thread Antoine Pitrou
New submission from Antoine Pitrou: Often an application (or e.g. a library's test suite), in its early development, will start making print() calls, and later will want to switch to the logging module. However the logging module doesn't offer any facility for this: you can't print() to a logg

[issue22193] Add _PySys_GetSizeOf()

2014-08-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: LGTM -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing li

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

2014-08-14 Thread R. David Murray
R. David Murray added the comment: Added some review comments. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue22191] warnings.__all__ incomplete

2014-08-14 Thread Brett Cannon
Brett Cannon added the comment: Yes, please use separate patches attached to the appropriate bug. As for what should go into __all__, it's what is documented as the API of the module. As for tests, it doesn't hurt. =) -- ___ Python tracker

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

2014-08-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I suppose this takes advantage of the libc's optimized memchr(). Any benchmarks? (patch looks fine, by the way) -- ___ Python tracker ___ __

[issue22194] access to cdecimal / libmpdec API

2014-08-14 Thread Antoine Pitrou
New submission from Antoine Pitrou: Currently cdecimal exports no C API that I know of, and it makes sure the libmpdec symbols are kept private in the .so file. It would be nice for external C code (or, in general, non-Python code) to be able to access cdecimal objects, and make operations on

[issue22191] warnings.__all__ incomplete

2014-08-14 Thread Jon Poler
Jon Poler added the comment: Serhiy, should I submit these fixes as separate patches? E.g. one patch for the warnings module, and another for the socket module? More generally, should the items included in __all__ be derived from the items described in the documentation? For instance, only the

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

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which optimizes readline() and readlines() methods of BytesIO and the __next__() method of BytesIO iterator. -- Added file: http://bugs.python.org/file36369/bytesio_faster_readline.patch ___ Python

[issue22193] Add _PySys_GetSizeOf()

2014-08-14 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds private function _PySys_GetSizeOf(). It is needed for correct implementing of __sizeof__() methods: issue15490, issue15513, issue15381 (BytesIO.__sizeof__ is broken in 3.5). See discussion about it in issue15490. I extracted this patch

[issue22191] warnings.__all__ incomplete

2014-08-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue20689. socket.__all__ is incomplete too. -- nosy: +serhiy.storchaka ___ Python tracker ___ _

[issue22065] Update turtledemo menu creation

2014-08-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: # 3 on my list of patches to review and apply -- ___ Python tracker ___ ___ Python-bugs-list mailing