[issue6247] should we include argparse

2009-06-09 Thread Steven Bethard
Steven Bethard added the comment: I'm happy to contribute argparse to the standard library and volunteer to maintain it. For what it's worth, I don't agree that there are already too many argument parsing libraries in the standard library. I do agree that there are already t

[issue6247] should we include argparse

2009-06-10 Thread Steven Bethard
Steven Bethard added the comment: On Tue, Jun 9, 2009 at 11:45 PM, Martin v. Löwis wrote: > It would be useful if several people could confirm that argparse > is *not* horribly designed. A totally reasonable request. Anyone willing to evaluate this can take a look at:

[issue6247] should we include argparse

2009-06-12 Thread Steven Bethard
Steven Bethard added the comment: Yeah, the % formatting is an artifact of argparse being around before str.format was available. If argparse became part of the standard library, it might be reasonable to change to str.format formatting instead as part of the move. It would mean that folks

[issue6319] bdist_msi runs out of memory for large packages

2009-06-21 Thread Steven Bethard
New submission from Steven Bethard : Right now, bdist_msi can run out of memory when used for larger packages. (I found this problem working with NLTK.) The solution is really simple - just add a db.Commit() so that stuff gets flushed to disk more often. The attached patch does just that. I set

[issue6319] bdist_msi runs out of memory for large packages

2009-06-21 Thread Steven Bethard
Steven Bethard added the comment: Done in r73499 and r73500. Thanks! -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue8979] OptParse __getitem__

2010-06-12 Thread Steven Bethard
Steven Bethard added the comment: Given that the one obvious way of using dict-style syntax given a Python object is to call vars(), I thing adding a __getitem__ is probably a bad idea. -- ___ Python tracker <http://bugs.python.org/issue8

[issue8982] argparse docs cross reference Namespace as a class but the Namespace class is not documented

2010-06-12 Thread Steven Bethard
Steven Bethard added the comment: That's right, it doesn't support subscripting. The docs are silent on what namespace is mainly because I don't want to commit to anything other than an object with attributes. But that could be made clearer in the docs. -- versio

[issue9026] [argparse] Subcommands not printed in the same order they were added

2010-06-18 Thread Steven Bethard
Changes by Steven Bethard : -- assignee: -> bethard nosy: +bethard ___ Python tracker <http://bugs.python.org/issue9026> ___ ___ Python-bugs-list mai

[issue9026] [argparse] Subcommands not printed in the same order they were added

2010-06-19 Thread Steven Bethard
Steven Bethard added the comment: Yes, please generate patches from the Python repository. Thanks! -- ___ Python tracker <http://bugs.python.org/issue9

[issue9338] argparse optionals with nargs='+' can't be followed by positionals

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [From the old argparse tracker: http://code.google.com/p/argparse/issues/detail?id=20] You can't follow a nargs='+' optional argument with a positional argument: >>> import argparse >>> parser = argparse.ArgumentParser(pro

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-23 Thread Steven Bethard
Steven Bethard added the comment: Note that the negative number heuristic you're complaining about doesn't actually affect your code below. The negative number heuristic is only used when you have some options that look like negative numbers. See the docs for more informat

[issue9338] argparse optionals with nargs='+' can't be followed by positionals

2010-07-23 Thread Steven Bethard
Steven Bethard added the comment: This is definitely a different bug from the one you just marked it as a duplicate of. -- resolution: duplicate -> stage: committed/rejected -> needs patch status: closed -> open superseder: argparse does not accept options taking arguments

[issue9340] argparse parse_known_args does not work with subparsers

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [Moved from http://code.google.com/p/argparse/issues/detail?id=45] If you try to use parse_known_args and you have a subparser, the subparser will still complain if it sees extra arguments: >>> parser = argparse.ArgumentParser() >&

[issue9341] allow argparse subcommands to be grouped

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [Moved from http://code.google.com/p/argparse/issues/detail?id=53] It's currently not possible to have subcommands formatted in groups, e.g. instead of: subcommands: {a,b,c,d,e} a a subcommand help b b subcommand help

[issue4640] optparse doesn’t disallow adding one-da sh long options (“-option”)

2010-07-23 Thread Steven Bethard
Steven Bethard added the comment: In argparse, "-debug" is a perfectly valid flag (you're not required to have "--debug", and you can even have "+debug" if you want and you specify it correctly), so unless I misunderstand what the bug

[issue4297] Add error_log attribute to optparse.OptionParser

2010-07-23 Thread Steven Bethard
Steven Bethard added the comment: Not sure, but I think _print_message in argparse isn't exactly what the OP is looking for if they really only care about errors. If you want to override how errors are printed, then it's absolutely correct to override the error method (in argpars

[issue9343] Document that argparse "parents" must be fully declared before children

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [From http://code.google.com/p/argparse/issues/detail?id=61] It should be documented clearly that only the arguments present on the parent parser at the time ArgumentParser is called will be included in the parser. >>> parent = argparse.Argum

[issue9343] Document that argparse "parents" must be fully declared before children

2010-07-23 Thread Steven Bethard
Steven Bethard added the comment: Ah, thanks for the fix. No it doesn't need to go in 3.1 - argparse is only in 2.7 and 3.2. -- ___ Python tracker <http://bugs.python.org/i

[issue9345] argparse wrap tests are sensitive to terminal size

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [From http://code.google.com/p/argparse/issues/detail?id=63] What steps will reproduce the problem? 1. PYTHONPATH=. python test/test_argparse.py 2. do the above in an 80x24 terminal window and it passes 3. do the same in an 80 wide emacs shell buffer and you

[issue9347] Calling argparse add_argument with a sequence as 'type' causes spurious error message

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : What steps will reproduce the problem? parser = argparse.ArgumentParser() parser.add_argument('--foo', type=(int, float)) What is the expected output? ValueError: (, ) is not callable What do you see instead? TypeError: not all arguments conver

[issue9348] Calling argparse's add_argument with the wrong number of metavars causes delayed error message

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : What steps will reproduce the problem? parser = argparse.ArgumentParser() parser.add_argument('--foo', nargs=2, metavar=('X','Y','Z')) parser.parse_args(['-h']) The error dosn't show up until hel

[issue9349] document argparse's help=SUPPRESS

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : Argparse supports silencing help for certain options using SUPPRESS. >>> parser = argparse.ArgumentParser() >>> parser.add_argument('--foo', help=argparse.SUPPRESS) >>> parser.print_help() usage: [-h] optional arguments:

[issue9350] add remove_argument_group to argparse

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [From http://code.google.com/p/argparse/issues/detail?id=71] There is a method ArgumentParser.add_argument_group() to create and add an argument group to the parser. I would like the ability to remove an argument group via a method like

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : If you use set_defaults on a subparser, but a default exists on the top level parser, the subparser defaults are ignored: >>> parser = argparse.ArgumentParser() >>> xparser = parser.add_subparsers().add_parser('X') &

[issue9352] argparse eats characters when parsing multiple merged short options

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [Moved from http://code.google.com/p/argparse/issues/detail?id=73] What steps will reproduce the problem? parser = ArgumentParser(prefix_chars="-+") parser.add_argument("-a",action="store_true") parser.add_ar

[issue9353] argparse __all__ is incomplete

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [Moved from http://code.google.com/p/argparse/issues/detail?id=75] What steps will reproduce the problem? 1. import argparse 2. print dir(argparse) 3. print argparse.__all__ Compare the output for public methods and attributes from #2 that aren't in #

[issue9355] argparse add_mutually_exclusive_group more than once has incorrectly formatted help

2010-07-23 Thread Steven Bethard
New submission from Steven Bethard : [Moved from http://code.google.com/p/argparse/issues/detail?id=78] What steps will reproduce the problem? 1. Create two mutually exclusive groups: eg agroup = subcmd_parser.add_mutually_exclusive_group() agroup.add_argument('--a1', action='st

[issue6064] Add "daemon" argument to threading.Thread constructor

2010-07-23 Thread Steven Alderson
Steven Alderson added the comment: Hello, I've taken the liberty of updating the two patch files here for python3.2 at revision 83065. Apologies if I'm treading on anyones toes here. I'm taking part in a europython sprint and this is the first time I've tried this

[issue6064] Add "daemon" argument to threading.Thread constructor

2010-07-23 Thread Steven Alderson
Steven Alderson added the comment: Here's the patch for multiprocessing based on python 3 revision 83065, all credit to the original author, all problems probably mine! Steven -- Added file: http://bugs.python.org/file18153/multiprocessing3k

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Steven Bethard
Steven Bethard added the comment: I still disagree. You're giving the parser ambiguous input. If a parser sees "--foo --bar", and "--foo" is a valid option, but "--bar" is not, this is a legitimately ambiguous situation. Either the user really wanted "

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-27 Thread Steven Bethard
Steven Bethard added the comment: It *would* be a backwards incompatible change. Currently, if I have a parser with both a "--foo" and a "--bar" option, and my user types "--foo --bar", they get an error saying that they were missing the argument to "--foo

[issue9399] Provide a 'print' action for argparse

2010-07-29 Thread Steven Bethard
Steven Bethard added the comment: Should this print to stdout or stderr? I wonder if the API should allow either, and instead look like: parser.add_argument('--license', action='write', message='...', file=sys.stdout) Where sys.stdout would be the default for

[issue9399] Provide a 'print' action for argparse

2010-07-29 Thread Steven Bethard
Steven Bethard added the comment: The equivalent to optparse callback is basically to define __call__ in a subclass of Action. Pretty much the same amount of work because they both have complicated parameters. The "callable" I (not fully confidently) proposed would just be a sho

[issue9444] argparse does not honor prefix_chars when adding default options

2010-08-01 Thread Steven Bethard
Steven Bethard added the comment: Yes, this looks fine, assuming a test is also added. -- ___ Python tracker <http://bugs.python.org/issue9444> ___ ___ Python-bug

[issue9399] Provide a 'print' action for argparse

2010-08-01 Thread Steven Bethard
Steven Bethard added the comment: The patch looks basically right. A few minor issues: * "message=None," should probably be "message,", that is, message should not be allowed to default to None - I can't see any use case for this action without a message. I belie

[issue9444] argparse does not honor prefix_chars when adding default options

2010-08-01 Thread Steven Bethard
Steven Bethard added the comment: It is intentional that you have to specify both "/foo" and "+foo" if you want them to be aliases for the same argument. A common use case for prefix_chars is to define "+x" and "-x" options, which usually mean different

[issue9444] argparse does not honor prefix_chars when adding default options

2010-08-01 Thread Steven Bethard
Steven Bethard added the comment: A doc patch would also be welcome, but I do think it's a bug that "ArgumentParser(prefix_chars='+')" throws an exception, and I think Ted's patch looks fine to me. -- ___ Python tr

[issue9444] argparse does not honor prefix_chars when adding default options

2010-08-03 Thread Steven Bethard
Steven Bethard added the comment: Yep, I'm fine with you committing this (after adding the prefix="+-/" you suggested). I don't have time right now to test the patches, but the code looks about right, and the tests ran fine for you,

[issue9348] Calling argparse's add_argument with the wrong number of metavars causes delayed error message

2010-08-04 Thread Steven Bethard
Steven Bethard added the comment: You can specify either 1 or N. So for n=3, you can specify metavar="X" or metavar=("X", "Y", "Z") but not metavar=("X", "Y"). The special nargs value "?" always takes only one, while

[issue5936] Add MSI suport for uninstalling individual versions

2010-08-06 Thread Steven Bethard
Steven Bethard added the comment: Unassigning, because it's likely I won't have time to work on this for a while. I still think it would be a nice feature. ;-) -- assignee: bethard -> ___ Python tracker <http://bugs.pyth

[issue9253] argparse: optional subparsers

2010-08-10 Thread Steven Bethard
Steven Bethard added the comment: Seems like there's minimally the bug that argparse should currently throw an error if you add an argument after subparsers (since that argument will never be parsed under the current semantics). I do believe that supporting an optional command like the

[issue9554] test_argparse.py: use new unittest features

2010-08-10 Thread Steven Bethard
Steven Bethard added the comment: These all look like good changes to me. (I looked at the patch, but haven't tried applying it though.) -- ___ Python tracker <http://bugs.python.org/i

[issue9345] argparse wrap tests are sensitive to terminal size

2010-08-10 Thread Steven Bethard
Steven Bethard added the comment: Marking as duplicate of 9553 (which has a better description and a patch). -- resolution: -> duplicate ___ Python tracker <http://bugs.python.org/iss

[issue9553] test_argparse.py: 80 failures if COLUMNS env var set to a value other than 80

2010-08-10 Thread Steven Bethard
Steven Bethard added the comment: The best solution would be to make sure that a few different column widths are tested. However, in the meantime, the tests do assume 80 columns, so I think it's correct to specify that using os.environ as suggested. One problem with the proposed pat

[issue9345] argparse wrap tests are sensitive to terminal size

2010-08-10 Thread Steven Bethard
Steven Bethard added the comment: Actually closing this time. Duplicate of issue 9553. -- status: open -> closed ___ Python tracker <http://bugs.python.org/iss

[issue9537] argparse: use OrderedDict to store subparsers

2010-08-10 Thread Steven Bethard
Steven Bethard added the comment: Duplicate of issue 9026. -- resolution: -> duplicate status: open -> closed superseder: -> argparse subcommands not printed in the same order they were added ___ Python tracker <http://bugs.python.o

[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

[issue28882] RFC: Slice confusing with negative strides and the 0th element.

2016-12-05 Thread steven Michalske
New submission from steven Michalske: The slicing and using inputed math is is necessary to provide a special case to make the code behave as expected. Unless I'm missing something. Like we can't do this, as we loose negative indexing from the end of the file? Let's tak

[issue28882] RFC: Slice confusing with negative strides and the 0th element.

2016-12-05 Thread steven Michalske
steven Michalske added the comment: Argh, I swear I proofread this... print([a[x] for x in [slice(y+3, y-1, -1) for y in range(0, len(a), 4)]]) [[], [7, 7, 6, 5]] Catching my explicit case, I changed my code to: print([a[x] for x in [slice(y+3, y-1 if y > 1 else None, -1) for y in rang

[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

[issue29596] Unfinished sentense in howto/clinic.rst

2017-02-24 Thread Steven Rumbalski
Steven Rumbalski added the comment: Truncated sentence was always truncated. Introduced on commit bebf73511a1250fc768bcb7192b5b3c3fd04d8f2 from Issue #20287: Argument Clinic's output is now configurable, allowing delaying its output or even redirecting it to a separate file. https://githu

[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

[issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2016-06-13 Thread Steven Barker
Steven Barker added the comment: I've just encountered this error when trying to update to the 3.5.2rc1 release (64-bit Python, Windows 10). I'd already had the 3.5.1 release installed, so I suppose it could have been an issue with the older installer trying to uninstall the old v

[issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2016-06-13 Thread Steven Barker
Changes by Steven Barker : Added file: http://bugs.python.org/file43371/Python 3.5.2rc1 (64-bit)_20160613002950.log ___ Python tracker <http://bugs.python.org/issue26

[issue26631] Unable to install Python 3.5.1 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2016-06-13 Thread Steven Barker
Changes by Steven Barker : Added file: http://bugs.python.org/file43372/Python 3.5.2rc1 (64-bit)_20160613002148_008_launcher_AllUsers.log ___ Python tracker <http://bugs.python.org/issue26

[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

[issue27389] When a TypeError is raised due to invalid arguments to a method, it should use __qualname__ to identify the class the method is in

2016-06-25 Thread Steven Barker
New submission from Steven Barker: When a method is called with incorrect arguments (too many or too few, for instance), a TypeError is raised. The message in the TypeError generally of the form: foo() takes 2 positional arguments but 3 were given I think the message should include the

[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

<    12   13   14   15   16   17   18   19   20   >