[issue16469] Exceptions raised by Fraction() from those raised by int()

2012-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: Certainly TypeError seems inappropriate here, and using ValueError for conversions from NaN sounds good to me. I'm not a big fan of the OverflowError for converting infinities to an integer: nothing's actually overflowed here. I think that should have been

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- title: Exceptions raised by Fraction() from those raised by int() - Exceptions raised by Fraction() different from those raised by int() ___ Python tracker rep...@bugs.python.org

[issue16157] Irrelevant references to Misc/News

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue affects only 3.3+ (see links above). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16157 ___ ___

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: The from_decimal method should be changed as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469 ___

[issue16465] dict creation performance regression

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As I understand, the new dict created on every call of function with keyword arguments. This slow down every such call about 0.1 µsec. This is about 10% of int('42', base=16). In the sum, some programs can slow down to a few percents. Direct comparison

[issue14373] C implementation of functools.lru_cache

2012-11-14 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373 ___ ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: To simplify the discussion and for issue resolution purposes, I propose that the discussion about large choices containers be divided into separate discussions for (1) changes that should be applied to all maintenance releases (i.e. bug fix changes), and (2)

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: (1) changes that should be applied to all maintenance releases (i.e. bug fix changes) This should instead read, (1) changes that should be applied to all maintenance releases (e.g. bug fix and/or documentation changes). --

[issue2333] Backport set and dict comprehensions

2012-11-14 Thread Yongzhi Pan
Yongzhi Pan added the comment: I think metal means that the different ways set is repr'd in 2.7 and 3. In 2.7: In [9]: a = {x for x in 'abracadabra' if x not in 'abc'} In [10]: repr(a) Out[10]: set(['r', 'd']) In 3.2: In [6]: a = {x for x in 'abracadabra' if x not in 'abc'} In [7]: repr(a)

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469 ___ ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: The code could simply use the str or repr of the choice object It seems to me that this would result in less user-friendly behavior in many cases. It would also require the end-user to understand Python (e.g. xrange and dictionaries), which I don't think

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: I talked to a bunch of people (n=7) here at the company where I also give Python courses from time to time. I asked them two questions: 1. Is this behavior of FD what you would expect? 2. Given the current behavior of FD, what use cases do you see? The

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: Zitat von Tom Pohl rep...@bugs.python.org: This is not: 1 // 0.1 = 9.0 because math.floor(1/0.1) is able to come up with the result that is expected from an operator called floor division. You apparently assume that it is possible to give a definition

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: I believe that definining x//y as math.floor(x/y) is also confusing in other cases (without being able to construct such cases right away). In addition, defining x//y as math.floor(x / y) would break its connection with %: a key invariant is that (x //

[issue16460] Strange results for floor division (//) with non-integer divisors

2012-11-14 Thread Tom Pohl
Tom Pohl added the comment: Mark, thanks for explaining the connection of // and %. Finally, I can see why somebody would want to stick to the current behavior of FD. It renders FD useless for all of my use cases, but there are simple alternatives. Thanks for your time, Tom --

[issue16471] upgrade to sphinx 1.1

2012-11-14 Thread Chris Jerdonek
New submission from Chris Jerdonek: This issue is to upgrade Python's Sphinx from version 1.0 to 1.1. I don't already see an issue for this, and I'm not sure what upgrading entails. Personally, I'm interested in the enhanced indexing capabilities, e.g. the see and seealso entry types, as well

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469 ___ ___

[issue14373] C implementation of functools.lru_cache

2012-11-14 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373 ___ ___

[issue16471] upgrade to sphinx 1.1

2012-11-14 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +eric.araujo, ezio.melotti, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16471 ___

[issue16465] dict creation performance regression

2012-11-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: As I understand, the new dict created on every call of function with keyword arguments. This slow down every such call about 0.1 µsec. This is about 10% of int('42', base=16). Ok, but `int('42', base=16)` is about the fastest function call with keyword

[issue16378] venv.EnvBuilder docstring inconsistencies

2012-11-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset afb476dc202f by Vinay Sajip in branch '3.3': Issue #16378: Updated docstrings to reflect the defaults present in the code. http://hg.python.org/cpython/rev/afb476dc202f New changeset 6f0e49ed0589 by Vinay Sajip in branch 'default': Closes #16378:

[issue16465] dict creation performance regression

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ok, but `int('42', base=16)` is about the fastest function call with keyword arguments one can think about :-) Not as fast as a call without keywords, `int('42', 16)`. :-( But this is a different issue. -- ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread R. David Murray
R. David Murray added the comment: I agree with Chris that using the repr in the general case would be a regression in usability for the end user (and certainly not suitable for a maintenance release). Here is some brainstorming: We could special case this via duck typing. If the object

[issue8400] zipimporter find_module fullname mis-documented

2012-11-14 Thread Te-jé Rodgers
Te-jé Rodgers added the comment: Disregard the last...error on my part (so embarrassing!) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8400 ___

[issue8400] zipimporter find_module fullname mis-documented

2012-11-14 Thread Te-jé Rodgers
Te-jé Rodgers added the comment: It gets worse. Even though find_module works with the path separator, load_module fails. zi.find_module(lib\\ui) zipimporter object dist/Test_Editor-1.0-py3.2.zip zi.load_module(lib\\ui) Traceback (most recent call last): File stdin, line 1, in module

[issue16465] dict creation performance regression

2012-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a really simple patch. It speed up to 1.9x an empty dict creation (still 1.6x slower than 3.2). Make your measurements of real-world programs. -- keywords: +patch stage: - patch review Added file:

[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-11-14 Thread Václav Šmilauer
Václav Šmilauer added the comment: Martin, I know it is not a proper fix. OTOH, Python is not the only project which recommends its header be included as first. I don't know if it is an issue for Python 3.x; will try to test that. This bug, though, is clearly reported about Python 2.7, which

[issue16472] Distutils+mingw links agains msvcr90, while python27.dll is linked agains msvcrt

2012-11-14 Thread Václav Šmilauer
New submission from Václav Šmilauer: Compiling an extension with --compiler=mingw32 with official python 2.7.3 distribution on Windows (64bit) leads to unusable result - crash on module load (invalid access to memory). The reasons is that Lib/distutils/cygwincompiler.py#l62 links the

[issue16472] Distutils+mingw links agains msvcr90, while python27.dll is linked agains msvcrt

2012-11-14 Thread Ralf Schmitt
Changes by Ralf Schmitt python-b...@systemexit.de: -- nosy: +schmir ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16472 ___ ___ Python-bugs-list

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: The description of OverflowError is that is is raised when the result of an arithmetic operation is too large to be represented, so it doesn't actually need to overflow. Still, I see that ∞ actually isn't too large to be represented (and the documentation

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Tim Golden
Changes by Tim Golden m...@timgolden.me.uk: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16458 ___ ___ Python-bugs-list

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Tim Golden
Tim Golden added the comment: On 13/11/2012 20:57, Karthk Rajagopalan wrote: I added test case using perl and python since it was easy to reproduce using perl socket module and show the issue happening with python's subprocess.py. There is definitely an action required in subprocess.py to

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Karthk Rajagopalan
Karthk Rajagopalan added the comment: Hi Tim, Thanks for your reply. Yes, DuplicateHandle(..) seem to fail if the handle is to a socket under XP SP3. Can you point me to the guidelines about submitting patch so I can merge my change in main branch and upload it? We build python from

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Tim Golden
Tim Golden added the comment: Start here: http://docs.python.org/devguide/ In particular: http://docs.python.org/devguide/patch.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16458

[issue16468] argparse only supports iterable choices

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: For the record, choices types implementing only __contains__ never worked in any cases. (I should have said ArgumentParser.add_argument() raises a ValueError in the above.) So I wonder if we should classify this as an enhancement and simply document the

[issue16400] update default PyPI behavior in docs re: listing versions

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: Martin, can you confirm that PyPI's behavior is as described in the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16400 ___

[issue16290] PyComplex_AsCComplex should allow __complex__ to return float.

2012-11-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 399e59ad0a70 by Mark Dickinson in branch 'default': Issue #16290: __complex__ must now always return an instance of complex. http://hg.python.org/cpython/rev/399e59ad0a70 -- nosy: +python-dev ___ Python

[issue16290] PyComplex_AsCComplex should allow __complex__ to return float.

2012-11-14 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16290 ___

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Chris Jerdonek
Chris Jerdonek added the comment: For maintenance releases, I think I would favor abbreviating the list only if it is lossless (e.g. for xrange objects). I think I would also be okay with abbreviating for arbitrary xranges -- in particular for arbitrary steps. For example, for xrange(0, 50,

[issue16400] update default PyPI behavior in docs re: listing versions

2012-11-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: +1, that's all correct. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16400 ___ ___ Python-bugs-list mailing

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-14 Thread Case Van Horsen
Case Van Horsen added the comment: Do we also want to change int(infinity) to return ValueError? I think consistent behavior between int() and Fraction() is valuable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469

[issue16465] dict creation performance regression

2012-11-14 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16465 ___ ___ Python-bugs-list mailing list

[issue16468] argparse only supports iterable choices

2012-11-14 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16468 ___ ___ Python-bugs-list mailing

[issue12907] Update test coverage devguide page

2012-11-14 Thread Brett Cannon
Brett Cannon added the comment: Committed in dac396a730e4 -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12907

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree that my extreme, strawman-ish, proposal, was, well, too extreme. Here is a more realistic proposal similar to David's. if isinstance(choices, range) and len(choices) 50: choice_txt = range_rep(choices) # details to be determined try: choice_txt =

[issue16465] dict creation performance regression

2012-11-14 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Antoine, I would consider this a performance regression to solve for 3.3.1. Small dictionary creation is everywhere in CPython. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16465

[issue16468] argparse only supports iterable choices

2012-11-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: If the assumption of iterability is in more than just the help and error messages, then I can see the point of calling this an enhancement. I suspect that now, if a custom subset of ints or strings is the actual domain, people just skip choices and add custom

[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: I see that in #16468, Chris proposes that existing versions should let the TypeError propagate, possibly with an improved error message, and call the use of repr for non-iterables a new feature (partly on the basis that more fixes than this are needed to use

[issue16465] dict creation performance regression

2012-11-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Antoine, I would consider this a performance regression to solve for 3.3.1. Small dictionary creation is everywhere in CPython. Again, feel free to provide real-world benchmark numbers proving the regression. I've already posted some figures. --

[issue16458] subprocess.py throw The handle is invalid error on duplicating the STD_INPUT_HANDLE

2012-11-14 Thread Gregory P. Smith
Gregory P. Smith added the comment: Sorry I can't help on the windows side of things. I don't have access to any windows systems. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16458 ___

[issue16400] update default PyPI behavior in docs re: listing versions

2012-11-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2d266ce80712 by Chris Jerdonek in branch '3.2': Update the description of which package versions PyPI displays (issue #16400). http://hg.python.org/cpython/rev/2d266ce80712 New changeset ec037316a445 by Chris Jerdonek in branch '3.3': Merge from

[issue16400] update default PyPI behavior in docs re: listing versions

2012-11-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7db2a27c07be by Chris Jerdonek in branch '2.7': Backport from 3.2: update PyPI docs regarding listing versions (issue #16400). http://hg.python.org/cpython/rev/7db2a27c07be -- ___ Python tracker

[issue16400] update default PyPI behavior in docs re: listing versions

2012-11-14 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16400 ___

[issue16312] New command line option supported by unittest.main() for running initialization code before tests

2012-11-14 Thread Piotr Dobrogost
Piotr Dobrogost added the comment: But I think Piotr's use case is when you download some new library (...) Yes, indeed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16312 ___

[issue10966] eliminate use of ImportError implicitly representing SkipTest

2012-11-14 Thread Brett Cannon
Brett Cannon added the comment: Here is a new patch which removes the expected skips stuff and adds a required_on argument to test.support.import_module() for those cases where missing a module is an error (in the patch it's _winreg on Windows). If people are fine with this cleanup then the

[issue992389] attribute error due to circular import

2012-11-14 Thread Richard Oudkerk
Richard Oudkerk added the comment: In Torsten's example from . import moduleX can be replaced with moduleX = importlib.import_module('.moduleX', __package__) (*) or moduleX = importlib.import_module('package.moduleX') If that is not pretty enough then perhaps the new

[issue16473] Minor difference in decoding quoted-printable text

2012-11-14 Thread Alejandro Javier Peralta Frías
New submission from Alejandro Javier Peralta Frías: New to python-dev; I grab a beginner tasks increase test coverage and I decided to add coverage to this bit of code in the quopri module: # quopri.py L138while n 0 and line[n-1:n] in b \t\r: L139n = n-1 As far

[issue16473] Minor difference in decoding quoted-printable text

2012-11-14 Thread Alejandro Javier Peralta Frías
Changes by Alejandro Javier Peralta Frías apera...@machinalis.com: -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16473 ___

[issue16473] Minor difference in decoding quoted-printable text

2012-11-14 Thread R. David Murray
R. David Murray added the comment: I think I can answer your last question. There are two quopri algorithms, one where spaces are allowed (message body) and one where they aren't (email headers). For the rest, I'd have to take a closer look than I have time for right now. --

[issue16473] Minor difference in decoding quoted-printable text

2012-11-14 Thread Alejandro Javier Peralta Frías
Alejandro Javier Peralta Frías added the comment: I think I can answer your last question. There are two quopri algorithms, one where spaces are allowed (message body) and one where they aren't (email headers). OK, thank you. Good to know. --

[issue16473] Minor difference in decoding quoted-printable text

2012-11-14 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16473 ___ ___ Python-bugs-list mailing list

[issue7083] locals() behaviour differs when tracing is in effect

2012-11-14 Thread Ned Batchelder
Ned Batchelder added the comment: I wrote about this here: http://nedbatchelder.com/blog/201211/tricky_locals.html A reader suggested this addition to the docs, which I like: Multiple invocations within the scope update and return the same dictionary instance. When a trace function is in

[issue16474] More code coverage for imp module

2012-11-14 Thread alejandro david weil
New submission from alejandro david weil: Add some 5% more code-coverage for imp module in tests. -- components: Tests files: imp_test_patch.diff keywords: patch messages: 175597 nosy: brett.cannon, tenuki priority: normal severity: normal status: open title: More code coverage for imp

[issue16474] More code coverage for imp module

2012-11-14 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Not sure increasing test coverage would be tolerated in 3.3.1. I would be +1 to it. -- nosy: +jcea versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16474

[issue16472] Distutils+mingw links agains msvcr90, while python27.dll is linked agains msvcrt

2012-11-14 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +brian.curtin, loewis, mhammond, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16472 ___

[issue16470] Backport set and dictionary comprehensions in tutorial to 2.7

2012-11-14 Thread Éric Araujo
Éric Araujo added the comment: Good idea. Could you add a note that this is new in 2.7? (Either using versionadded Sphinx directives or just remarks in plain English, not sure which one would be best.) -- nosy: +eric.araujo ___ Python tracker

[issue16470] Backport set and dictionary comprehensions in tutorial to 2.7

2012-11-14 Thread Georg Brandl
Georg Brandl added the comment: We don't use versionadded/changed directives in the tutorial. (There was only one until 2 minutes ago, which was misplaced in any case.) -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org

[issue16474] More code coverage for imp module

2012-11-14 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16474 ___ ___ Python-bugs-list