[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: You say it doesn't work as expected, but you don't say what you expect or why. (Don't make me guess what you mean -- explicit is better than implicit.) When I try your subclass in 3.6, I get an unexpected TypeError: py> class Dict(

[issue35166] BUILD_MAP_UNPACK doesn't function as expected for dict subclasses

2018-11-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: How weird... after restarting the interpreter, I can't reproduce that TypeError. I get the AssertionError Serhiy showed. -- ___ Python tracker <https://bugs.python.o

[issue35176] for loop range bug

2018-11-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, this is standard behaviour, working as designed. 'a' is not a copy of the list 'x', 'a' is another name for the same list as 'x'. Any in-place modifications you make to 'a' ha

[issue35200] Range repr could be better

2018-11-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Not everyone knows the '...' convention. At least according to Google's predictive search, if I type "what does three dots" I get common searches such as "what does three dots mean at the end of a sentence" and simila

[issue35200] Range repr could be better

2018-11-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: With the proposed design, any two empty range objects have the same repr: repr(range(0)) == repr(range(2, 2)) == repr(range(1, 5, -1)) etc. Between this loss of information, and the loss of round-tripping through eval, I'm against this proposa

[issue35200] Range repr could be better

2018-11-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I've never seen any student try `str(range(10))` in the repl I never suggested that students would try calling str() directly. That would be silly. They would use print(), as I'm sure many of them are already doing. After 20+ years

[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: https://docs.python.org/3/library/venv.html > my students are often confused by it, sometimes they copy the angle brackets, > sometime even the prompt. Learning to recognise placeholders and the prompt is an essential part of learning to code,

[issue35224] PEP 572: Assignment Expressions

2018-11-13 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker <https://bugs.python.org/issue35224> ___ ___ Python-bugs-list mailing list Unsubscr

[issue35245] list comprehension for flattened or nested list differ too much

2018-11-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: > l2 = [str(leaf) for leaf in tree for tree in forest] Expanded to nested loops, that becomes: l2 = [] for leaf in tree: for tree in forest: l2.append(str(leaf)) which of course gives a NameError, because you are trying to iterate over

[issue35256] The Console of Python 3.7.0.

2018-11-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't understand what you think is the bug. You keep repeatedly appending 'z' to the same list. Why are you surprised that it appends 'z' more than once? If you don't want to append it twice, don't call the

[issue35200] Make the half-open range behaviour easier to teach

2018-11-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Nov 18, 2018 at 09:43:02PM +, Julien Palard wrote: > My first though went to giving something really simple like: > > >>> print(range(10)) > 1, 2, ..., 8, 9 -1 Surely that would be your *second* thought, since yo

[issue35274] Running print("\x98") then freeze in Interpreter

2018-11-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid I can't reproduce that in Python 3.5.2 or 3.6.4. Can you try this? from time import time print(time(), '\x98', time()); print(time()) and copy and paste the results. What terminal/console are you using? If you chan

[issue35200] Make the half-open range behaviour easier to teach

2018-11-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Nov 18, 2018 at 10:27:11PM +, Julien Palard wrote: > > Julien Palard added the comment: > > If I understand correctly, you'd like str(range(10)) to return " [1, 2, ..., 8, 9]>"? Exactly the same as you sugg

[issue18568] Support \e escape code in strings

2013-07-26 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

[issue18568] Support \e escape code in strings

2013-07-26 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.org/issue18568> ___ ___ Python-

[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

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

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

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

[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+03

[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

[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

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

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

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

[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

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

[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

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

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

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

[issue18606] Add statistics module to standard library

2013-08-16 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/met

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

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

[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 <http://bugs.python.org

[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 <http://bugs.python.org/is

[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

[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

[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

[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

[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

[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 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 is not callable,

[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

[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

[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

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

[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

[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

[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

[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

[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

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

[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 <http://bugs.python.org/is

[issue19332] Guard against changing dict during iteration

2013-11-06 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- nosy: -stevenjd ___ Python tracker <http://bugs.python.org/issue19332> ___ ___ Python-bugs-list mailing list Unsubscr

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

[issue21956] Deleted document should not appear in 3.4 docs

2014-07-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: > in many cases flat-out wrong What advice is "flat-out wrong"? All the advice seems excellent to me: * avoid "from spam import *" (with a very few exceptions) * be cautious about "from spam import eggs" * avoid bare

[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks good, but I think it is better to have an "unroll" option rather than do it automatically. I'm okay with the default being to unroll, but sometimes I want to compare the speed between different versions of Python, and having unroll

[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, Jul 16, 2014 at 02:49:31PM +, Armin Rigo wrote: > ...but I don't think PyPy should be by itself a good enough reason to > reject this patch. It would be fine if timeit detects which > interpreter it runs on, and only tries t

[issue22001] containers "same" does not always mean "__eq__".

2014-07-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Jul 17, 2014 at 07:39:21PM +, Jim Jewett wrote: > Note, however, that containers will normally implement item equality > as "a is b or a==b" We can't say "will normally", since we don't know about the inf

[issue22031] Hexadecimal id in reprs

2014-07-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Many specialized reprs follow a pattern <... at {hexadecimal id}...>. > But there are few deviations: [...] > Proposed patch makes these cases to conform with other reprs. I oppose making this change. The exact format of this generic r

[issue22167] iglob() has misleading documentation (does indeed store names internally)

2014-08-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree that the documentation could be improved, but it's not really *wrong*. Consider a glob like "spam/[abc]/*.txt". What iglob does is conceptually closer to: (1) generate the list of files matching "spam/a/*.txt" and yield

[issue22198] Odd floor-division corner case

2014-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Aug 14, 2014 at 04:47:41PM +, Mark Dickinson wrote: > I'm not sure it's worth fixing this, but it seems worth recording: > > >>> -0.5 // float('inf') > -1.0 > > I was expecting a value of `

[issue22202] Function Bug?

2014-08-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thank you for the extensive examples, but I'm afraid this is not a bug. In your code, "result" is a local variable, which means it only exists inside the fib() function. When you try inspecting "result", it fails because there

[issue22202] Function Bug?

2014-08-14 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue22202> ___ ___ Python-bugs-list mailing list Unsub

[issue22305] Documentation on deepcopy's problems is misleading

2014-08-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: > It should read: > "administrative data structures that should be not shared > even between copies" No. If they should NOT be shared, then making a deep copy is the correct thing to do. The problem with deepcopy is when you actual

[issue22360] Adding manually offset parameter to str/bytes split function

2014-09-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid I don't understand the purpose of this feature request, or what the behaviour is. You show a simple example: >>> s = 'abc;;def;hij' >>> s.split(';', offset=1) ['abc', ';def&#

[issue22364] Unify error messages of re and regex

2014-09-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm dubious about this issue. It suggests that the wording of the exceptions is part of the API of the two modules. If the idea is just to copy the best error messages from one module to the other, then I guess there is no harm. But if the

[issue22364] Unify error messages of re and regex

2014-09-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Sep 19, 2014 at 08:41:57PM +, Mark Lawrence wrote: > I do not believe that any changes should be made to the re module > until such time as there is a fully approved PEP [] Why is this so controversial? We're not talking

[issue22477] GCD in Fractions

2014-09-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: I would be a lot more cautious about changing the gcd function. As Mark says, there is *not* a single well-defined meaning of the gcd for negative arguments. Even Wolfram can't decide which to use: Mathworld gives one interpretation, Mathematica th

[issue22477] GCD in Fractions

2014-09-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: If we are considering adding a new gcd elsewhere (say, in the math module), then it should accept any arbitrary number of arguments, not just two. (At least one argument though.) Also, Mathematica supports the GCD of rational numbers, not just int

[issue22479] strange behavior of importing random module

2014-09-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: For future reference, we *strongly* recommend that instead of taking a screen shot and posting it as an attachment, you copy and paste the text directly. Don't retype it, any decent terminal application will allow you to select and copy the text,

[issue22511] Assignment Operators behavior within a user-defined function and arguments being passed by reference or value

2014-09-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid that you are mistaken about Python's argument passing semantics. Arguments are *always* passed using the same semantics, and *never* using either pass-by-value or pass-by-reference. These two pages may help you understand why Py

[issue22515] Implement partial order on Counter

2014-09-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Sep 29, 2014 at 07:33:21PM +, Ram Rachum wrote: > I suggest implementing `Counter.__lt__` which will be a partial order, > similarly to `set.__lt__`. Since Counter is described as a multiset, this sounds reasonable to me.

[issue22530] re rejects index of type long on 2.7

2014-09-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: As I explained on the thread (possibly my post crossed in the mail with Ryan's patch) I don't believe this is a bug fix. MatchObject.group has only accepted actual ints, not longs, since Python 1.5 (tested 1.5, 2.4-2.7). Nor is there any

[issue22515] Implement partial order on Counter

2014-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ethan said: > If it is so specialized as to only be needed in complex combinatorial > calculations, does it belong in the general-purpose part of the > language? It's a multi-set, a general purpose and fairly fundamental data type. https

[issue22515] Implement partial order on Counter

2014-10-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Oct 04, 2014 at 07:57:16AM +, Serhiy Storchaka wrote: > There are some properties of set comparison: > > (a < b) == (a <= b and a != b) > (a <= b) == (a < b or a == b) > (a <= b and b <= a) == (a == b) > (a

[issue22515] Implement partial order on Counter

2014-10-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Oct 04, 2014 at 08:38:17AM +, Ram Rachum wrote: > > Ram Rachum added the comment: > > > There are some properties of set comparison: > > > > (a < b) == (a <= b and a != b) > > I don't think so, b

[issue22515] Implement partial order on Counter

2014-10-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Oct 04, 2014 at 10:43:02AM +, Antoine Pitrou wrote: > Just because something is discussed doesn't mean it needs a PEP. I know that in general discussions do not need a PEP, but we seem to be rushing awfully fast into writing code b

[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 : -- assignee: -> stevenjd nosy: +stevenjd ___ Python tracker <http://bugs.python.org/issue20389> ___ ___ Python-bugs-lis

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

[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-02 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- assignee: -> stevenjd ___ Python tracker <http://bugs.python.org/issue20478> ___ ___ Python-bugs-list mailing list Unsub

[issue20481] Clarify type coercion rules in statistics module

2014-02-02 Thread Steven D'Aprano
Changes by Steven D'Aprano : -- assignee: -> stevenjd ___ Python tracker <http://bugs.python.org/issue20481> ___ ___ Python-bugs-list mailing list Unsub

<    7   8   9   10   11   12   13   14   15   >