[issue26337] Bypass imghdr module determines the type of image

2016-02-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm sorry, I don't understand what you think is the bug here. It looks like you are passing a corrupted file which has a PNG extension but is not actually a PNG file (it contains PHP code). What do you expect should happen? -- nosy:

[issue26214] textwrap should minimize number of breaks in extra long words

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

[issue26002] make statistics.median_grouped more efficient

2016-02-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks good to me. I've run some quick timing tests, and for very small lists, there's no significant difference, but for larger lists I'm getting up to a 50% speedup. Nicely done, thank you. -- __

[issue26086] Bug in os module

2016-02-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't see any conclusive evidence that this is a bug in the Python interpreter, so I'm going to close the issue. Hana, if you are still having this problem, please join the main python mailing list https://mail.python.org/mailman/listinfo

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-02-12 Thread Steven D'Aprano
New submission from Steven D'Aprano: There are a few operations such as summing or unpacking infinite iterators where the interpreter can become unresponsive and ignore Ctrl-C KeyboardInterrupt. Guido suggests that such places should occasionally check for signals: https://mail.pytho

[issue26361] lambda in dict comprehension is broken

2016-02-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is the standard behaviour of closures in Python. It's annoying, and often not what you expect, but it's not a bug. Effectively, your dict or list contains five functions, each of which refer to the same variable "t". By the tim

[issue26369] doc for unicode.decode and str.encode is unnecessarily confusing

2016-02-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Perhaps you could suggest a specific change to the docstrings for str.encode and unicode.decode? (BTW, I presume you are aware that the equivalent of (bytes)str.encode and unicode.decode are gone in Python 3?) -- nosy: +steven.da

[issue26490] Leading “0” allowed, only for decimal zero

2016-03-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: This was raised and rejected here: http://bugs.python.org/issue24668 -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/is

[issue26596] numpy.all np.all .all

2016-03-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, but behaving correctly. You have: py> A = np.random.random((10,1)) py> np.all(A) True py> np.all(A) < 1 # is True less than 1? False which is correct: True is *not* less than 1. But True *is* less than 2: py> True <

[issue26597] Document how to cite Python

2016-03-20 Thread Steven D'Aprano
New submission from Steven D'Aprano: Add either a FAQ or a new page under "Meta Information" in the documentation for how to formally cite Python in scientific papers or other academic situations. See thread on Python-Ideas here for justification and further dis

[issue18844] allow weights in random.choice

2016-03-29 Thread Steven Basart
Steven Basart added the comment: Reopen this idea but removing the generator from weighted choice. -- nosy: +progressive-o Added file: http://bugs.python.org/file42322/weighted_choice_v3.diff ___ Python tracker <http://bugs.python.org/issue18

[issue18844] allow weights in random.choice

2016-03-29 Thread Steven Basart
Steven Basart added the comment: The entire function of weighted choice. I removed the generator and replaced it by adding an optional argument to specify an amount by which you want to call this function. -- Added file: http://bugs.python.org/file42323/weighted_choice_v3.patch

[issue18844] allow weights in random.choice

2016-03-30 Thread Steven Basart
Steven Basart added the comment: Hello rhettinger. I filled out the form thanks for letting me know about it. Is there anything else I have to do? Hey serhiy.storchaka There were several things "wrong" with the previous implementation in my opinion. 1st they tried to add too mu

[issue18844] allow weights in random.choice

2016-03-30 Thread Steven Basart
Steven Basart added the comment: Hey serhiy.storchaka I can edit the code to output just one value if called with simply a list and then return a list of values if called with the optional amount parameter. My code also needs to check that amount >= 1. My code was mostly just to rest

[issue26694] Disasembler fall with Key Error while disassemble obfuscated code.

2016-04-05 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/issue26694> ___ ___ Python-bugs-list mailing list Unsubscr

[issue18844] allow weights in random.choice

2016-04-06 Thread Steven Basart
Steven Basart added the comment: Okay so I added a few lines of code. One to make it return a single number if amount == 1 and the other to check that the amount > 1. The main difference I've noticed between this implementation and previous versions compared to say R is that i

[issue18844] allow weights in random.choice

2016-04-06 Thread Steven Basart
Changes by Steven Basart : Removed file: http://bugs.python.org/file42385/weighted_choice_v4.patch ___ Python tracker <http://bugs.python.org/issue18844> ___ ___ Pytho

[issue18844] allow weights in random.choice

2016-04-06 Thread Steven Basart
Steven Basart added the comment: I reuploaded the file. The spacing on the if amount < 1 was off. Hopefully its fixed now. -- Added file: http://bugs.python.org/file42386/weighted_choice_v4.patch ___ Python tracker <http://bugs.pyth

[issue18844] allow weights in random.choice

2016-04-07 Thread Steven Basart
Steven Basart added the comment: Re-implemented with suggested improvements taken into account. Thanks @mark.dickinson and @pitrou for the suggestions. I also removed the redundant "fast path" portion for this code since it doesn't deal with generators anyways. Let me

[issue18844] allow weights in random.choice

2016-04-07 Thread Steven Basart
Changes by Steven Basart : Removed file: http://bugs.python.org/file42392/weighted_choice_v5.patch ___ Python tracker <http://bugs.python.org/issue18844> ___ ___ Pytho

[issue18844] allow weights in random.choice

2016-04-07 Thread Steven Basart
Steven Basart added the comment: Left in a line of code that was supposed to be removed. Fixed. -- Added file: http://bugs.python.org/file42393/weighted_choice_v5.patch ___ Python tracker <http://bugs.python.org/issue18

[issue26725] list() destroys map object data

2016-04-09 Thread Steven Reed
New submission from Steven Reed: Example repro: Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x=map(bool,[1,0,0,1,1,0]) &

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Steven Adams
New submission from Steven Adams: I've ran into a strange issue after trying to port a project to support py 3.x The app uses a double os.fork to run in the background. On py 3.4+ it seems that when you have an import uuid statement it causes threading.threads to always return fal

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Steven Adams
Steven Adams added the comment: I forgot to mention if i remove import uuid all works as expected. -- ___ Python tracker <http://bugs.python.org/issue26

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Steven Adams
Steven Adams added the comment: Shouldn't that mean it also breaks on py3.3? As a workaround i just import uuid later within the thread method. -- ___ Python tracker <http://bugs.python.org/is

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-18 Thread Steven Adams
Steven Adams added the comment: My workaround didn't work either.. We are a number of third party libs including flask. As soon as i import flask the issues remains.. Maybe something with flask is importing ctypes? Something aint

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-18 Thread Steven Adams
Steven Adams added the comment: Ok but the question still remains, why does it only happen on py3.4+?? -- ___ Python tracker <http://bugs.python.org/issue26

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-24 Thread Steven Adams
Steven Adams added the comment: anyone got any other thoughts on this?? -- ___ Python tracker <http://bugs.python.org/issue26793> ___ ___ Python-bugs-list mailin

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid I can't quite see what the problem is. If you're passing your own globs argument, can't you deepcopy it yourself? Could you show a minimal, short example demonstrating the issue please? -- nosy: +steven.dapr

[issue26878] Allow doctest to deep copy globals

2016-04-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Apr 29, 2016 at 10:09:46AM +, DqASe wrote: > Added file: http://bugs.python.org/file42649/x.py Ah, I see! That makes sense now. Thanks. Why don't you just set the initial state of the lists in the doctests? That makes much better

[issue26947] Documentation improvement needed

2016-05-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: Xiang Zhang is correct: the original is technically correct. If you read it like this: "All of Python’s immutable built-in objects are hashable, while no mutable containers (such as lists or dictionaries) are [hashable]." it should be clear.

[issue26951] Unintuitive error when using generator expression in class property

2016-05-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: On snap! Nicely found! This seems to have something to do with the way generator expressions are run inside their own scope. In Python 2.7, a list comprehension in a class sees the locals correctly: py> class K: ... a = 2; x = [a+i for i in

[issue26954] Add Guido's rejection notice to the "with" FAQ

2016-05-04 Thread Steven D'Aprano
New submission from Steven D'Aprano: The FAQs include a discussion of the rejected Pascal "with" statement (different from the Python `with`). From time to time people propose variants of it, such as using a leading dot to make it unambiguous. Guido has just firmly rejected

[issue26002] make statistics.median_grouped more efficient

2016-05-04 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- stage: patch review -> commit review ___ Python tracker <http://bugs.python.org/issue26002> ___ ___ Python-bugs-lis

[issue26973] Dict View binops permit non-set types

2016-05-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, May 08, 2016 at 04:24:59AM +, Joshua Morton wrote: > Following the comments in python ideas [1] [...] > > [1] https://mail.python.org/pipermail/python-ideas/2016-April/039469.html Am I missing something? I don't see an

[issue26977] Unnecessary line in statistics.pvariance

2016-05-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks Ian! I can't believe I looked at that function earlier today and couldn't see that! -- nosy: +steven.daprano stage: -> resolved status: open -> closed ___ Python tracker <http://bu

[issue26996] Add secrets module as per PEP 506.

2016-05-10 Thread Steven D'Aprano
New submission from Steven D'Aprano: (This is already done, but I should have added a ticket before committing the new module.) See PEP-0506. -- assignee: steven.daprano components: Library (Lib) messages: 265288 nosy: steven.daprano priority: normal severity: normal status:

[issue26996] Add secrets module as per PEP 506.

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

[issue6422] timeit called from within Python should allow autoranging

2016-05-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: This issue seems to have lost momentum, I'd like to revive it by proposing a slightly different interface for the autorange function. Attached is a proof-of-concept patch. I've moved the code which determines the number of loops out of the mai

[issue6422] timeit called from within Python should allow autoranging

2016-05-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I would suggest making the 0.2 tunable as an optional argument. Sounds like a good idea to me. > I also notice the repeat functionality isn't included in the patch, is there > a reason? I don't understand which repeat functiona

[issue6422] timeit called from within Python should allow autoranging

2016-05-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, May 12, 2016 at 04:49:59AM +, Nick Coghlan wrote: > The embedded side-effects were my main concern with Scott's original > patch, so Steven's callback-based approach strikes me as a definite > improvement. However, the aw

[issue27017] Python3.5.1: type().startswith()

2016-05-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: To explain in more detail: ``type('s').startswith`` is the same as ``str.startswith``, which is an unbound method in Python 2 and a regular function in Python 3. Either way, it expects *two* arguments: a string which becomes "self&q

[issue27023] Documentation of tempfile.gettempdir() does not mention it only supports existing directories

2016-05-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't understand. The documentation clearly states: "Python searches a standard list of directories to find one which the calling user can create files in." How do you expect to be able to write files to a directory that doesn'

[issue12920] inspect.getsource only works for objects loaded from files, not interactive session

2016-05-17 Thread Steven Barker
Steven Barker added the comment: The problem being discussed here just came up on Stack Overflow today: http://stackoverflow.com/questions/37288135/inspect-module-for-python/ The cause of the incorrect error message is pretty clear. The relevant code from `inspect.getfile` should do something

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ben, I'm sorry to see you have spent such a long time writing up reasons for changing this behaviour. I fear this is a total waste of your time, and ours to read it. Python 2.7 is under feature freeze, and changing the behaviour of str.

[issue27072] random.getrandbits is limited to 2**31-1 bits on 64-bit Windows

2016-05-20 Thread Steven Barker
New submission from Steven Barker: The C implementation of `_random.Random.getrandbits` is unnecessarily limited in the number of bits it can produce on 64-bit Windows systems. I learned about this issue in discussion of my answer to this stack overflow question: http://stackoverflow.com

[issue27090] Python 3 import error after installation

2016-05-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: It looks like your Python 3 is somehow using your Python 2 site directory. What does your PYTHONPATH contain? Try running this: python3 -E -S -c "import sys; print(sys.path)" and see what it says. -- nosy: +steven.daprano type: cr

[issue27124] binascii.a2b_hex raises binascii.Error and ValueError, not TypeError

2016-05-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: In Python 3.x, 'a' is just as much a Unicode string as 'ä'. I agree that binascii.a2b_hex should raise ValueError for argument 'ä', or ';' for that matter, as they are invalid values. There's an inconsistenc

[issue23949] Number of elements display in error message is wrong while unpacking in traceback

2015-04-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: The error message isn't wrong, just hard to understand. In your example, when it says "need more than 4 values to unpack" it means that it got four values on the right hand side, and needs five (which is more than four) to match what is

[issue24003] variable naming

2015-04-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug. "while" is a keyword, it is part of Python's syntax, and you are not permitted to use keywords as variable names. This is not an accident, but a deliberate decision. -- nosy: +steven.daprano resolution: ->

[issue23990] Callable builtin doesn't respect descriptors

2015-04-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: This bug report seems to be completely based on a false premise. In the very first message of this issue, Ionel says: "it return True even if __call__ is actually an descriptor that raise AttributeError (clearly not callable at all)." but th

[issue24076] sum() several times slower on Python 3

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Antoine asked: > If someone has actual code that suffers from this, it would be good to know > about it. You might have missed Łukasz' earlier comment: "In this particular case, there's internal usage at Twitter that unearthed

[issue24069] Option to delete obsolete bytecode files

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: This would be risky, as byte-code only libraries do exist. I think that deleting orphaned .pyc files from inside the __pycache__ directory is safe, but deleting orphaned .pyc files outside of that risks deleting legitimate byte-code libraries which a

[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Maybe I've misunderstood RDM's comment, but if sys.exit(code) starts automatically printing the return code, that's going to break a lot of scripts. -- nosy: +steven.daprano ___ P

[issue24068] statistics module - incorrect results with boolean input

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: The patch seems simple and straightforward enough. It just needs some tests, and a Round Tuit. -- assignee: -> steven.daprano ___ Python tracker <http://bugs.python.org

[issue24068] statistics module - incorrect results with boolean input

2015-05-01 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- stage: -> test needed ___ Python tracker <http://bugs.python.org/issue24068> ___ ___ Python-bugs-list mailing list Unsub

[issue24112] %b does not work, as a binary output formatter

2015-05-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, since %b is not supported in Python 2, only in Python 3: https://docs.python.org/2/library/stdtypes.html#string-formatting-operations No new features will be added to 2.7, so if you need %b you can use Python 3, or in Python 2.7 yo

[issue24118] http.client example is no longer valid

2015-05-03 Thread Steven D'Aprano
New submission from Steven D'Aprano: The example code for http.client shows www.python.org/parrot.spam return a 404: https://docs.python.org/3/library/http.client.html#examples >>> # Example of an invalid request >>> conn.request("GET", "/parrot.spam"

[issue16344] Traceback Internationalization Proposal

2015-05-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: For what it's worth, there are at least two localised versions of Python: Teuton and ChinesePython. As far as I know, ChinesePython is still in active development. Both translate the keywords and builtins, to German and Chinese respectively. I do

[issue24134] assertRaises can behave differently

2015-05-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think this is a bug. I think it is just a case that you have to be careful when calling functions, you actually do call the function. And that it returns what you think it does. I think the critical point is this: "It turned our t

[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2015-05-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: This has been discussed on Python-Ideas some time ago, possibly more than once. See here for one such (short) discussion: https://mail.python.org/pipermail/python-ideas/2013-April/020148.html I think that move-to-trash functionality is quite useful, I n

[issue27925] Nicer interface to convert hashlib digests to int

2016-09-01 Thread Steven D'Aprano
New submission from Steven D'Aprano: hashlib digests should have a nicer interface to allow conversion to ints. Currently we write int(x.hexdigest(), 16) which is less than obvious and easy to get wrong. It would be nice to be able to just say int(x) (that's my strong preference) o

[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: This behaviour is expected. The factorial function calls itself, it doesn't call "f", but it is "f" which has the cache. So the call to f() goes through the cache, misses, and then calls factorial(), which has no cache. In ef

[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: In case it isn't obvious, my example is meant to be pseudo-code, not the exact implementation used. -- ___ Python tracker <http://bugs.python.o

[issue27942] Default value identity regression

2016-09-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: Can confirm the expected behaviour (printing True) in Python 2.4 through 2.7, 3.3, Jython 2.5, and even venerable old Python 1.5 (where it prints 1). But *not* IronPython 2.6, where it prints False. In 3.6, the difference seems to be here:

[issue27964] Add random.shuffled

2016-09-05 Thread Steven D'Aprano
New submission from Steven D'Aprano: An occasionally requested feature is for a shuffled() function, related to the in-place random.shuffle() as sorted() is to list.sort(). See the latest example: https://mail.python.org/pipermail/python-ideas/2016-September/042096.html -- mes

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Steven D'Aprano
New submission from Steven D'Aprano: Currently, math.isnan(n) and math.isinf(n) for n an int may raise OverflowError if n is too big to convert to a float, e.g.: py> math.isnan(10**1) Traceback (most recent call last): File "", line 1, in OverflowError: int too large t

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: As a convenience for whom? Certainly not the poor user, who thinks that math.isnan(x) should return False if the number x is not a NAN. Since neither 10**1 nor 10**10 are NANs, why should one return correctly and the other raise a completely spu

[issue27975] math.isnan(int) and math.isinf(int) should not raise OverflowError

2016-09-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Sep 06, 2016 at 05:59:08PM +, Mark Dickinson wrote: > Why do you single out `int` for special treatment, Mostly as a demonstration for what could be done, not necessarily as what should be done. Secondly as a potential optimization. Why g

[issue28021] Calculating wrong modulus manually

2016-09-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: That is because of floating point rounding. When you calculate a/23, the result is the approximate float 2.659090889061502e+18 instead of the exact integer result 2659090889061502012. Converting to an int gives you a result which is too small: py>

[issue27181] Add geometric mean to `statistics` module

2016-09-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: As discussed with Ned by email, I'm currently unable to build 3.6 and won't have time to work on this before b1. As discussed on #27761 my tests here are too strict and should be loosened, e.g. from assertEqual to assertAlmostEqual. Ned wrot

[issue27761] Private _nth_root function loses accuracy

2016-09-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: As discussed with Ned via email, this issue shouldn't affect the public geometric_function and the failing tests (currently skipped) are too strict. The existing tests demand an unrealistic precision which should be loosened, e.g. from asse

[issue28092] Build failure for 3.6 on Centos 5.11

2016-09-11 Thread Steven D'Aprano
New submission from Steven D'Aprano: On Centos 5.11, building fails with: Python/dtrace_stubs.o: In function `PyDTrace_LINE': /home/steve/python/python-dev/cpython/Include/pydtrace.h:28: multiple definition of `PyDTrace_LINE' Python/ceval.o:/home/steve/python/python-dev/

[issue28092] Build failure for 3.6 on Centos 5.11

2016-09-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ned, I know my system is old so I understand if 3.6 no longer supports gcc 4.1. Tell me what minimum version I should use (4.8?) and I'll find a way to upgrade or use another system. Shouldn't the build system explicitly report that the compi

[issue28111] geometric_mean can raise OverflowError when checking for inf

2016-09-12 Thread Steven D'Aprano
New submission from Steven D'Aprano: >>> statistics.geometric_mean([0.7 for _ in range(5000)]) Traceback (most recent call last): File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 362, in float_nroot isinfinity = math.isinf(x) OverflowError: int

[issue27181] Add geometric mean to `statistics` module

2016-09-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Sep 12, 2016 at 03:35:14PM +, Mark Dickinson wrote: > statistics.geometric_mean(0.7 for _ in range(5000)) I've raised a new ticket #28111 -- ___ Python tracker <http://bugs.pytho

[issue28171] getopt.getopt error processing long_options

2016-09-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Surely this isn't intended behavior (?) It is indeed. That's standard behaviour for GNU getopt, which the Python module is modelled after: [steve@ando ~]$ getopt --version getopt (enhanced) 1.1.4 [steve@ando ~]$ getopt --versi getop

[issue28171] getopt.getopt error processing long_options

2016-09-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: > How is silently failing to resolve input errors okay ? You haven't demonstrated that it fails to resolve input errors. You have demonstrated a *feature*, not a bug: getopt will accept prefixes if they unambiguously match ONE long option only.

[issue28171] getopt.getopt error processing long_options

2016-09-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: > argparse here I come! https://docs.python.org/2/library/argparse.html#argument-abbreviations-prefix-matching Prefix matching is a standard feature of all command line option parsers that I

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steven D'Aprano
New submission from Steven D'Aprano: It is moderately common to want to join a sequence of substrings with a delimiter rather than a separator, e.g. when joining a sequence of lines into a single string, you usually want a trailing newline as well as newlines between the lines. E.g.:

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: > lines = ''.join(substring + '\n' for substring in substrings) Huh. There were three of us looking at this at work yesterday, and none of us thought of that. -- ___ Python trac

[issue28240] Enhance the timeit module

2016-09-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: > * Display the average, rather than the minimum, of the timings *and* > display the standard deviation. It should help a little bit to get > more reproductible results. I'm still not convinced that the average is the right statistic to

[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I'd suggest to display all values and base the findings on > all available values, rather than just one: > min, max, avg, median, stddev. If we're going to go down that path, I suggest using something like: https://en.wikipedia.org/

[issue28205] Add optional suffix to str.join

2016-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Looking again at the comments for the other respondents, I think this > should just be closed. It doesn't make sense to disturb a long > standing API or the break the join/split symmetry. For what it's worth, in hindsight I agree.

[issue28328] statistics.geometric_mean has no tests. Defer to 3.7?

2016-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Unfortunately I'm in a pickle at the moment, I cannot build 3.6 on any of the machines I have available (three), and no time to upgrade them to something that will build 3.6. But I can provide some tests, if somebody is willing to review and check

[issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs

2016-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks good for me. Thanks for catching this: I knew it was a bug, but then I ran into the issue that I could no longer build 3.6 before I could fix it, and between that and various issues in the real world I never got back to

[issue28328] statistics.geometric_mean has no tests. Defer to 3.7?

2016-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: > The newly-added statistics.geometric_mean function appears to have no > tests at all That's weird and unfortunate. I certainly wrote tests, and I have a backup of them. I have no idea what happened. Attached is a patch that adds the tests,

[issue28328] statistics.geometric_mean has no tests. Defer to 3.7?

2016-10-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Steve, I really think we should postpone to 3.7. [...] If these fixes have to be in by the next beta (10th Oct), I fear that you are right. I can build up to changeset 103135:8b74e5528f35, but not beyond. I will be able to rectify that, but reali

[issue27181] Add geometric mean to `statistics` module

2016-10-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm sorry to say that due to technical difficulties, geometric mean is not going to be in a fit state for beta 2 of 3.6, and so is going to be removed and delayed until 3.7. -- priority: release blocker -> versions: +Python 3.

[issue28351] statistics.geometric_mean can enter infinite loop for Decimal inputs

2016-10-04 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- versions: -Python 3.6 ___ Python tracker <http://bugs.python.org/issue28351> ___ ___ Python-bugs-list mailing list Unsubscr

[issue28328] statistics.geometric_mean has no tests. Defer to 3.7?

2016-10-04 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- versions: -Python 3.6 ___ Python tracker <http://bugs.python.org/issue28328> ___ ___ Python-bugs-list mailing list Unsubscr

[issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs

2016-10-04 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- versions: -Python 3.6 ___ Python tracker <http://bugs.python.org/issue28327> ___ ___ Python-bugs-list mailing list Unsubscr

[issue28111] geometric_mean can raise OverflowError for large input length

2016-10-04 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- versions: -Python 3.6 ___ Python tracker <http://bugs.python.org/issue28111> ___ ___ Python-bugs-list mailing list Unsubscr

[issue27761] Private _nth_root function loses accuracy

2016-10-04 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker <http://bugs.python.org/issue27761> ___ ___ Python-bugs-list m

[issue28366] Syntax issue

2016-10-05 Thread Steven D'Aprano
New submission from Steven D'Aprano: Did you take a picture of the screen with your iPhone? Why didn't you take a screenshot? Or better still, since this is a text-based medium not a graphics error, copy and paste the text involved? That's easier for people to work with, incl

[issue28365] 3.5.2 syntax issue

2016-10-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: See #28366 -- nosy: +steven.daprano ___ Python tracker <http://bugs.python.org/issue28365> ___ ___ Python-bugs-list m

[issue28366] Syntax issue

2016-10-05 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/is

[issue28365] 3.5.2 syntax issue

2016-10-05 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +terry.reedy ___ Python tracker <http://bugs.python.org/issue28365> ___ ___ Python-bugs-list mailing list Unsubscr

[issue28381] Add a "starcaller" function

2016-10-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: This was discussed on Python-Ideas back in July: https://mail.python.org/pipermail/python-ideas/2016-July/041153.html I don't recall any opposition, although Nick suggested that possibly a better idea was to resurrect the `apply` built-in into

[issue27495] Pretty printing sorting for set and frozenset instances

2016-10-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: There seems to be consensus that this should be treated as a bug fix, not a new feature. Could this still make it into 3.6 even though it missed the first beta? -- nosy: +steven.daprano ___ Python tracker

<    14   15   16   17   18   19   20   >