[issue6210] Exception Chaining missing method for suppressing context

2010-12-03 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: It seems to me that an explicit raise inside an except block should *not* chain exceptions by default. The rationale for chaining exceptions is to detect bugs in the exception handler: try: something except SomeError: y = 1

[issue4255] timing module refers to non-existent documentation

2008-11-03 Thread Steven D'Aprano
New submission from Steven D'Aprano [EMAIL PROTECTED]: import timing help(timing) = MODULE DOCS http://www.python.org/doc/current/lib/module-timing.html but there doesn't appear to be any such page: the URL gives Error 404: File Not Found. Searching the reference library for timing

[issue4457] __import__ documentation obsolete

2008-11-28 Thread Steven D'Aprano
New submission from Steven D'Aprano [EMAIL PROTECTED]: The documentation for __import__ says that it primarily exists so that you can replace it with another function that has a compatible interface, in order to change the semantics of the import statement. http://docs.python.org/library

[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: The inspect isSOMETHING() functions all return True or False, except for isgeneratorfunction(), which returns True or None. The body of the function is very brief: if (isfunction(object) or ismethod(object

[issue4796] Decimal to receive from_float method

2008-12-31 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: In the PEP for Decimal, it was discussed that the class should have a from_float() method for converting from floats, but to leave it out of the Python 2.4 version: http://www.python.org/dev/peps/pep-0327/#from-float Following

[issue4796] Decimal to receive from_float method

2009-01-02 Thread Steven D'Aprano
Steven D'Aprano st...@pearwood.info added the comment: Mark suggested the following strategy for Decimal.from_float: always use the largest exponent possible. Just for the avoidance of all doubt, do you mean the largest exponent with the number normalised to one digit to the right

[issue4796] Decimal to receive from_float method

2009-01-02 Thread Steven D'Aprano
Steven D'Aprano st...@pearwood.info added the comment: Raymond: Accordingly, I recommend Decimal.from_float(f) with no qualifiers or optional arguments. -0 on this one. It's going to confuse an awful lot of newbies when they write Decimal.from_float(1.1) and get Decimal

[issue4796] Decimal to receive from_float method

2009-01-02 Thread Steven D'Aprano
Steven D'Aprano st...@pearwood.info added the comment: Mark wrote: Also, why not just extend the Decimal() constructor to accept a float as the argument? Why have a separate from_float() method at all? This was discussed extensively when the decimal module was being proposed; see

[issue4947] sys.stdout fails to use default encoding as advertised

2009-01-14 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: Documentation for files states that when writing to a file, unicode strings are converted to byte strings using the encoding specified by file.encoding. http://docs.python.org/library/stdtypes.html#file.encoding sys.stdout is a file

[issue2527] Pass a namespace to timeit

2009-01-23 Thread Steven D'Aprano
Changes by Steven D'Aprano st...@pearwood.info: -- nosy: +stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2527 ___ ___ Python-bugs-list

[issue5065] IDLE improve Subprocess Startup Error message

2009-01-25 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: When launching IDLE, it reports: IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection. This should report what needs to be opened on the firewall

[issue5066] IDLE documentation for Unix obsolete/incorrect

2009-01-25 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: Documentation for IDLE states: Starting IDLE on UNIX On Unix, just type idle at a command prompt. This should bring up a Window similar to the one above. (If it doesn't, look for the idle script in the Tools/idle

[issue5067] Error msg from using wrong quotes in JSON is unhelpful

2009-01-25 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: Using the wrong sort of quotes in json gives unhelpful error messages: json.loads({'test':'test'}) Traceback (most recent call last): ... ValueError: Expecting property name: line 1 column 1 (char 1) Unless you know that strings

[issue5067] Error msg from using wrong quotes in JSON is unhelpful

2009-01-26 Thread Steven D'Aprano
Changes by Steven D'Aprano st...@pearwood.info: -- components: +Library (Lib) type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5067

[issue7821] Command line option -U not documented

2010-01-30 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: There is a command line switch -U (uppercase U) which is mentioned in PEP 3147 http://www.python.org/dev/peps/pep-3147/ but doesn't appear to be documented anywhere. It is listed here, but not described: http://docs.python.org/using

[issue7821] Command line option -U not documented

2010-01-31 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: If the switch is intentionally not documented, perhaps it should be removed from here: http://docs.python.org/using/cmdline.html#command-line where it is listed but not explained anywhere. As it stands now, the *existence

[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2010-02-06 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: The patch you suggest is *not* sufficient, at least not by my testing. However, the attached patch does work, according to my tests. -- nosy: +stevenjd Added file: http://bugs.python.org/file16158/patch

[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2010-02-09 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Attached is a simple test script for the patch I submitted. I have tested it with Python 2.6 both before and after applying the patch. Run it from the command line. With the unpatched doctest module, it prints: Expected 2 doctests

[issue8128] String interpolation with unicode subclass fails to call __str__

2010-03-12 Thread Steven D'Aprano
New submission from Steven D'Aprano steve+pyt...@pearwood.info: String interpolation % operates on unicode strings directly without calling the __str__ method. In Python 2.5 and 2.6: class K(unicode): ... def __str__(self): return Surprise! ... u%s % K(some text) u'some text

[issue8128] String interpolation with unicode subclass fails to call __str__

2010-03-20 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: I've assumed that the documentation is correct, and that %s%obj should call __str__ for unicode objects as well as everything else. Attached in a test file. -- Added file: http://bugs.python.org/file16595

[issue4037] doctest.py should include method descriptors when looking inside a class __dict__

2010-03-20 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: I have fixed the issue with line length, and taken Brian's advice re valname. Updated patch for doctest and test.test_doctest2 is attached. -- Added file: http://bugs.python.org/file16599/doctest_patch

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

2009-09-29 Thread Steven D'Aprano
Changes by Steven D'Aprano st...@pearwood.info: -- nosy: +stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3366 ___ ___ Python-bugs-list

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Nick Coghlan wrote: Nick Coghlan ncogh...@gmail.com added the comment: 1. Any syntax change requires a PEP (and, IMO, any such PEP for this issue should get rejected: I don't consider this an important enough feature to deserve

[issue6210] Exception Chaining missing method for suppressing context

2012-01-26 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: [...] My comment has been overtaken by additional comments by Nick on the Python-Dev list. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6210

[issue6210] Exception Chaining missing method for suppressing context

2012-01-29 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Patrick Westerhoff wrote: Patrick Westerhoff patrickwesterh...@gmail.com added the comment: I have to agree with Georg on that. I think it would make more sense to introduce some internal flag/variable that keeps track

[issue12790] doctest.testmod does not run tests in functools.partial functions

2011-08-19 Thread Steven D'Aprano
New submission from Steven D'Aprano steve+pyt...@pearwood.info: Functions with docstrings which were created with partial are not run by doctest.testmod(). See the test script, which prints: Expected 1 failure from 2 tests, but got 0 from 0. -- files: partial_doctest.py messages

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2011-08-28 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: I'm not sure if this belongs here, or on the Google code project page, so I'll add it in both places :) Feature request: please change the NEW flag to something else. In five or six years (give or take), the re module will be long

[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Matthew Barnett wrote: Matthew Barnett pyt...@mrabarnett.plus.com added the comment: I think I need a show of hands. Should the default be old behaviour (like re) or new behaviour? (It might be old now, new later.) Should

[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Ezio Melotti wrote: Ezio Melotti ezio.melo...@gmail.com added the comment: Also note that some behaviors are not old or compatible, but just different. For example why inline flags should be the old (or new) behavior? Or e.g

[issue2636] Adding a new regex module (compatible with re)

2011-09-06 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Matthew Barnett wrote: So, VERSION0 and VERSION1, with (?V0) and (?V1) in the pattern? Seems reasonable to me. +1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue15248] In TypeError: 'tuple' object is not callable, explain that a comma may be missing

2012-07-05 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: I think this suggested enhancement is unreasonable and of limited usefulness, and even if it were useful, too specialised to bother with. The obvious message is badly misleading. When I read this: TypeError: 'tuple' object

[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(Decimal('snan')) math.isnan(Decimal('nan123')) (Tested

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-02 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- components: +Library (Lib) type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15544

[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 signalling NANs

[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(signalling nan) should signal. Since both math.sqrt

[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 already done. Just

[issue14361] No link to issue tracker on Python home page

2012-03-18 Thread Steven D'Aprano
New submission from Steven D'Aprano steve+pyt...@pearwood.info: There is no link to the tracker http://bugs.python.org/ on the Python website http://www.python.org/ (or if there is, it's so well hidden I can't see it). I seem to remember that there used to be; whether

[issue14362] No mention of collections.ChainMap in What's New for 3.3

2012-03-18 Thread Steven D'Aprano
New submission from Steven D'Aprano steve+pyt...@pearwood.info: The 3.3 What's New doesn't mention collections.ChainMap -- assignee: docs@python components: Documentation messages: 156244 nosy: docs@python, stevenjd priority: normal severity: normal status: open title: No mention

[issue14363] Can't build Python 3.3a1 on Centos 5

2012-03-18 Thread Steven D'Aprano
New submission from Steven D'Aprano steve+pyt...@pearwood.info: I attempted to build Python 3.3a1 but failed. I am running Centos 5. After running ./configure (no apparent errors), I ran make and got a whole lot of warnings and errors, ending with: collect2: ld returned 1 exit status make

[issue14361] No link to issue tracker on Python home page

2012-03-18 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: Martin v. Löwis wrote: Martin v. Löwis mar...@v.loewis.de added the comment: I think the core issue here is that bug reporters often don't want to get involved, and don't consider themselves contributors. Instead, they post

[issue14361] No link to issue tracker on Python home page

2012-03-19 Thread Steven D'Aprano
Steven D'Aprano steve+pyt...@pearwood.info added the comment: On Mon, Mar 19, 2012 at 02:51:53AM +, Martin v. Löwis wrote: Martin v. Löwis mar...@v.loewis.de added the comment: I remain -1 on adding a link to the tracker to www.python.org. As long as we cannot really cope

[issue18568] Support \e escape code in strings

2013-07-27 Thread Steven D'Aprano
New submission from Steven D'Aprano: I'm adding this so there is a record in the bug tracker for posterity. No action is needed except to close it as a Won't Fix. As per this discussion here: http://mail.python.org/pipermail/python-ideas/2013-June/021318.html using \e as an escape code

[issue18568] Support \e escape code in strings

2013-07-27 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18568

[issue18572] Remove redundant note about surrogates in string escape doc

2013-07-27 Thread Steven D'Aprano
New submission from Steven D'Aprano: The documentation for string escapes suggests that \u escapes can be used to generate characters in the Supplementary Multilingual Planes by using surrogate pairs: Individual code units which form parts of a surrogate pair can be encoded using

[issue18572] Remove redundant note about surrogates in string escape doc

2013-07-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 29/07/13 22:27, R. David Murray wrote: '\uD80C\uDC80' == '\U00013080' False Are you running a wide build? In a narrow build, it returns True. -- ___ Python tracker rep...@bugs.python.org http

[issue5845] rlcompleter should be enabled automatically

2013-07-31 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 31/07/13 17:14, Larry Hastings wrote: IMO the optimal solution is that tab preceded by only whitespace indents, and tab preceded by any non-whitespace character attempts to complete. Can we goad readline into behaving this way? Yes we can. Attached

[issue18606] Add statistics module to standard library

2013-07-31 Thread Steven D'Aprano
New submission from Steven D'Aprano: I proposed adding a statistics module to the standard library some time ago, and received some encouragement: http://mail.python.org/pipermail/python-ideas/2011-September/011524.html Real life intervened, plus a bad case of over-engineering, but over

[issue18614] Enhanced \N{} escapes for Unicode strings

2013-08-01 Thread Steven D'Aprano
New submission from Steven D'Aprano: As per the discussion here: http://mail.python.org/pipermail/python-ideas/2013-July/022419.html \N{} escapes should support the Unicode code point notation U+ (where there are four, five or six hex digits after the U+). E.g. '\N{U+03BB}' = 'λ

[issue18585] Add a text truncation function

2013-08-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: A function like this often gets called to truncate lots of lines. Unfortunately for many use-cases, the part truncated is the most significant part of the line. E.g.: Scanning file: /home/fred/documents/datafil... /home/fred/documents/datafil... /home/fred

[issue18585] Add a text truncation function

2013-08-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: Bike-shedding here... why (...)? Is it common to use round brackets for this purpose? In English-speaking countries, it is usual to use square brackets for editorial comments, including ellipsis [...]. Either way, if you wanted to be more Unicode aware, you

[issue18606] Add statistics module to standard library

2013-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 03/08/13 13:02, Alexander Belopolsky wrote: Alexander Belopolsky added the comment: Is there a reason why there is no review link? Could it be because the file is uploaded as is rather than as a patch? I cannot answer that question, sorry. In any

[issue18606] Add statistics module to standard library

2013-08-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 04/08/13 05:31, Alexander Belopolsky wrote: Alexander Belopolsky added the comment: Here is the use-case that was presented to support adding additional operations on timedelta objects: I'm conducting a series of observation experiments where I

[issue18606] Add statistics module to standard library

2013-08-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 03/08/13 13:22, Alexander Belopolsky wrote: Alexander Belopolsky added the comment: The implementation of median and mode families of functions as classes is clever, So long as it is not too clever. but I am not sure it is a good idea to return

[issue18606] Add statistics module to standard library

2013-08-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 06/08/13 03:08, Mark Dickinson wrote: I too find the use of a class that'll never be instantiated peculiar. I'll accept unusual, but not peculiar. It's an obvious extension to classes being first-class objects. We use classes as objects very frequently

[issue18606] Add statistics module to standard library

2013-08-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 31/07/13 20:23, Antoine Pitrou added the comment: I suppose you should write a PEP for the module inclusion proposal Done. http://www.python.org/dev/peps/pep-0450/ I hope to have an updated reference implementation, plus unittests, up later today

[issue18606] Add statistics module to standard library

2013-08-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 09/08/13 21:49, Oscar Benjamin wrote: I think that the argument `m` to variance, pvariance, stdev and pstdev should be renamed to `mu` for pvariance/pstdev and `xbar` for variance/stdev. The doc-strings should carefully distinguish that `mu` is the true

[issue18606] Add statistics module to standard library

2013-08-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 12/08/13 19:21, Mark Dickinson wrote: About the implementation of sum: it's worth noting that the algorithm you're using for floats depends on correct rounding of addition and subtraction, and that that's not guaranteed. [...] Steven: any thoughts

[issue18606] Add statistics module to standard library

2013-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Attached is a patch containing the statistics reference implementation, after considering feedback given here and on python-ideas, and tests. -- keywords: +patch Added file: http://bugs.python.org/file31286/statistics.patch

[issue18749] [issue 18606] Re: Add statistics module to standard library

2013-08-15 Thread Steven D'Aprano
New submission from Steven D'Aprano: I hope I'm doing the right thing by replying in-line. This is my first code review, please let me know if I'm doing something wrong. By the way, the email hasn't gone to the tracker again. Is that a bug in the tracker? I've taken the liberty of changing

[issue18606] Add statistics module to standard library

2013-08-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: To anyone waiting for me to respond to rietveld reviews, I'm trying, I really am, but I keep getting a django traceback. This seems to have been reported before, three months ago: http://psf.upfronthosting.co.za/roundup/meta/issue517

[issue18606] Add statistics module to standard library

2013-08-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Since I can't respond to the reviews, here's a revised patch. Summary of major changes: - median.* functions are now median_* - mode now only returns a single value - better integrate tests with Python regression suite - cleanup tests as per Ezio's

[issue18606] Add statistics module to standard library

2013-08-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 15/08/13 22:58, ezio.melo...@gmail.com wrote: http://bugs.python.org/review/18606/diff/8927/Lib/statistics.py#newcode277 Lib/statistics.py:277: assert isinstance(x, float) and isinstance(partials, list) Is this a good idea? I think so add_partials

[issue18606] Add statistics module to standard library

2013-08-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Merged two test suites into one, and PEP-ified the test names testSpam - test_spam. -- Added file: http://bugs.python.org/file31366/test_statistics.patch ___ Python tracker rep...@bugs.python.org http

[issue18606] Add statistics module to standard library

2013-08-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Patch file for the stats module alone, without the tests. -- Added file: http://bugs.python.org/file31367/statistics.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18606

[issue18606] Add statistics module to standard library

2013-08-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 19/08/13 23:15, Oscar Benjamin wrote: So with the current implementation I can do: from decimal import Decimal as D, localcontext, Context, ROUND_DOWN data = [D(0.1375), D(0.2108), D(0.3061), D(0.0419)] print(statistics.variance(data

[issue18606] Add statistics module to standard library

2013-08-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 20/08/13 22:43, Mark Dickinson wrote: I agree with Oscar about sum for decimal.Decimal. The *ideal* sum for Decimal instances would return the correctly rounded result (i.e., the exact result, rounded to the current context just once using the current

[issue18606] Add statistics module to standard library

2013-08-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: I have changed the algorithm for statistics.sum to use long integer summation of numerator/denominator pairs. This removes the concerns Mark raised about the float addition requiring correct rounding. Unless I've missed something, this now means

[issue18841] math.isfinite fails with Decimal sNAN

2013-08-26 Thread Steven D'Aprano
New submission from Steven D'Aprano: math.isfinite currently raises ValueError when given a Decimal sNAN (signalling NAN). I've run into a situation where I'm calling isfinite() on a numeric value which may be a Decimal sNAN, and it would be nice if it returned False. On the other hand, see

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

2013-08-26 Thread Steven D'Aprano
New submission from Steven D'Aprano: On issue 15544 Mark Dickinson suggested adding methods to float to match methods on Decimal, giving type-agnostic ways of testing real numbers that don't rely on converting to float. I don't see any sign that Mark raised a feature request, so I'm taking

[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 would like to see

[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 rethink all

[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 system and I

[issue18606] Add statistics module to standard library

2013-10-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Georg Brandl wrote: The rst file is missing from your patch. Oops! Sorry about that. Fixed now. I already posted a patch with statistics.rst five days ago. I have no idea why you ignored it. I'm sorry if I stepped on your toes, but I didn't ignore your

[issue5845] rlcompleter should be enabled automatically

2013-05-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not able to test the patch at the moment, but since it essentially just uses the recipe in the docs, I expect it will have the same side-effect. Namely, it prevents you using the tab key to indent in the interactive interpreter. Now I don't know if I'm

[issue16104] Use multiprocessing in compileall script

2012-10-01 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- nosy: +stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16104 ___ ___ Python-bugs

[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 query

[issue5845] rlcompleter should be enabled automatically

2012-10-05 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- nosy: +stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5845 ___ ___ Python-bugs

[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 functions

[issue1108] Problem with doctest and decorated functions

2009-02-13 Thread Steven D'Aprano
Steven D'Aprano st...@pearwood.info added the comment: For what it's worth, this bug appears to go back to at least Python 2.4, and it affects functions using decorators even if they are defined in the same module as the decorated function. I've applied the patch to my 2.4 installation

[issue1108] Problem with doctest and decorated functions

2009-02-14 Thread Steven D'Aprano
Steven D'Aprano st...@pearwood.info added the comment: Earlier I wrote: I've applied the patch to my 2.4 installation, and it doesn't fix the issue. I'd like to request this be reopened, because I don't believe the patch works as advertised. Nevermind, I withdraw the request. I believe I

[issue5361] Obsolete mispelled in string formatting docs

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

[issue1714448] if something as x:

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

[issue1714448] if something as x:

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

[issue5789] powerset recipe listed twice in itertools docs

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

[issue5790] itertools.izip python code has a typo

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

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

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

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

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

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

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

[issue19332] Guard against changing dict during iteration

2013-11-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Duplicate of this: http://bugs.python.org/issue6017 -- nosy: +stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19332

[issue19332] Guard against changing dict during iteration

2013-11-06 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- nosy: -stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19332 ___ ___ Python-bugs

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

2013-11-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Nov 16, 2013 at 04:33:36PM +, Serhiy Storchaka wrote: Should we add these methods to other concrete Number subclasses (as Fraction and complex)? Seems like a good idea to me. Is it worth making them part of the Number ABC, or is that too much

[issue20389] clarify meaning of xbar and mu in pvariance/variance of statistics module

2014-02-02 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- assignee: - stevenjd nosy: +stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20389

[issue20479] Efficiently support weight/frequency mappings in the statistics module

2014-02-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: Off the top of my head, I can think of three APIs: (1) separate functions, as Nick suggests: mean vs weighted_mean, stdev vs weighted_stdev (2) treat mappings as an implied (value, frequency) pairs (3) take an additional argument to switch between unweighted

[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-02 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- assignee: - stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20478 ___ ___ Python

[issue20481] Clarify type coercion rules in statistics module

2014-02-02 Thread Steven D'Aprano
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- assignee: - stevenjd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20481 ___ ___ Python

[issue20481] Clarify type coercion rules in statistics module

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

[issue20481] Clarify type coercion rules in statistics module

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

[issue20478] Avoid inadvertently special casing Counter in statistics module

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

[issue20561] Decimal handling error in statistics module

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

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

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

  1   2   3   4   5   >