Re: [Python-Dev] PEP 411: Provisional packages in the Python standard library

2012-02-10 Thread Steven D'Aprano
would be just grepping on the Python docs for the provisional note and seeing which modules have it. Not all OSes include grep. Not all Python installations include the docs. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] best place for an atomic file API

2012-02-15 Thread Steven D'Aprano
is committed to disk. [...] What would be the best place for a such a class? _pyio, tempfile, or a new atomicfile shutil perhaps? As a user, that's the third place I look for file utilities, after builtin functions and os module. -- S

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Steven D'Aprano
ds: int, nanoseconds: int) tuple. I'm -1 on adding these APIs, also. Since Python 3.3 is not released yet, it's not too late to revert them. +1. Sorry, is that +1 on the revert, or +1 on the APIs? -- Steven ___ Python-Dev mail

Re: [Python-Dev] PEP 410, 3rd revision, Decimal timestamp

2012-02-20 Thread Steven D'Aprano
c, gravitational constant G, Planck's constant h, or pi change, so will Planck time. Perhaps they should be environment variables? Not-quite-sure-how-seriously-you-intend-supporting-yoctoseconds-ly y'rs, -- Steven ___ Python-Dev mailing list

Re: [Python-Dev] PEP czar for PEP 3144?

2012-02-20 Thread Steven D'Aprano
mal term for the top official responsible for an area. "Drug Czar" is only the most familiar: http://en.wikipedia.org/wiki/List_of_U.S._executive_branch_%27czars%27 -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] Status regarding Old vs. Advanced String Formating

2012-02-25 Thread Steven D'Aprano
epreciated module and keep using it, but it's very difficult for them to fork Python if a language feature is removed. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] PEP 414

2012-02-26 Thread Steven D'Aprano
), which the n() function converts to a unicode-string. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-27 Thread Steven D'Aprano
magnitude so I will probably change the writing to "just" 20 times slower but it illustrates the point. That would be one order of magnitude. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/m

Re: [Python-Dev] Marking packaging-related PEPs as Finished after fixing some bugs in them

2012-02-27 Thread Steven D'Aprano
eady release is *the* release. The others are pre-release releases. Ain't English grand? If if you prefer a more wordy but slightly less confusing way of saying it, they are pre-release versions which have been released. This reply of mine on the python-list list may also be relevant: http:

Re: [Python-Dev] Add a frozendict builtin type

2012-02-28 Thread Steven D'Aprano
h the keys and values have to be frozen. (Values may be mutable objects, but then the frozendict can't be hashed -- just like tuples can't be hashed if any item in them is mutable.) -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 414 - Unicode Literals for Python 3

2012-02-28 Thread Steven D'Aprano
re merely no better off with it than without it. Aside: in my opinion, people shouldn't actively support 3.0, or at least not advertise support for it, as it was end-of-lifed on the release of 3.1. As I see it, it is best to pretend that 3.0 never existed :) -- Steven __

Re: [Python-Dev] Add a frozendict builtin type

2012-02-29 Thread Steven D'Aprano
t is an anti-pattern, and examples of it in real life? -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Add a frozendict builtin type

2012-02-29 Thread Steven D'Aprano
don't think we can dismiss frozendict as "trivial". -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Sandboxing Python

2012-03-04 Thread Steven D'Aprano
loop. I think that Mark's point is that you can't, in general, tell when you are in a "too much time" attack (or bug) that needs to be broken out of rather than just a legitimately long calculation which will terminate if you

Re: [Python-Dev] Non-string keys in type dict

2012-03-07 Thread Steven D'Aprano
. (But "from collections import StringDict" would be better from the point of discoverability.) -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] [Python-checkins] cpython: Close #14205: dict lookup raises a RuntimeError if the dict is modified during

2012-03-09 Thread Steven D'Aprano
gt; unit-testing. The term for this is "regression testing" -- when you fix a bug, you keep a test for that bug forever, to ensure that you never have a regression that re-introduces the bug. -- Steven ___ Python-Dev mailing

Re: [Python-Dev] Docs of weak stdlib modules should encourage exploration of 3rd-party alternatives

2012-03-13 Thread Steven D'Aprano
everything else, no, let's not open this can of worms. I can see no benefit to this suggestion, and all sorts of ways that this might go badly. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Drop the new time.wallclock() function?

2012-03-15 Thread Steven D'Aprano
ks" were 32-bit integers, not floating point numbers. But the use-cases seem to be the same. time.ticks() seems right as a name to me. It suggests a steady heartbeat ticking along, without making any suggestion that it returns "the time". -- Steven _

Re: [Python-Dev] PEP czar for PEP 3144?

2012-03-19 Thread Steven D'Aprano
es:~$ python3.2 -m timeit -s "x = (1,2,3)*1" "list(x)" 1 loops, best of 3: 111 usec per loop steve@runes:~$ python3.2 -m timeit -s "x = (1,2,3)*1" "iter(list(x))" 1 loops, best of 3: 111 usec per loop On the other hand, turning the list it

Re: [Python-Dev] cpython: Issue #10278: Add an optional strict argument to time.steady(), False by default

2012-03-19 Thread Steven D'Aprano
ady" is a misnomer. We can't guarantee that the timer will tick at a steady rate. That will depend on the quality of the hardware clock. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Playing with a new theme for the docs

2012-03-22 Thread Steven D'Aprano
ith more text improved my feelings. A big +1 on the pale green shading of code blocks. The basic design seems good to me. I'd prefer a serif font for blocks of text, while keeping sans serif for the headings, but that's a mild preference. Loo

Re: [Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

2012-03-23 Thread Steven D'Aprano
ike this? try: mytimer = time.monotonic except AttributeError: mytimer = time.time or inline: try: return time.monotonic() except (NotImplementError, OSError): return time.time() Should that be (AttributeError, OSError) instead? -- Steven ___

Re: [Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

2012-03-23 Thread Steven D'Aprano
Victor Stinner wrote: - time.clock(): monotonic clock on Windows, CPU time on UNIX Actually, I think that is not correct. Or at least *was* not correct in 2006. http://bytes.com/topic/python/answers/527849-time-clock-going-backwards -- Steven

Re: [Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

2012-03-23 Thread Steven D'Aprano
recover? That is, it works for a while, then raises OSError, then works again on the next call. If so, steady will stop using monotonic and never try it again. Is that deliberate? -- Steven ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

2012-03-23 Thread Steven D'Aprano
use QueryPerformanceCounter() on Windows to implement a monotonic clock? I do not have an opinion on the best way to implement monotonic to guarantee that it actually is monotonic. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Playing with a new theme for the docs, iteration 2

2012-03-25 Thread Steven D'Aprano
bably after the final release of 2.7.3. I think it would be better to leave 2.7 with the old theme, to keep it visually distinct from the nifty new theme used with the nifty new 3.2 and 3.3 versions. -- Steven ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] Playing with a new theme for the docs, iteration 2

2012-03-25 Thread Steven D'Aprano
tp://en.wikipedia.org/wiki/Lucida_Grande suggests fallbacks of Lucida Sans Unicode, Tahoma, and Verdana. Could they please be tried before Arial? E.g. change the font-family from font-family: 'Lucida Grande',Arial,sans-serif; to font-family: 'Lucida Grande','

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Steven D'Aprano
o what the implementation of try_monotonic should be. Whether it should fall back to time.time, time.clock, or something else, I don't know. But it is a clear and obvious solution for the use-case of "I prefer the monotonic clock, if it is available, otherwise I'll take my chances with a bes

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Steven D'Aprano
Matt Joiner wrote: time.timeout_clock? Everyone knows what that will be for and we won't have to make silly theoretical claims about its properties and expected uses. I don't. -- Steven ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Steven D'Aprano
7;s a lot closer to the ideal of a *strictly* monotonically increasing clock. Assuming that the system clock will never jump backwards twice in a row, the double-caching version will never have more than two constant values in a row. -- Steven ___

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-30 Thread Steven D'Aprano
if something with tick would work? (Even though it returns a float. :-) If all else fails, I'd go with turnip. I can't tell if you are being serious or not. For the record, "turnip" in this sense is archaic slang for a thick pocket watch. -- Steven __

Re: [Python-Dev] an alternative to embedding policy in PEP 418

2012-04-03 Thread Steven D'Aprano
or or AttributeError, and the caller can then fall back on an alternative, or fail, whichever is appropriate. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.

[Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-03 Thread Steven D'Aprano
veryone else in this discussion. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-04 Thread Steven D'Aprano
On Wed, Apr 04, 2012 at 03:28:34AM +0200, Victor Stinner wrote: > Le 04/04/2012 02:33, Steven D'Aprano a écrit : > >Judging by the hundreds of emails regarding PEP 418, the disagreements > >about APIs, namings, and even what characteristics clocks should have, I > >beli

Re: [Python-Dev] an alternative to embedding policy in PEP 418

2012-04-04 Thread Steven D'Aprano
esult = re.match(ham, s) except ValueError: try: result = re.match(eggs, s) except ValueError: raise ValueError('could not find spam, ham or eggs') Wow. Now *that* is ugly code. There's nothi

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-05 Thread Steven D'Aprano
rev_raw = raw _prev += delta return _prev Even if time() jumps backwards, or stays constant, monotonic() here will be strictly monotonic. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] this is why we shouldn't call it a "monotonic clock" (was: PEP 418 is too divisive and confusing and should be postponed)

2012-04-05 Thread Steven D'Aprano
u mean by "steady but not monotonic". -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] this is why we shouldn't call it a "monotonic clock" (was: PEP 418 is too divisive and confusing and should be postponed)

2012-04-06 Thread Steven D'Aprano
flaws are the whole point of access to distinct clock APIs. Different applications can cope with different flaws. I think that this is incorrect. py> time.clock(); time.sleep(10); time.clock() 0.41 0.41 -- Steven ___ Python-Dev m

Re: [Python-Dev] an alternative to embedding policy in PEP 418

2012-04-06 Thread Steven D'Aprano
Cameron Simpson wrote: On 05Apr2012 08:50, Steven D'Aprano wrote: | Although I don't like the get_clock() API, I don't think this argument against | it is a good one. Just to divert briefly; you said in another post you didn't like the API and (also/because?) it didn&#x

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-07 Thread Steven D'Aprano
seconds. Yes, milliseconds. http://www.ntp.org/ntpfaq/NTP-s-config-tricks.htm#AEN4249 In any case, NTP is not the only thing that adjusts the clock, e.g. the operating system will adjust the time for daylight savings. -- Steven ___ Python-Dev mail

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Steven D'Aprano
ut if they make it easier to read (and I think they do) then why would you not use them? -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/

Re: [Python-Dev] (time) PEP 418 glossary V2

2012-04-25 Thread Steven D'Aprano
ot; does that pretty well. Do I understand correctly that you think it is acceptable to call something monotonic regardless of whether or not it actually is monotonic? If not, I'm not sure I understand what you are suggesting here. -- Steven ___

Re: [Python-Dev] [RFC] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-27 Thread Steven D'Aprano
he perf_counter pseudocode seems a bit unusual (unPythonic?) to me. Rather than checking flags at call-time, could you not use different function definitions at compile time? 10) The "Alternatives" section should list arguments made for and against the al

Re: [Python-Dev] package imports, sys.path and os.chdir()

2012-04-28 Thread Steven D'Aprano
s.path? Of course I could manipulate sys.path. But chances are that I still have to change directory anyway, so that reading and writing data files go where I want without having to specify absolute paths. -- Steven ___ Python-Dev mailing list P

Re: [Python-Dev] [RFC] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-29 Thread Steven D'Aprano
th the os.stat result anymore? Puh-leez, that's so 1996. That really oughta be deprecated. Why? What problems does it cause? If it isn't broken, don't break it. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.

Re: [Python-Dev] Adding types.build_class for 3.3

2012-05-09 Thread Steven D'Aprano
llable go back a long time: http://stackoverflow.com/questions/3932948/ http://grokbase.com/t/python/python-list/11bhhtv95y/staticmethod-makes-my-brain-hurt http://mail.python.org/pipermail/python-list/2004-August/272593.html -- Steven ___ Python-Dev mai

Re: [Python-Dev] sys.implementation

2012-05-10 Thread Steven D'Aprano
r convention would be to prefix the optional keys with a dot, or a dash. This introduces a new convention without clashing with an existing one. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/py

Re: [Python-Dev] sys.implementation

2012-05-10 Thread Steven D'Aprano
oice between having to re-write tests once in a blue moon when there is a backwards-incompatible change to a type, and having tests randomly break every time I run them because the display is unpredictable, I know which one I prefer. +1 to Nick's

Re: [Python-Dev] sys.implementation

2012-05-12 Thread Steven D'Aprano
lue pairs without having to explicitly write them out by hand: print("spam", sys.implementation.spam) print("ham", sys.implementation.ham) print("cheese", sys.implementation.cheese) # and so on... -- Steven ___ Pytho

Re: [Python-Dev] docs.python.org pointing to Python 3 by default?

2012-05-21 Thread Steven D'Aprano
; non-trivial I expect). For someone trying to write combined 2/3 code, or > merely to learn the other version, I would think it useful to be able to > jump to the corresponding page for the other version. +1 -- Steven ___ Python-Dev mailin

Re: [Python-Dev] doc change for weakref

2012-05-25 Thread Steven D'Aprano
, but may last until garbage collection reclaims the object This is better than the previous suggestion, since it says "may" rather than implies a "will". -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.

Re: [Python-Dev] What should we do with cProfile?

2012-05-29 Thread Steven D'Aprano
it's worth merging them for 3.4. Don't let "I won't be finished in time for 3.3" stop you. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://m

Re: [Python-Dev] a new type for sys.implementation

2012-05-31 Thread Steven D'Aprano
what you want, except that some B&D coder has made it un-instantiable. Leave it undocumented and/or a single underscore name for the time being, with an aim to make it public in 3.4 if it is useful and there are no major objections. -- Steven

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-03 Thread Steven D'Aprano
renaming to be done some time in the future. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-04 Thread Steven D'Aprano
fixes or functional changes) are very likely to run at a slower pace to what third-party packages can afford. If you continue to develop regex outside of the stdlib, that could cause complications. -- Steven ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Language reference updated for metaclasses

2012-06-05 Thread Steven D'Aprano
lly, I think there is a lot confusing about metaclasses, but the idea that classes are instances (objects) is not one of them. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Steven D'Aprano
e function itself." which leaves the possibility that __signature__ may no longer match the actual argument spec, for some reason. If you remove getfullargspec, people will have to reinvent it to deal with such cases. -- Steven ___ Python-De

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Steven D'Aprano
oorknobs, and people will have to deal with their code. The case for deprecating getfullargspec is weak. The case for deprecating it *right now* is even weaker. Let's not rush to throw away working code. -- Steven ___ Python-Dev mail

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Steven D'Aprano
+1 to __eq__. I don't think we should care about them being identical. Object identity is almost always an implementation detail. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Un

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Steven D'Aprano
or, which unfortunately falls down for the simple cases of inheriting from a builtin without a custom __init__ or __new__. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Steven D'Aprano
Brett Cannon wrote: On Wed, Jun 6, 2012 at 12:16 PM, Steven D'Aprano wrote: Larry Hastings wrote: [...] "Changes to the Signature object, or to any of its data members, do not affect the function itself." which leaves the possibility that __signature__ may no longer m

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Steven D'Aprano
Nick Coghlan wrote: On Thu, Jun 7, 2012 at 8:38 AM, Steven D'Aprano wrote: Brett Cannon wrote: This is also Python, the language that assumes everyone is an consenting adult. Exactly, which is why I'm not asking for __signature__ to be immutable. Who knows, despite Larry's

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Steven D'Aprano
r the reader. self._sig = sig return sig @__signature__.setter def __signature__(self, sig): self._sig = sig @__signature__.deleter def __signature__(self): del self._sig -- Steven ___ Python-Dev mailing li

Re: [Python-Dev] #12982: Should -O be required to *read* .pyo files?

2012-06-13 Thread Steven D'Aprano
ut or function parameters. So, no, we should never use .pyo files unless explicitly told to do so, since doing so risks breaking poorly-written but otherwise working code. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.p

Re: [Python-Dev] #12982: Should -O be required to *read* .pyo files?

2012-06-13 Thread Steven D'Aprano
he bug has something to do with assert. If I receive a bug report that occurs without -O, under the proposed change I can't be sure with the optimized code or standard code is running. That adds complexity and confusion. -- Steven ___ Pytho

Re: [Python-Dev] #12982: Should -O be required to *read* .pyo files?

2012-06-13 Thread Steven D'Aprano
at now by renaming x.pyo to x.pyc. > Brett claims that it is also easy to do in 3.3 with a custom importer. That's fine. Both steps require an overt, deliberate act, and so is under the control of (and the responsibilty of) the developer. It's not something that could happ

Re: [Python-Dev] #12982: Should -O be required to *read* .pyo files?

2012-06-13 Thread Steven D'Aprano
avoidance of doubt, if my end-users secretly rename .pyo to .pyc files, that's my problem, not the Python's interpreter's problem. I don't expect Python to be idiot-proof. -- Steven ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Steven D'Aprano
reliability and usefulness of Python optimization, not increase it. -O may be under-utilized by programmers who don't need or want it, but that doesn't mean it isn't useful to those who do want it. -1 on deprecation. -- Steven ___ Python-D

Re: [Python-Dev] deprecating .pyo and -O

2012-06-14 Thread Steven D'Aprano
ation back-ends" that you can use. Until version 1.9, Ruby didn't even use byte-code at all. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/m

Re: [Python-Dev] PEP 362 Third Revision

2012-06-15 Thread Steven D'Aprano
ust to add complication, historically German used to have an uppercase ß, and in recent years some designers have started to reintroduce it. (Note: I am not a German speaker, and everything I say above is taken from Wikipedia.) -- Steven ___ Python-Dev ma

Re: [Python-Dev] PEP 362 Third Revision

2012-06-15 Thread Steven D'Aprano
r "b". The introduction of BindError will allow functions to raise a more specific, and less misleading, exception when they are called with the wrong number of arguments, or invalid keywords, etc. -- Steven ___ Python-Dev mailing list Pyth

Re: [Python-Dev] PEP 362: 4th edition

2012-06-15 Thread Steven D'Aprano
ot needed. 2. Should 'Signature.format()' instead of 7 or so arguments accept just a SignatureFormatter class, that implements all the formatting logic, that is easy to override? -1 It is easier to pass different arguments to a function than it is to subclass and modify a c

Re: [Python-Dev] Tunable parameters in dictobject.c (was dictnotes.txt out of date?)

2012-06-18 Thread Steven D'Aprano
onary sparseness, number of hits and misses, etc. from Python? A secret command-line switch, perhaps, or a compile-time option? And if there isn't, perhaps there should be. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.

Re: [Python-Dev] PEP 362: 4th edition

2012-06-18 Thread Steven D'Aprano
nce? I presume you mean the later, a Signature instance, and not cache it in __signature__. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 362: 4th edition

2012-06-18 Thread Steven D'Aprano
o just describe it as a "copy" rather than a deep copy, unless you recursively copy everything all the way down. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] pep 362 - 5th edition

2012-06-20 Thread Steven D'Aprano
optional arguments. I think equality should be strict, including names, and we should defer any decision about less-strict comparisons until 3.4, when we'll have more solid use-cases for it. I guess that's a long-winded way of saying +1 :) -- Steven __

Re: [Python-Dev] PEP 362 minor nits

2012-06-20 Thread Steven D'Aprano
there anything needed to make signature() work correctly with custom method-like descriptors such as this? http://code.activestate.com/recipes/577030-dualmethod-descriptor -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail

Re: [Python-Dev] [Python-ideas] itertools.chunks(iterable, size, fill=None)

2012-07-05 Thread Steven D'Aprano
bed as chunks. This might be a good candidate for a utility module made up of assorted useful functions, but not for the string and sequence APIs. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/py

Re: [Python-Dev] [Python-ideas] itertools.chunks(iterable, size, fill=None)

2012-07-05 Thread Steven D'Aprano
#33 "How do you split a list into evenly sized chunks in Python?" 149 votes #36 "Accessing the index in Python for loops" 144 votes Being 33rd most voted question doesn't really mean much. By the way, why is this discussion going to both python-dev and python-ideas

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Steven D'Aprano
e allowed to return None to indicate "don't know" or -1 to indicate "infinite". Presumably anything that wishes to create a list or other sequence from an object with a hint of -1 could then raise an exception immediately. -- Steven

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Steven D'Aprano
; is more useful than caring about the difference between a hint of 0 and a hint of 1. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Steven D'Aprano
mode? No, of course not. But just because you can't prevent *every* problem doesn't mean you should prevent the ones which you can. [1] I think. I'm sure I read this somewhere in the docs, but I can't find it now. -- Steven

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Steven D'Aprano
ws are a documentation issue. Just tell the user not to overwrite memory they don't mean to, and let them shoot themselves in the foot if they want. *wink* -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Steven D'Aprano
Steven D'Aprano wrote: With a length hint, we could strengthen that promise: "if __length_hint__ returns a negative number, list, tuple and set will fail immediately with MemoryError" which I think is a good safety feature for some things which cannot possibly succeed, but r

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Steven D'Aprano
already exists and is already used, we should probably hear from somebody who knows how it is used and what problems and/or benefits it leads to. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/list

Re: [Python-Dev] A new JIT compiler for a faster CPython?

2012-07-17 Thread Steven D'Aprano
tly. As far as I can tell, in the Python world byte-code optimization is a severely neglected area. For good reason? No idea. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: ht

Re: [Python-Dev] Use function names instead of functions for os.supports_dir_fd?

2012-07-17 Thread Steven D'Aprano
assing both the name or the function object itself. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] [compatibility-sig] do all VMs implement the ast module? (was: Re: AST optimizer implemented in Python)

2012-08-13 Thread Steven D'Aprano
yPy, CLPython, etc. and future implementations? Perhaps ast should be considered a quality of implementation module. Lack of one does not disqualify from being "Python", but it does make it a second-class implementation. -- Steven ___ Python-Dev

Re: [Python-Dev] 3.3 str timings

2012-08-21 Thread Steven D'Aprano
https://bitbucket.org/haypo/misc/src/tip/python/benchmark.py I am surprised, because the whole purpose of timeit is to time micro code snippets. If it is as unstable as you suggest, and if you have an alternative which is more stable and accurate, I would love to see it in the standard library. -- S

Re: [Python-Dev] Unicode support of the curses module in Python 3.3

2012-09-01 Thread Steven D'Aprano
is clearly and obviously documented? -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Python 1.5 output file versions

2012-09-19 Thread Steven D'Aprano
file version to every pyo file without writing a variable inside every py file that holds it? I'm afraid I don't understand what you are actually asking here. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/m

Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

2012-09-20 Thread Steven D'Aprano
also missing. I think it is perfectly acceptable to not report the missing 'b' until the missing 'a' is resolved. But I do expect error messages to be accurate. +1 to remove the word "positional" from the message. -- Steven _

Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

2012-09-20 Thread Steven D'Aprano
calling semantics to infer that therefore it can be given as positional or keyword style. Since this is way too complicated to encapsulate in a short error message, I'm with Nick and Mark that "positional" should be dropped unless the argument is positional-only. -- Steven ___

Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

2012-09-20 Thread Steven D'Aprano
ositional-or-keyword arguments, just use an unqualified "argument". -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] TypeError: f() missing 1 required positional argument: 'x'

2012-09-20 Thread Steven D'Aprano
'aardvark', 'halibut' and keyword-only arguments 'shrubbery', 'parrot', 'wafer_thin_mint' but wouldn't strongly object. I think it is acceptable (although not ideal) if calling f() only reported the first missi

Re: [Python-Dev] "Decimal(2) != float(2)"???

2012-09-29 Thread Steven D'Aprano
unwary, due to binary floats, e.g. Decimal("0.1") != 0.1 -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Benchmarking Python 3.3 against Python 2.7 (wide build)

2012-09-30 Thread Steven D'Aprano
n timeit, the timeit docs warn against taking any statistic other than the minimum. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Should vars() return modifiable dict?

2012-10-03 Thread Steven D'Aprano
s to the dict will also change the object's slot attributes. I find myself unable to choose between 2) and 4), which suggests that the status quo wins and we keep the current behaviour. -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Should vars() return modifiable dict?

2012-10-05 Thread Steven D'Aprano
ting to locals has no effect ... locals()['y'] = 3 # except when it does... ... print(x, locals()) ... py> test() 1 {'y': 3, 'x': 1} -- Steven ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

[Python-Dev] Issue 8492 [was Re: [Python-dev] History stepping in interactive session?]

2012-10-07 Thread Steven D'Aprano
s any direct mechanism for querying the current readline bindings in Python, But it was requested some time ago: http://bugs.python.org/issue8492 Is there anyone willing and able to give this issue some attention please? (Replies to python-dev only please.) -- S

<    12   13   14   15   16   17   18   19   20   >