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.
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
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
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
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
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:
), 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
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
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:
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 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
__
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
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
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
.
(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
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
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
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
_
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
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
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
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
___
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
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
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
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@
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','
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
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
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
___
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
__
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.
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
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
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
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
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
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
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
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
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/
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
___
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
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
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.
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
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
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
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
; 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
, 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.
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
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
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
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
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:
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
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
+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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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.
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
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
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
__
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
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
#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
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
; 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
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
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
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
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
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
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
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
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
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
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
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
_
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
___
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
'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
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
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
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
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
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
1601 - 1700 of 1900 matches
Mail list logo