[issue13966] Add disable_interspersed_args() to argparse.ArgumentParser

2012-07-21 Thread Steven Bethard
Steven Bethard added the comment: The argparse changes and tests look good. The new method needs to be documented. You can see some other things (e.g. Misc/NEWS) that also need to be updated by running "make patchcheck" as described here: http://docs.python.org/devguide/

[issue11807] Documentation of add_subparsers lacks information about parametres

2012-07-21 Thread Steven Bethard
Steven Bethard added the comment: Looks good. There was one typo in "parametres" that I've fixed. Should be ready to apply. -- Added file: http://bugs.python.org/file26469/11807_3.patch ___ Python tracker <http://bugs.pyt

[issue13818] argparse: -h listening required options under optional arguments

2012-07-21 Thread Steven Bethard
Changes by Steven Bethard : -- resolution: -> duplicate status: open -> closed superseder: -> argparse: Default Help Message Lists Required Args As Optional ___ Python tracker <http://bugs.python.or

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2012-07-21 Thread Steven Bethard
Steven Bethard added the comment: I agree that this looks like a bug. I think the fix is something like the attached patch, but it needs some tests to make sure that it fixes your problem. -- keywords: +patch Added file: http://bugs.python.org/file26471/issue9625.diff

[issue14856] argparse: creating an already defined subparsers does not raises an exception

2012-07-21 Thread Steven Bethard
Steven Bethard added the comment: Yeah, overwriting the existing parser is probably not typically what the user intended. However, I could see someone doing this if, say, they had a parser designed by another module writer, and they wanted to use it but just change one of the sub-parsers or

[issue14910] argparse: disable abbreviation

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I think it makes a lot of sense to allow people to disable abbreviations, so +1 on the feature request. The patch looked good. There was one typo - using "accept_abbrev" in the docstring instead of "allow_abbrev" as in the implementati

[issue14910] argparse: disable abbreviation

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: Sorry, my mistake, the doc changes were already in the patch. I just checked them and they look good too. So everything's ready to commit. Thanks for your contribution! -- ___ Python tracker

[issue8538] Add FlagAction to argparse

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: On the off chance that someone was waiting for feedback from me, I'll say: (1) A simple boolean --foo/--no-foo action seems useful to me. I would probably call it BooleanOptionalAction rather than FlagAction. (Almost anything could be considered a

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: The fix looks right, but we definitely need a test. I tried to write one, but I'm not sure how to do this properly given how test_argparse redirects standard input and output (so that fileno() doesn't work anymore). I've attached my current (f

[issue11354] argparse: nargs could accept range of options count

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: The tests look like they're testing the right things, but the tests should instead be written like the rest of the argparse tests. For example, look at TestOptionalsNargs3 and TestPositionalsNargs2. You could write your tests to look something like

[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: Your patch is a good start, but it needs to handle all the related situations, e.g. nargs='?' and the possibility of having more than one zero-length argument at the end. I believe the following patch achieves this. Please test it out. -

[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2012-07-22 Thread Steven Bethard
New submission from Steven Bethard : >From http://bugs.python.org/issue14191#msg155202: ArgumentParser.parse_args(args=None, namespace=None) ... However, nowhere is the args= parameter explained. One example is given at the end of 15.4.4.6 showing the use of args= which apparently accept

[issue14191] argparse doesn't allow optionals within positionals

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I created Issue 15427 for the parse_args documentation bug. So let's make this issue just about parsing intermixed arguments. Yes, if someone would like to provide a patch for this, please create a method "parse_intermixed_args" rather than a

[issue15271] argparse: repeatedly specifying the same argument ignores the previous ones

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I don't think this is a bug. You've specified two arguments with the same destination, "foo". This means that argparse will parse the first one, assign it to the attribute "foo" and then parse the second one and assign it

[issue15125] argparse: positional arguments containing - in name not handled well

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I'm sympathetic to the idea that '-' should be translated similarly for optional and positional arguments, but as you've noted, it would be a risky patch because it's already possible for people to use getattr on hyphenated argumen

[issue11176] give more meaningful argument names in argparse documentation

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: Thanks for working on this! I think keeping the first example as simple is possible is probably a good idea. And I didn't have time to read through the whole patch, but as far as I went, the pizza examples looked

[issue15336] Argparse required arguments incorrectly displayed as optional arguments

2012-07-22 Thread Steven Bethard
Changes by Steven Bethard : -- resolution: -> duplicate status: open -> closed superseder: -> argparse: Default Help Message Lists Required Args As Optional ___ Python tracker <http://bugs.python.or

[issue9694] argparse required arguments displayed under "optional arguments"

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I'm changing the title because I keep seeing duplicates. Documentation patches still welcome! -- title: argparse: Default Help Message Lists Required Args As Optional -> argparse required arguments displayed under "optional argume

[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I don't think there's any easy way for argparse to automatically do what you want. However, there's a simple workaround - just use the dest= argument and specify two different destinations: >>> parser = argparse.ArgumentParser()

[issue15428] add "Name Collision" section to argparse docs

2012-07-22 Thread Steven Bethard
New submission from Steven Bethard : Several bugs (e.g. Issue 15327 and Issue 15271) have been filed suggesting that people aren't really clear on how argparse handles argument name collisions or how they can get it to do what they want. I think these problems could probably be solved

[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: If you'd like to help improve the documentation so that the workaround for your problem is more obvious, please contribute to Issue 15428. -- ___ Python tracker <http://bugs.python.org/is

[issue15271] argparse: repeatedly specifying the same argument ignores the previous ones

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: I'm going to close this issue, since argparse is doing what you've asked it to, even if that wasn't what you expected. But I think the documentation for this kind of thing could be improved. If you'd like to help document the workaround f

[issue13720] argparse print_help() fails if COLUMNS is set to a low value

2012-07-22 Thread Steven Bethard
Steven Bethard added the comment: Definitely a bug here. Attached is a patch and a test, based on Russell Sim's suggestion, that should fix it. -- keywords: +patch versions: +Python 3.4 Added file: http://bugs.python.org/file26486/13720.

[issue15433] argparse usage line is wrong

2012-07-23 Thread Steven Bethard
Changes by Steven Bethard : -- resolution: -> duplicate superseder: -> argparse optionals with nargs='+' can't be followed by positionals ___ Python tracker <http://bu

[issue15433] argparse usage line is wrong

2012-07-23 Thread Steven Bethard
Changes by Steven Bethard : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue15433> ___ ___ Python-bugs-list mailing list Unsubscri

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

2012-07-23 Thread Steven Bethard
Steven Bethard added the comment: So Kotan's patch doesn't actually solve the original problem. Instead, it inserts the workaround into the help message of the parser. I think this is probably not the right fix. We should probably do two things: (1) Right now: create a documenta

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

2012-07-23 Thread Steven Bethard
Steven Bethard added the comment: And I guess Issue 9182 is the right place for (1). -- ___ Python tracker <http://bugs.python.org/issue9338> ___ ___ Python-bug

[issue9182] document “--” as a way to distinguish option w/ narg='+' from positional argument in argparse

2012-07-23 Thread Steven Bethard
Steven Bethard added the comment: Ok, here's what I think needs to go into the documentation here: (1) Add a separate section to the argparse docs about '--'. Give examples like the ones in this issue, and show how '--' can solve them (2) Cross-reference the s

[issue13249] argparse.ArgumentParser() lists arguments in the wrong order

2012-07-23 Thread Steven Bethard
Steven Bethard added the comment: I've updated the patch for the current trunk. Should be ready to commit. -- Added file: http://bugs.python.org/file26490/Issue13249-4.patch ___ Python tracker <http://bugs.python.org/is

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-02 Thread Steven D'Aprano
New submission from Steven D'Aprano: math.nan fails on some Decimal NANs. For example, while this works: >>> import math >>> from decimal import Decimal >>> math.isnan(Decimal('nan')) True These both fail with ValueError: math.isnan(Dec

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-02 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- components: +Library (Lib) type: -> behavior ___ Python tracker <http://bugs.python.org/issue15544> ___ ___ Python-bug

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Attached is a patch for decimal.py, and test_decimal.py. I cannot provide a patch for the C decimal implementation, sorry. Following Mark's suggestion, my patch keeps the sign but discards the payload for quiet NANs, and raises ValueError for signa

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 03/08/12 22:06, Mark Dickinson wrote: > >> Decimal('snan').is_nan() just returns true and I am under the impression >> that IEEE 754 specifies the same. > > Sure, but IEEE 754 also specifies that math.sqrt() should

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 05/08/12 03:45, Mark Dickinson wrote: > It would make sense to add float.is_infinite and (possibly) float.is_finite > methods at the same time. If you don't add is_finite, you know someone is going to express surprise that it wasn't

[issue15606] re.VERBOSE doesn't ignore certain whitespace

2012-08-09 Thread Steven Collins
New submission from Steven Collins: Given the way the documentation is written for re.VERBOSE - "Whitespace within the pattern is ignored, except when in a character class or preceded by an unescaped backslash" - I would expect all three of the findall() commands below to return su

[issue15606] re.VERBOSE whitespace behavior not completely documented

2012-08-11 Thread Steven Collins
Steven Collins added the comment: Fair enough, but in that case I still think the current behavior should be documented. Attached is a possible patch. (This is my first interaction with the Python issue tracker, by the way; apologies if I ought to have set some field differently or left some

[issue15676] mmap: add empty file check prior to offset check

2012-08-15 Thread Steven Willis
New submission from Steven Willis: There are a number of issues dealing with the offset and length checks in offset, such as issue12556. I'm running into this issue as well, but with a normal file that happens to be empty. I'm trying to access it with: mmap.mmap(f.fileno(), length

[issue13922] argparse handling multiple "--" in args improperly

2012-08-21 Thread Steven Bethard
Steven Bethard added the comment: @gcbirzan: Could you please open up a new issue? The current issue is fixed - it's just that the fix caused a new issue. I would say that the `args` parameter was never intended to be anything but a list, so currently there's a documentation bug

[issue15832] argparse: typechecks default value too early

2012-08-31 Thread Steven Bethard
Changes by Steven Bethard : -- resolution: -> duplicate status: open -> closed ___ Python tracker <http://bugs.python.org/issue15832> ___ ___ Python-bugs-

[issue15832] argparse: typechecks default value too early

2012-08-31 Thread Steven Bethard
Steven Bethard added the comment: It's a bug, but it's already been reported in Issue 12776. There's a patch there, but someone needs to commit it. -- superseder: -> argparse: type conversion function should be called only once

[issue15847] parse_args stopped accepting tuples

2012-09-02 Thread Steven Bethard
Steven Bethard added the comment: The fix looks about right to me. There's a bug in the tests though: parser.parse_args(('x')) should probably be: parser.parse_args(('x',)) since I assume the intent was to test tuples. -- _

[issue15676] mmap: add empty file check prior to offset check

2012-09-06 Thread Steven Willis
Steven Willis added the comment: Here's a patch for 2.7. I don't know if it cleanly applies to the rest. -- keywords: +patch Added file: http://bugs.python.org/file27140/issue15676.patch ___ Python tracker <http://bugs.python.o

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

2012-09-07 Thread Steven Bethard
Steven Bethard added the comment: Interesting idea! The regex would need a little extra care to interoperate properly with prefix_chars, but the approach doesn't seem crazy. I'd probably call the constructor option something like "args_default_to_positional" (the

[issue15874] argparse cannot parse shell variable arguments in file-given arguments

2012-09-07 Thread Steven Bethard
Steven Bethard added the comment: You could try declaring a type converter and using the type= parameter of add_argument. Your type converter could look something like: def expanded_path(arg): return os.path.expandvars(arg) Would that work

[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis
Steven Willis added the comment: Here's a patch for 3.1 -- Added file: http://bugs.python.org/file27153/issue15676-3.1.patch ___ Python tracker <http://bugs.python.org/is

[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis
Steven Willis added the comment: Here's a patch for 3.2 -- Added file: http://bugs.python.org/file27154/issue15676-3.2.patch ___ Python tracker <http://bugs.python.org/is

[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis
Steven Willis added the comment: Here's a branch against the default branch in mercurial. I couldn't find a branch for 3.3 or 3.4. -- Added file: http://bugs.python.org/file27155/issue15676-default.patch ___ Python tracker <http://bu

[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis
Changes by Steven Willis : -- versions: +Python 3.1 ___ Python tracker <http://bugs.python.org/issue15676> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15676] mmap: add empty file check prior to offset check

2012-09-09 Thread Steven Willis
Steven Willis added the comment: Sorry, I thought that's what jcea was asking for. Here's an updated patch for the default branch in mercurial that uses assertRaisesRegex in the test. -- Added file: http://bugs.python.org/file27156/issue15676-def

[issue15929] argparse non alphanum characters replacement

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: If you need to get things that aren't valid Python identifiers, use vars() to get the dictionary: http://docs.python.org/dev/library/argparse.html#the-namespace-object Changing all non-alphanumeric characters to underscores would be a backwards incompa

[issue15906] argparse add_argument() confusing behavior when type=str, default=

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: It looks like the correct fix was already applied, but just to chime in here: (1) Yes, the error is that the isinstance(action.default, str) check was lost (2) Yes, it is intended that you can use a string value as your default and the type= converter will be

[issue15929] argparse non alphanum characters replacement

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: I haven't been following python-dev recently, but the only discussion I remember was for non-strings in __dict__, not non-identifiers. -- ___ Python tracker <http://bugs.python.org/is

[issue15906] argparse add_argument() confusing behavior when type=str, default=

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: Oh, I see, you're right - the recent changes from the Roundup Robot are exactly the wrong changes - special casing _StoreAction, not string defaults. -- ___ Python tracker <http://bugs.python.org/is

[issue15906] argparse add_argument() confusing behavior when type=str, default=

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: I see. So right now, both string defaults and non-string defaults are being converted with the type= function. That seems suspect to me since the documentation explicitly says "type= can take any callable that takes a single string argument and return

[issue15906] argparse add_argument() confusing behavior when type=str, default=

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: Ok, sounds good. Let's make the test check the documented behavior, and then add back the isinstance(action.default, str) check. -- ___ Python tracker <http://bugs.python.org/is

[issue15906] argparse add_argument() confusing behavior when type=str, default=

2012-09-12 Thread Steven Bethard
Steven Bethard added the comment: Patch, with the basestring amendment, looks good. > Do we need a new test for conversion of string defaults? Yeah, I guess go ahead and add one. That will at least document our intentions here, and if we decide to change that later, then it will force us

[issue15935] clarify argparse docs re: add_argument() type and default arguments

2012-09-13 Thread Steven Bethard
Steven Bethard added the comment: Looks good to me. -- ___ Python tracker <http://bugs.python.org/issue15935> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16104] Use multiprocessing in compileall script

2012-10-01 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +stevenjd ___ Python tracker <http://bugs.python.org/issue16104> ___ ___ Python-bugs-list mailing list Unsubsc

[issue8492] Addition to readline module to get dictionary of keystrokes and commands

2012-10-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: A question came up on Python-ideas about readline apparently missing a standard function. See: http://mail.python.org/pipermail/python-ideas/2012-October/016329.html For debugging issues with readline, it would be be very useful to be able to quer

[issue5845] rlcompleter should be enabled automatically

2012-10-05 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: +stevenjd ___ Python tracker <http://bugs.python.org/issue5845> ___ ___ Python-bugs-list mailing list Unsubsc

[issue12686] argparse - document (and improve?) use of SUPPRESS with help=

2012-10-18 Thread Steven Bethard
Steven Bethard added the comment: Yeah, looks like we can close this. If anyone finds a specific bug in the use of SUPPRESS, please open a new issue. -- resolution: -> duplicate status: open -> closed superseder: -> document argparse's

[issue16304] re: Match Objects always have a boolean value of True

2012-10-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think the relevant information -- that re match and search return None in the case of no match -- is that distant from the paragraph quoted. This fact is already mentioned FOUR times in the page, in each of the re.match, re.search fun

[issue20980] In multiprocessing.pool, ExceptionWithTraceback should derive from Exception

2014-03-19 Thread Steven Myint
New submission from Steven Myint: In multiprocessing.pool, ExceptionWithTraceback is not derived from Exception. Thus when it is raised, we get the exception, "TypeError: exceptions must derive from BaseException". Attached is a patch that fixes this. See below example traceback tha

[issue20980] In multiprocessing.pool, ExceptionWithTraceback should derive from Exception

2014-03-19 Thread Steven Myint
Steven Myint added the comment: I didn't quite understand the multiprocessing test cases, but attached is a standalone test case that reproduces the problem. The problem only shows up when using ThreadPool. $ python thread_pool_exception_test.py Traceback (most recent call last):

[issue20980] In multiprocessing.pool, ExceptionWithTraceback should derive from Exception

2014-03-20 Thread Steven Myint
Steven Myint added the comment: This bug was introduced in #13831. -- versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue20980> ___ ___ Pytho

[issue21046] Document formulas used in statistics

2014-03-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: If any of the docs are unclear, I would be very happy take suggestions to improve them. But I'm not entirely sure that the docs are the right place to show the equations. You should be able to look them up on Wikipedia or Wolfram Mathworld if you

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Personally, I think that the second reason given in the footnote, that it makes for confusing tests, is bogus, or at least it's a matter of opinion. I for one don't think they are confusing, and would like to see mixed output/tracebacks suppor

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-08 Thread Steven D'Aprano
New submission from Steven D'Aprano: If you know the population mean mu, you should calculate the sample variance by passing mu as an explicit argument to statistics.pvariance. Unfortunately, it doesn't work as designed: py> data = [1, 2, 2, 2, 3, 4] # sample from a population w

[issue21183] Doctest capture only AssertionError but not printed text

2014-04-08 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- resolution: invalid -> stage: -> needs patch status: closed -> open type: behavior -> enhancement versions: +Python 3.5 -Python 2.7, Python 3.4 ___ Python tracker <http://bugs.p

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, Apr 09, 2014 at 08:20:42AM +, Wolfgang Maier wrote: > I do not think this is a bug in the module, but rather incorrect usage. [...] No, it is legitimate usage. See, for example, "Numerical Recipes in Pascal" by Press et al.

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-12 Thread Steven Hiscocks
New submission from Steven Hiscocks: I've seen an issue with using urandom on Python 3.4. I've traced down to fd being closed (not by core CPython, but by third party library code). After this, access to urandom fails. I assume this is related to persistent fd for urando

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-12 Thread Steven Hiscocks
Steven Hiscocks added the comment: I agree in part, but it's quite common to close fd's in some cases like in a child process after using "os.fork()". There is no way, as far as I'm aware, to identify which fd is associated with /dev/urandom to keep it open; or anywa

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-14 Thread Steven Hiscocks
Steven Hiscocks added the comment: Just to add for those interested: a possible work around solution is using "os.path.sameopenfile" to check fds against another known fd for urandom. And for those wish to have a bit of fun (and maybe a security consideration): python -c "impor

[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-16 Thread Steven Hiscocks
Steven Hiscocks added the comment: Issue where I hit this is in Fail2Ban: https://github.com/fail2ban/fail2ban/issues/687 Lines of code where this occurs: https://github.com/fail2ban/fail2ban/blob/1c65b946171c3bbc626ddcd9320ea2515018677b/fail2ban/server/server.py#L518-530 There are other

[issue1234674] filecmp.cmp's "shallow" option

2014-04-21 Thread Steven Barker
Steven Barker added the comment: A recent Stack Overflow question (http://stackoverflow.com/q/23192359/1405065) relates to this bug. The questioner was surprised that filecmp.cmp is much slower than usual for certain large files, despite the "shallow" parameter being True. It is pr

[issue21338] Silent mode for compileall

2014-04-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Can't you just re-direct stdout or stderr? I'm sure that works even on Windows. E.g. py -${PY_QUALIFIER} -m compileall -q "$INSTDIR\pkgs" 2> null Is there a reason you cannot do this? I think that adding functionality to compilea

[issue16104] Compileall script: add option to use multiple cores

2014-04-27 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: -steven.daprano ___ Python tracker <http://bugs.python.org/issue16104> ___ ___ Python-bugs-list mailing list Unsubscr

[issue21389] The repr of BoundMethod objects sometimes incorrectly identifies the bound function

2014-04-29 Thread Steven Barker
New submission from Steven Barker: The "repr" of bound method objects can be misleading in certain situations. The repr is always is of the format: > But "x" is often incorrect. Here are some examples where the current code gets it wrong: # inherited metho

[issue21405] Allow using symbols from Unicode block "Superscripts and Subscripts" in identifiers

2014-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: 3.1, 3.2, 3.3 and 3.4 are all in feature-freeze, so this is only an option for 3.5. A very tentative +1 on this feature. But I fear it may need to be discussed on python-ideas first. -- nosy: +steven.daprano type: -> enhancement versions:

[issue21415] Python __new__ method doc typo (it's a class and not a static method)

2014-05-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: Actually, no, it is a staticmethod. See Guido's tutorial from way back in version 2.2: [quote] __new__ is a static method. When defining it, you don't need to (but may!) use the phrase "__new__ = staticmethod(__new__)", because thi

[issue21443] asyncoio logging documentation clarifications.

2014-05-05 Thread steven Michalske
New submission from steven Michalske: The asyncio documentation should comment on how to mute and increase some of it's logging. 18.5.7.3. Logging The asyncio module logs information with the logging module in the logger 'asyncio'. Adding a bit of text that mentions the follo

[issue1234674] filecmp.cmp's "shallow" option

2014-05-05 Thread Steven Barker
Steven Barker added the comment: Here's a patch against the default branch that fixes filecmp.cmp's behavior when "shallow" is True, including an update to the module's docs (correcting the previous ambiguity discussed in the 2011 python-dev thread mentioned by San

[issue21445] Some asserts in test_filecmp have the wrong messages

2014-05-06 Thread Steven Barker
New submission from Steven Barker: While working on a fix for issue 1234674, I found that the first test method in Lib/test/test_filecmp.py (FileCompareTestCase.test_matching) has switched up messages in its AssertEquals calls. The first two asserts have the message that should belong to the

[issue21389] The repr of BoundMethod objects sometimes incorrectly identifies the bound function

2014-05-09 Thread Steven Barker
Steven Barker added the comment: Here's a patch that changes the behavior of method_repr in Objects/classobject.c . It first tries to use __func__.__qualname__, then tries __func__.__name__ as a fallback and finally uses "?" if neither of those attributes are available. I&#x

[issue21389] The repr of BoundMethod objects sometimes incorrectly identifies the bound function

2014-05-09 Thread Steven Barker
Steven Barker added the comment: Ah, I figured out why using %R may be bad. It breaks for the following silly class: class C(): def __repr__(self): return repr(self.__repr__) # or use any other bound method repr(C()) will recurse until the recursion limit is hit, both

[issue21046] Document formulas used in statistics

2014-05-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, May 16, 2014 at 07:50:16AM +, Ezio Melotti wrote: > Do you want to propose a patch? I'm really not sure that I agree with this request. I'm currently sitting on the fence, undecided, about 60% against and 40% in favour of expl

[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-20 Thread Steven Myint
Changes by Steven Myint : -- nosy: +myint ___ Python tracker <http://bugs.python.org/issue21540> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21547] '!s' formatting documentation bug

2014-05-21 Thread Steven Barker
Steven Barker added the comment: The behavior of !s with the format() methods isn't exactly the same as %s with % formatting. With the latter, the conversion depends on the type of the result string, which in turn depends on whether the format string *or any of the values values* is un

[issue21592] Make statistics.median run in linear time

2014-05-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, May 28, 2014 at 02:43:29PM +, Thomas Dybdahl Ahle wrote: > I have written some proof of concept code here [1], I would appreciate > you commenting on it, before I turn it into a patch, as I haven't > contributed code to Pyt

[issue21592] Make statistics.median run in linear time

2014-05-31 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've run some performance tests on six variations of the O(N) select algorithm, based on Tim Peters' and Thomas Ahle's code, comparing them to the naive O(N log N) "sort first" algorithm, and sorting is consistently faster up

[issue21592] Make statistics.median run in linear time

2014-06-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Jun 07, 2014 at 01:02:52PM +, Julian Taylor wrote: > but a selection algorithm is useful on its own for all of python and > then a multiselect should be considered. I like the idea of a select and/or multiselect for 3.5. As a new

[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

2014-06-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: I have been using something like this for many years now and it is very handy. I have an early version of the code posted here: http://code.activestate.com/recipes/577896 Over the next week or so, I'll prepare a patch. Because it's a new feat

[issue19495] Enhancement for timeit: measure time to run blocks of code using 'with'

2014-06-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Jun 16, 2014 at 02:09:22AM +, Raymond Hettinger wrote: > Perhaps a time-elapsed context manager would be a better fit in the > contextlib module (which contains more general purpose macro-level > tools usable for many different task

[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla
New submission from Steven Kryskalla: I heard someone complain about this code appearing in the official documentation in a few places: for line in open("file.txt"): print(line) This code will print two newlines. I went through the current "default" and "2.7&

[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla
Changes by Steven Kryskalla : -- versions: +Python 2.7 Added file: http://bugs.python.org/file28192/r80699.patch ___ Python tracker <http://bugs.python.org/issue16

[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla
Changes by Steven Kryskalla : Removed file: http://bugs.python.org/file28192/r80699.patch ___ Python tracker <http://bugs.python.org/issue16598> ___ ___ Python-bugs-list m

[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla
Changes by Steven Kryskalla : Added file: http://bugs.python.org/file28193/r80694.py27.patch ___ Python tracker <http://bugs.python.org/issue16598> ___ ___ Python-bug

[issue18606] Add statistics module to standard library

2013-10-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Oct 13, 2013 at 09:21:13AM +, Nick Coghlan wrote: > > Nick Coghlan added the comment: > > Are the ReST docs the only missing piece here? As far as I know, the only blocker is that the ReST docs are missing. Also Guido woul

[issue18606] Add statistics module to standard library

2013-10-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oscar Benjamin has just made a proposal to me off-list that has *almost* convinced me to make statistics.sum a private implementation detail, at least for the 3.4 release. I won't go into detail about Oscar's proposal, but it has caused me to

[issue18606] Add statistics module to standard library

2013-10-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here is the updated version which I hope is not too late for alpha 4. Main changes: * sum is now private * docstrings have been simplified and shrunk somewhat * I have a draft .rst file, however I'm having trouble getting Sphinx working on my sy

<    10   11   12   13   14   15   16   17   18   19   >