Re: [Python-Dev] [Python-checkins] cpython (merge 3.3 -> default): Merge issue #15936: Add link from os.urandom to random.SystemRandom

2012-10-16 Thread MRAB
On 2012-10-16 12:59, Stephen J. Turnbull wrote: Antoine Pitrou writes: > But, yes, I would call it "higher level" rather than "easy to use" > (I don't think there's a need for hyphens, by the way). You don't need them to get the point across, but elderly grammar pedants will think better of

Re: [Python-Dev] Why not using the hash when comparing strings?

2012-10-18 Thread MRAB
On 2012-10-19 02:03, Victor Stinner wrote: Hi, I would like to know if there a reason for not using the hash of (bytes or unicode) strings when comparing two objects and the hash of the two objects was already been computed. Using the hash would speed up comparaison of long strings when the two

Re: [Python-Dev] chained assignment weirdity

2012-11-06 Thread MRAB
On 2012-11-06 15:02, Rob Cliffe wrote: On 06/11/2012 12:01, Nick Coghlan wrote: As noted, it's really only counterintuitive if your intuition is primed to expect C style right to left chained assignments. Python, on the other hand, is able to preserve primarily left to right evaluation in thi

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread MRAB
On 2012-11-14 20:53, Mark Adam wrote: On Wed, Nov 14, 2012 at 1:37 PM, Xavier Morel wrote: On 2012-11-14, at 19:54 , Mark Adam wrote: Merging of two dicts is done with dict.update. No, dict.update merges one dict (or two) into a third one. No. I think you need to read the docs. How do

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread MRAB
On 2012-11-14 21:20, MRAB wrote: On 2012-11-14 20:53, Mark Adam wrote: On Wed, Nov 14, 2012 at 1:37 PM, Xavier Morel wrote: On 2012-11-14, at 19:54 , Mark Adam wrote: Merging of two dicts is done with dict.update. No, dict.update merges one dict (or two) into a third one. No. I think

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread MRAB
On 2012-11-14 21:40, Greg Ewing wrote: Chris Angelico wrote: Perhaps an alternative question: What can be done to make the latter less unpalatable? * We could introduce a new syntax such as {a = 1, b = 2}. * If the compiler were allowed to recognise builtins, it could turn dict(a = 1, b = 2)

Re: [Python-Dev] Keyword meanings [was: Accept just PEP-0426]

2012-12-05 Thread MRAB
On 2012-12-06 02:12, Stephen J. Turnbull wrote: I understand the PEP author's frustration with continued discussion, but I think this subthread on Obsoletes vs. Obsoleted-By is not mere bikeshedding on names. It matters *which package* presents the information. Donald Stufft writes: > On Wed

Re: [Python-Dev] Keyword meanings [was: Accept just PEP-0426]

2012-12-08 Thread MRAB
On 2012-12-08 20:18, PJ Eby wrote: On Sat, Dec 8, 2012 at 5:06 AM, Nick Coghlan wrote: On Sat, Dec 8, 2012 at 4:46 PM, PJ Eby wrote: So if package A includes a "Conflicts: B" declaration, I recommend the following: * An attempt to install A with B already present refuses to install A withou

Re: [Python-Dev] Conflicts [was Re: Keyword meanings [was: Accept just PEP-0426]]

2012-12-08 Thread MRAB
On 2012-12-09 01:15, Steven D'Aprano wrote: On 09/12/12 08:14, MRAB wrote: If package A says that it conflicts with package B, it may or may not be symmetrical, because it's possible that package B has been updated since the author of package A discovered the conflict, so it's

Re: [Python-Dev] Do more at compile time; less at runtime

2012-12-09 Thread MRAB
On 2012-12-09 22:22, Mark Shannon wrote: Hi all, The current CPython bytecode interpreter is rather more complex than it needs to be. A number of bytecodes could be eliminated and a few more simplified by moving the work involved in handling compound statements (loops, try-blocks, etc) from the

Re: [Python-Dev] More compact dictionaries with faster iteration

2012-12-09 Thread MRAB
On 2012-12-10 01:44, Raymond Hettinger wrote: The current memory layout for dictionaries is unnecessarily inefficient. It has a sparse table of 24-byte entries containing the hash value, key pointer, and value pointer. Instead, the 24-byte entries should be stored in a dense table referenced by

Re: [Python-Dev] Draft PEP for time zone support.

2012-12-12 Thread MRAB
On 2012-12-12 23:33, Lennart Regebro wrote: On Thu, Dec 13, 2012 at 12:23 AM, Terry Reedy wrote: As a Windows user, I would like there to be one tz data file used by all Python versions on my machine, including ones included with other apps. That would be nice, but where would that be install

Re: [Python-Dev] Usage of += on strings in loops in stdlib

2013-02-12 Thread MRAB
On 2013-02-12 21:44, Antoine Pitrou wrote: On Tue, 12 Feb 2013 16:40:38 -0500 Ned Batchelder wrote: But the only reason "".join() is a Python idiom in the first place is because it was "the fast way" to do what everyone initially coded as "s += ...". Just because we all learned a long time a

Re: [Python-Dev] Usage of += on strings in loops in stdlib

2013-02-13 Thread MRAB
On 2013-02-13 13:23, Lennart Regebro wrote: On Wed, Feb 13, 2013 at 1:10 PM, Serhiy Storchaka wrote: I prefer "x = '%s%s%s%s' % (a, b, c, d)" when string's number is more than 3 and some of them are literal strings. This has the benefit of being slow both on CPython and PyPy. Although using .

<    1   2   3   4   5   6