[issue20481] Clarify type coercion rules in statistics module

2014-02-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: Wolfgang, Thanks for the patch, I have some concerns about it, but the basic idea does look reasonable. However, I've been convinced that supporting mixed types at all needs more careful thought. Under the circumstances, I'm more concerned ab

[issue20481] Clarify type coercion rules in statistics module

2014-02-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Attached is a patch which: - documents that mixed types are not currently supported; - changes the behaviour of _sum to raise TypeError on mixed input types (mixing int and is allowed, but nothing else); - updates the tests; - adds some document

[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Fix as suggested by Nick, and new test. -- keywords: +patch Added file: http://bugs.python.org/file33983/counter.patch ___ Python tracker <http://bugs.python.org/is

[issue20561] Decimal handling error in statistics module

2014-02-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Feb 08, 2014 at 11:29:29AM +, Stefan Krah wrote: > This looks like a duplicate of #20536. Steven, do you think you > have a chance to fix this before rc1? Working on it now. Should have a patch and regression tests in 15 minutes, I&#x

[issue20536] statistics._decimal_to_ratio() produces non-integer ratio

2014-02-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: See also issue 20561, which is a duplicate of this. Fix and tests for this in the attached patch. Could somebody please commit it for me, my ssh key apparently hasn't been registered yet. -- assignee: -> stevenjd keywords: +patch

[issue20761] os.path.join doesn't strip LF or CR

2014-02-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: > LF or CR cannot be part of a URI But they can be part of a filename, at least on POSIX systems. Are you proposing that only the Windows version of os.path.join strip LF/CR? I don't think that it up to the join function to validate the path, a

[issue20745] test_statistics fails in refleak mode

2014-02-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't know how to interpret this. Where can I find out more about refleak mode? Thanks. -- ___ Python tracker <http://bugs.python.o

[issue20792] IDLE: Extend tests for PathBrowser

2014-02-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think you may have misread PEP 8. It does not recommend a trailing underscore for names that shadow built-ins (e.g. file_ instead of file), it only recommends a trailing underscore when you need to use a keyword as a name (e.g. class_ instead of

[issue20902] Which operand is preferred by set operations? Missing information in the documentation

2014-03-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: If this is undefined, and I think it should be, the docs should explicitly say so. How is this? The union and intersection operations select elements which appear in both operands, e.g. set([a, b, c]) & set([c, d, e]) returns set([c]). The sele

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-28 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +stevenjd ___ Python tracker <http://bugs.python.org/issue3366> ___ ___ Python-bugs-list mailing list Unsubsc

[issue7016] .pyc files are set executable if the .py file is too

2009-09-28 Thread Steven D'Aprano
New submission from Steven D'Aprano : In Python 2.6, .pyc files inherit the executable bit from their .py file. This can lead to strangeness: $ echo pass > test.py $ chmod u+x test.py $ python2.6 -c "import test" $ ls -l test.pyc -rwxrw-r-- 1 steve steve 94 2009-09

[issue5361] Obsolete mispelled in string formatting docs

2009-02-24 Thread Steven D'Aprano
New submission from Steven D'Aprano : The table of string formatting conversions has a mispelling: http://docs.python.org/library/stdtypes.html#string-formatting 'u' Obselete type – it is identical to 'd'. Should be "Obsolete". -- assignee: geo

[issue1714448] if something as x:

2009-03-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: What's wrong with this? ob = map[x][y].overpay if ob: ob.blit(x, y) Is this proposal just about saving one line? If we allow this, how many of the following will be allowed? if expr as name: while expr as name: expr as name # alternativ

[issue1714448] if something as x:

2009-03-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Regarding the proposed syntax: if (f() == 'spam') -> name: newname = name.replace('p', 'h') Surely that should assign the *bool* result of comparing f() with 'spam' to name? Doing anything else is opening

[issue1714448] if something as x:

2009-03-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Matthew suggested ~= instead of -> or "as". I dislike this because ~= first makes me think of "approximately equal to", and then it makes me think of augmented assignment, and only then do I remember that although ~ is used in P

[issue5789] powerset recipe listed twice in itertools docs

2009-04-18 Thread Steven D'Aprano
New submission from Steven D'Aprano : In the itertools recipes section of the docs, powerset() is listed twice. http://docs.python.org/library/itertools.html#recipes -- assignee: georg.brandl components: Documentation messages: 86155 nosy: georg.brandl, stevenjd severity: n

[issue5790] itertools.izip python code has a typo

2009-04-18 Thread Steven D'Aprano
New submission from Steven D'Aprano : In the documentation for itertools, the Python equivalent to izip has a typo: yield yield tuple(map(next, iterables)) Obviously should only have a single yield. http://docs.python.org/library/itertools.html#itertools.izip -- ass

[issue6017] Dict fails to notice addition and deletion of keys during iteration

2009-05-13 Thread Steven D'Aprano
New submission from Steven D'Aprano : I'm not sure if this is a documentation bug or a behaviour bug, or possibly both. The documentation warns about adding or deleting items from a dict while iterating over it: "Using iteritems() while adding or deleting entries in the d

[issue6017] Dict fails to notice addition and deletion of keys during iteration

2009-05-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree with Terry Reedy. I'm re-opening it as a documentation bug (if I can -- if I can't, I'll just request somebody who can do so). -- components: -Interpreter Core status: closed -> open ___

[issue6017] Dict fails to notice addition and deletion of keys during iteration

2009-05-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: With respect Georg, given that the behaviour won't be changed, the documentation is simply *wrong*. It's not a matter of telling people "don't do this" -- somebody, somewhere, is going to rely on the documented behaviour. T

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2016-12-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: I had a brief look at the source for ABCMeta, and it seems to me that the __module__ behaviour is coming from `type`. I'm not sure whether it can, or should, can be fixed in type, but I think that the correct behaviour for ABCMeta is to set __modul

[issue28880] range(i, j) doesn't work

2016-12-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi John, and thanks for the bug report. If only they were all as easily resolved as this one :-) With respect, if you're just getting started with Python, you shouldn't get into the habit of hitting the bug tracker every time you find

[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Dec 13, 2016 at 09:35:22AM +, Srikanth Anantharam wrote: > > Srikanth Anantharam added the comment: > > A better choice would be to return a tuple of values (sliced from the > table). And let the user decide which one to us

[issue13290] get vars for object with __slots__

2016-12-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: I independently raised this on Python-Ideas and the initial responses are that vars() should support objects with slots too. https://mail.python.org/pipermail/python-ideas/2016-December/043965.html -- nosy: +steven.daprano versions: +Pytho

[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Dec 13, 2016 at 10:08:10AM +, Srikanth Anantharam wrote: > Please see the updated pull request PR 50, with the changes. I'm rejecting that pull request. As I said, mode() intentionally returns only the single, unique mode. I m

[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Dec 13, 2016 at 10:17:21AM +, Srikanth Anantharam wrote: > > Srikanth Anantharam added the comment: > > @steven: > > data = [1, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9] > is clearly unimodal with mode 8

[issue29018] Misinformation when showing how slices work in The Tutorial

2016-12-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: You haven't given any reason to explain why you think the existing docs are wrong, nor any reason why you think your version is better. Just stating that the docs give "misinformation" is not good enough. By your matrix, 'Python&#

[issue29061] secrets.randbelow(-1) hangs

2016-12-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: > _randbelow is a private api and it is not broken, it is just being > misused by the secrets module. "Misused" seems a bit strong. Should I understand that you dislike the wrapper around _randbelow? The implementation was given in

[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-16 Thread Steven D'Aprano
New submission from Steven D'Aprano: argparse help incorrectly breaks long lines on U+u00A0 NO-BREAK SPACE. The attached script has been run on Python 3.5.3rc1 in a terminal window 80 columns wide, and it produces output:: usage: argparse_nobreak.py [-h] [--no-condensed] opt

[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-16 Thread Steven D'Aprano
Changes by Steven D'Aprano : Removed file: http://bugs.python.org/file46310/argparse_nobreak.py ___ Python tracker <http://bugs.python.org/issue29290> ___ ___ Pytho

[issue29290] argparse breaks long lines on NO-BREAK SPACE

2017-01-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here's a slightly simpler demo, without the (fortunately harmless) typo. -- Added file: http://bugs.python.org/file46311/argparse_nobreak.py ___ Python tracker <http://bugs.python.o

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Jan 29, 2017 at 08:23:05AM +, Martin Panter wrote: > Why do you name the methods is_finite() etc with underscores, when the > existing methods math.isfinite() etc do not have underscores? Seems it > would add unnecessary confusion.

[issue29388] regex mismatch in the simple cases

2017-01-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: re.match only matches at the start of the string. If you use re.search instead, you will get the results you are expecting. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: ope

[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Serhiy, that doesn't generalise to code like: any(a, b, c, *extras) which is hard to write out by hand. You would have to say bool(a or b or c or any(extras)) I think this might be worth considering on Python-Ideas. It will probably be

[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Do you think I should send a mail to the ideas list? Personally, I don't think so. You want to write any(a, b, c, d), but you can get the same effect now by writing any([a, b, c, d]). There is unlikely to be any significant performan

[issue12741] Add function similar to shutil.move that does not overwrite

2017-02-08 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/issue12741> ___ ___ Python-bugs-list mailing list Unsubscr

[issue12741] Add function similar to shutil.move that does not overwrite

2017-02-08 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- versions: +Python 3.7 -Python 3.3 ___ Python tracker <http://bugs.python.org/issue12741> ___ ___ Python-bugs-list m

[issue29506] Incorrect documentation for the copy module

2017-02-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: What about "administrative data structures" that should be copied? I think that "administrative data structures" is a red herring: there could be data that needs copying, and data that needs sharing and shouldn't be copied, i

[issue29511] Add 'find' as build-in method for lists

2017-02-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Only 3.7 can receive new functionality. Here is a pure Python implementation of a subsequence test: https://code.activestate.com/recipes/577850-search-sequences-for-sub-sequence/ It appears to be reasonably popular on Activestate: it has about 7000

[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

2017-02-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree with Josh: the exception you are giving doesn't seem possible with the code snippet shown. Please COPY AND PASTE (not a screen shot) the text of the entire traceback, starting with the line "Traceback..." I suspect that you m

[issue29511] Add 'find' as build-in method for lists

2017-02-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Terry, I'm not sure if you've read this enhancement request correctly or not, because your reply when closing covers over a lot of detail which is not relevant to this feature request. > Extending this idea to 'subsequence in sequenc

[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Confirmed that in Python 2.7 calling g() before and after modifying the dict prints 3 both times; calling g() before modifying the dict prints 3, then after modifying it prints 5. Python 3.3 behaves like 2.7, so this sounds like a regression in 3.5 or

[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-19 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/issue29602> ___ ___ Python-bugs-list mailing list Unsubscr

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: I am unable to replicate this in Python 2.7, 3.3 or 3.6. I haven't bothered to test against other versions, because I think that this is a PyShell issue, not a Python issue. (I think you are using PyShell, based on the traceback given.) Before repo

[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

2016-05-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, May 30, 2016 at 01:43:22AM +, ppperry wrote: > steven.daprano, you don't appear to have properly read the issue > comments. Ack; I saw your comment about the metaclass, then saw your retraction of the metaclass issue, then mis

[issue27176] Addition of assertNotRaises

2016-06-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Yes. What does such an assertion actually mean? Why would I write `self.assertNotRaises(ValueError, spam, arg)` rather than just call `spam(arg)`? The only difference is that assertNotRaises will treat one specific exception as a test failure rather t

[issue27181] Add geometric mean to `statistics` module

2016-06-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Jun 02, 2016 at 09:04:54PM +, Raymond Hettinger wrote: > Steven, this seems like a reasonable suggestion (though I would expect > someone else will immediately suggest a harmonic mean as well). Is > this within the scope of what y

[issue27228] just for clearing: os.path.normpath("file://a") returns "file:/a"

2016-06-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: "file://a" is a valid relative file path, for a directory called "file:" and a file called "a", so normpath should return "file:/a". -- nosy: +steven.daprano ___ Pytho

[issue27234] tuple - single value with comma is assigned as type tuple

2016-06-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: Yes, it is intended. Commas create tuples, not parentheses. (With the exception of the empty tuple.) The parens are just for grouping and precedence. `1,` is a tuple, regardless of whether you use parens around it or not. -- nosy: +steven.da

[issue27181] Add geometric mean to `statistics` module

2016-06-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Jun 09, 2016 at 09:24:04AM +, Mark Dickinson wrote: > On the other hand, apparently `exp(mean(log(...)))` is good enough for SciPy: Hmm, well, I don't have SciPy installed, but I've found that despite their (well-deserved) repu

[issue27288] secrets should use getrandom() on Linux

2016-06-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't want to start another huge thread on python-dev unless really necessary. What should happen to random.SystemRandom? (1) nothing, it stays as it is, and if ``secrets`` needs better, it can subclass it; (2) it changes to use ``os.getrandom``

[issue27293] Summarize issues related to urandom, getrandom etc in secrets documentation

2016-06-11 Thread Steven D'Aprano
New submission from Steven D'Aprano: Write some documentation for the ``secrets`` module summarizing the issues relating to /dev/[u]random, getrandom, etc. There's a lot of confusion about these issues, and the web contains a lot of misinformation, so being able to point to the se

[issue27292] Warn users that os.urandom() can return insecure values

2016-06-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Relevant: issue #27293 (I've taken the liberty of subscribing those on this issues nosy list to the new issue, I hope that's okay) -- nosy: +steven.daprano ___ Python tracker <http://bugs.pyt

[issue27139] Increased test coverage for statistics.median_grouped

2016-06-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks Julio, I hope to get to this over the next week. Please feel free to prod me if you see no action by then. -- ___ Python tracker <http://bugs.python.org/is

[issue27335] Clarify that writing to locals() inside a class body is supported

2016-06-16 Thread Steven D'Aprano
New submission from Steven D'Aprano: The docs for locals() warn not to write to the dict returned, as it may not have the intended effect of modifying the actual variables seen by the interpreter. https://docs.python.org/3/library/functions.html#locals But as I understanding it, using l

[issue27353] Add nroot function to math

2016-06-19 Thread Steven D'Aprano
New submission from Steven D'Aprano: For Issue27181 (add geometric mean to statistics module), I need a function to calculate nth roots that is more accurate than pow(x, 1/n). E.g. math.pow(1000, 1/3) returns 9.998 instead of 10.0. I have a pure-Python implementation of

[issue27353] Add nroot function to math

2016-06-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: I suggested on python-ideas that the math module be given a pure-Python front end. Guido wasn't too keen on that idea, so I won't push for it. He did agree that having nroot in math was a reasonable idea. If I attach a pure Python implement

[issue27362] json.dumps to check for obj.__json__ before raising TypeError

2016-06-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: For starters, dunder names like __json__ are reserved for Python's own use, so you would have to get the core developers to officially bless this use. But... I'm not really sure that "the responsibility of determining how an object shou

[issue27353] Add nroot function to math

2016-06-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Jun 20, 2016 at 09:02:09PM +, Tim Peters wrote: > Note that the very popular TI graphics calculators have had a distinct > nth-root function at least since the TI-83. It's a minor convenience > there. Likewise HP calculato

[issue27439] product function patch

2016-07-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Jul 02, 2016 at 11:40:48AM +, Utkan Gezer wrote: > > New submission from Utkan Gezer: > > An issue of enhancement by the introduction of a built-in product() > function for the multiplication operation, functions similar to

[issue27440] Trigonometric bug

2016-07-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: I know this issue is closed, but for future reference, ShubhamSingh.er, if you submit any further bug reports, please don't submit screen shots unless necessary. Just copy and paste the text from your terminal into the issue tracker. A screen sh

[issue27459] unintended changes occur when dealing with list of list

2016-07-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Zhihan Chen, I see this issue is closed, but for future reference please don't post screenshots to report issues unless they are really needed. For text output, just copy the text from your terminal and paste it into your bug report. Making a s

[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

2016-07-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: I haven't studied your code in detail (I won't be qualified to judge it) but I notice this comment: /* Hit the faster unicode_concatenate method if and only if all the following conditions are true: 1. The left operand is a unic

[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: The behaviour of both are correct: the binary float nearest to 4.4 is just a smidgen *bigger* than the exact decimal 4.4, so 44//4.4 truncates to 9.0. But floor(44/4.4) evaluates 44/4.4 first, and that rounds rather than truncating, giving 10.0, which

[issue27181] Add geometric mean to `statistics` module

2016-07-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Does anyone have any strong feeling about the name for these functions? gmean and hmean; geometric_mean and harmonic_mean And "subcontrary_mean" is not an option :-) -- ___ Python tracker <http

[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Raymond, that was a fantastic explanation. Would you be willing to turn it into a FAQ? Or if you don't have the time, to allow somebody to steal your description and use it? -- nosy: +steven.daprano

[issue27573] code.interact() should print an exit message

2016-07-19 Thread Steven D'Aprano
New submission from Steven D'Aprano: Way too often I've lost track of whether I'm in the code.interact() REPL or the original REPL, or hit Ctrl-D once too often, and accidentally quit the real REPL. It is easy to lose track, since the real and imitation REPL both use the sa

[issue27573] code.interact() should print an exit message

2016-07-19 Thread Steven D'Aprano
Changes by Steven D'Aprano : Removed file: http://bugs.python.org/file43791/code.patch ___ Python tracker <http://bugs.python.org/issue27573> ___ ___ Python-bugs-l

[issue27573] code.interact() should print an exit message

2016-07-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: This time, with a patch that includes updated tests. -- Added file: http://bugs.python.org/file43793/code.patch ___ Python tracker <http://bugs.python.org/is

[issue27605] Inconsistent calls to __eq__ from built-in __contains__

2016-07-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm reluctant to call this a behaviour bug, because I'm reluctant to guarantee the *precise* behaviour when the classes are different. I haven't checked the source of dict.__contains__, but by experimentation it seems that: needle in

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano
New submission from Steven D'Aprano: As reported here: https://mail.python.org/pipermail/python-list/2016-July/711333.html there's a possible annoyance with getopt when you accidentally leave whitespace on a long option. On my Centos system, getopt ignores leading and trailing whi

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks for the quick review, I've fixed the issues you mentioned. -- Added file: http://bugs.python.org/file43886/getopt.patch ___ Python tracker <http://bugs.python.o

[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Jul 26, 2016 at 04:50:33AM +, Serhiy Storchaka wrote: > My answer: if you don't want a space in your long_option, don't put a > space in there. There is no a bug in Python, That's why I listed it as an enhancement, n

[issue27621] incorrectly works in IDLE Query dialogs

2016-07-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: I expect that ESC should always cancel, and RETURN/ENTER should always accepts (OK or Save or whatever the "main" button is) regardless of where the focus is. If you want a keyboard shortcut to push the button with focus, use SP

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Serhiy Storchaka added the comment: > It makes Python getopt behave less like the C getopt. Exactly! If C getopt allows whitespace in long options, it's a GOOD thing to avoid such a poor design. Who would want a option --foo (note the t

[issue27619] getopt should strip whitespace from long arguments

2016-07-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Jul 26, 2016 at 03:27:29PM +, R. David Murray wrote: [...] > getopt is explicitly emulating the C getopt There are lots of differences between the C getopt and the Python version, and the Python version is described as offering an API &

[issue6422] timeit called from within Python should allow autoranging

2016-08-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Nick gave a +1 to my auto-range patch with callback on 2016-05-13, and there's been no negative feedback since. Should I go ahead and check it in for 3.6? -- ___ Python tracker <http://bugs.python.

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Your description is hard to understand, and doesn't give enough detail, but I *think* I can guess what you might be referring to. If you start with a really big integer, and divide, you get a float. But really big floats cannot represent every numb

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Converting n to an int Oops. Obviously I meant converting n *from* an int *to* a float. -- ___ Python tracker <http://bugs.python.org

[issue27181] Add geometric mean to `statistics` module

2016-08-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Aug 09, 2016 at 06:44:22AM +, Ram Rachum wrote: > For `geometric_mean`, maybe I'd add one sentence that describes > how the geometric mean is calculated. What do you mean? As in, the mathematical definition of geometric mean? Or d

[issue27739] add math.sign/signum

2016-08-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: If this is added, should this signum function be the two value version that returns 1 for zero, or the three value version that returns 0? Should it distinguish between signed zeroes +0.0 and -0.0? What should it do for NANs (raise, return a NAN, cop

[issue27181] Add geometric mean to `statistics` module

2016-08-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: I thought about special-casing n=2 to math.sqrt, but as that's an implementation detail I can make that change at any time. According to my testing, math.pow(x, 0.5) is no worse than sqrt, so I'm not sure if there's any advantage to havin

[issue27757] eval() does not allow import statements to run.

2016-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: That is not a bug, it is a feature. `eval` only evaluates *expressions*, not statements, and `import` is a statement. Neither of those is going to change. Starting in Python 3.1, you could use `import_module`: https://docs.python.org/3/library/importlib

[issue27757] eval() does not allow import statements to run.

2016-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Correction: `importlib.import_module` is also available in Python 2.7. -- ___ Python tracker <http://bugs.python.org/is

[issue27761] Private _nth_root function loses accuracy on PowerPC

2016-08-13 Thread Steven D'Aprano
New submission from Steven D'Aprano: First reported by Martin Panter here: http://bugs.python.org/issue27181#msg272488 I'm afraid I don't know enough about PowerPC to suggest a fix other than weakening the test on that platform. -- assignee: steven.daprano messag

[issue27761] Private _nth_root function loses accuracy on PowerPC

2016-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Tests fail on a Power PC buildbot: http://buildbot.python.org/all/builders/PPC64LE%20Fedora%203.x/builds/1476/steps/test/logs/stdio == FAIL: testExactPowers (test.test_statistics.Test_Nth

[issue27181] Add geometric mean to `statistics` module

2016-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've created a new issue to track the loss of accuracy on PowerPC: http://bugs.python.org/issue27761 -- ___ Python tracker <http://bugs.python.o

[issue27761] Private _nth_root function loses accuracy

2016-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Aug 14, 2016 at 08:29:39AM +, Mark Dickinson wrote: > Steven: can you explain why you think your code *should* be giving > exact results for exact powers? Do you have an error analysis that > says that should be the case? No error

[issue27761] Private _nth_root function loses accuracy

2016-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Aug 14, 2016 at 10:52:42AM +, Mark Dickinson wrote: > Same deal here: those aren't the actual errors; they're approximations > to the errors, since the computations of the epsilons depends on (a) > the usual floating-

[issue27761] Private _nth_root function loses accuracy

2016-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Aug 14, 2016 at 12:05:37PM +, Mark Dickinson wrote: > But I don't think there's a real problem here so long as you don't > have an expectation of getting super-accurate (e.g., correctly rounded > or faithfully r

[issue6422] timeit called from within Python should allow autoranging

2016-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Still to do (coming soon): - make the 0.2s time configurable; - have `timeit` and `repeat` methods (and functions) fall back on `autorange` if the number is set to 0 or None. -- assignee: -> steven

[issue27573] code.interact() should print an exit message

2016-08-14 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue27573> ___ __

[issue27573] code.interact() should print an exit message

2016-08-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Aug 18, 2016 at 08:19:25AM +, Armin Rigo wrote: > Can we make the exit message optional? Sure. What API do you prefer? I'm thinking to just give interact() an optional "exitmsg" argument, similar to banner: def interact(ban

[issue27813] When I assign for a item which list of single item

2016-08-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: For future reference, don't post screen shots. Copy and paste the text of your code and its output. You don't program with Photoshop, you program with a text editor. Screen shots make it impossible to copy the code, search for the tex

[issue27832] fractions.Fraction with 3 arguments: error passes silently

2016-08-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: At the risk of muddying the waters even further, I'd like to make _normalize a public parameter in Python 3.7. There's an interesting operation you can do with fractions, the mediant: https://en.wikipedia.org/wiki/Mediant_%28mathe

[issue27825] Make the documentation for statistics' data argument clearer.

2016-08-23 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- assignee: docs@python -> steven.daprano nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/issue27825> ___ _

[issue27573] code.interact() should print an exit message

2016-08-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Aug 18, 2016 at 12:26:56PM +, Armin Rigo wrote: > ...ah, upon closer inspection, we don't use the ``interact()`` method > anyway. We already copied and tweaked this method: one problem was > that it gives no way to run withou

[issue25564] Document that IDLE -python difference for `del __builtins__`

2016-08-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: Terry J. Reedy added the comment: > Steven: "You should use `__builtin__` in Python 2 and `builtins` in > Python 3." I presume this is for import statements. My understanding is that __builtins__ is intended to be for the privat

[issue27858] Add identity function to functools

2016-08-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: I had a work mate make this exact same point literally yesterday. He asked me if Python had an identity function, and when I suggested just using `lambda x: x` he grouched that this wasn't sufficiently obvious enough as "identity"

[issue27858] Add identity function to functools

2016-08-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Just in case anyone else thinks this is a good idea, here's a patch. -- keywords: +patch Added file: https://bugs.python.org/file44218/identity.patch ___ Python tracker <https://bugs.python.o

<    8   9   10   11   12   13   14   15   >