rError("Invalid int")
else:
result = computation(i)
makes it obvious that control can't fall off the
end of the except branch.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Chris Angelico wrote:
On Sat, Feb 22, 2014 at 10:57 AM, Greg Ewing
wrote:
I'm still not convinced it would be all *that* difficult.
Seems to me it would be semantically equivalent to
renaming the inner variable and adding a finally clause
to unbind it. Is there something I'm mis
ey not being in the
dictionary. The actual behaviour is correct, IMO,
because it avoids masking bugs, so this could probably
be worded better.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsu
were able
to hold a line number.
As it was, I had to create an entire fake Frame object
filled with mostly dummy values, just to get line
numbers printed in the traceback.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org
!
The downside is that we'll get endless complaints
from jmfauth about the Flexible Version Number
Representation. :-(
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscr
MRAB wrote:
What does "irregardless" mean?
It's what people say when they misunderestimate the
importance of correct prefix usage in English.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/
t oriented implementation" API
design model in PEP 8,
I don't think I would call this a "procedural" API. To my
mind, any API that exposes objects with methods is an
object-oriented API, whether it encourages subclassing those
objects or not.
--
Greg
Christian Heimes wrote:
Can the NAO bot do The Silly Walk (tm), too?
From what I gather, making robots do *non*-silly walks
is the hard part.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python
argument? That seems sufficient for debugging
purposes to me.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Alexander Belopolsky wrote:
I meant ISO 8601 syntax for "durations" [1].
ISO 8601 doesn't seem to define a representation for
negative durations, though, so it wouldn't solve the
original problem.
--
Greg
___
Python-Dev mai
three. A dedicated PyArrayMethods
struct can replace some if not all of these allocations.
I don't see how. NumPy arrays allocate all three because
they override just about every method in existence. Adding
another struct isn't going to eliminate the need for the
existing ones
Victor Stinner wrote:
I started to implement the RFC 1924 to have a full support.
3 days later, when my code was working, I saw the date of the RFC...
Do you still have the code? It needn't go to waste -- this
would make a fine addition to Python's easter egg basket
args would mean explicitly passing them on to the base __init__,
further cluttering up the code.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
something I'm doing wrong?
Thanks
Greg Mildenstein
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Guido van Rossum wrote:
Some quick thoughts:
- I'd prefer a name that plays on 2 and 3, not 2 and 8. :-)
Python Twee?
Or maybe Python Tween, as in "between 2 and 3".
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://
he word "consume" as though it were a synonym for "use".
It's not.)
When-I-consume-a-word-said-Humpty-Dumpty-ly,
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscr
recognise dicts and do the appropriate
thing for the Python version concerned. If it doesn't recognise the
type, it would fall back to a generic implementation like
for k in d:
v = d[k]:
...
--
Greg
___
Python-Dev mailing list
Chris Angelico wrote:
add_HTTP_header
add_http_header
addHTTPHeader
addHttpHeader
Five... there are FIVE options...
convertXMLtoJSON
i.e. don't capitalise a part that follows capitalised
initials.
--
Greg
___
Python-Dev mailing list
Pytho
guess would be that it
wasn't considered worth the effort, if it was considered
at all.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/option
a mutating method than a non-mutating
one, so it's less likely you'll make a mistake.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
nts
(maybe being an int subclass?) allowing them to be used
in any existing algorithm that slices strings using ints.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail
as been pointed out, fitting
Python onto a small device is always going to necessitate
some compromises.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailma
ython codepoint indexing via integers.
That's true, although most programs would have to go
out of their way to tell the difference, especially if
StringPosition were a subclass of int.
I agree that cacheing indexes would be more transparent,
though
you should really walk each string
individually.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
the outside world
at all.
The
rationale of internal UTF-8 is that the use of any other encoding
internally will be inefficient since those strings will need to be
transcoded to UTF-8 before they can be written or printed,
No, I think the rationale is that UTF-8 is likely to use
less memory t
ry
elision.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
than a type flag.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
,
Python 3 bytes and Python 2 str, but it's far from
clear what you want this type to be like.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/op
ser's native language.
E.g. this document lists a big pile of hex byte values
and little or no text that I can see:
https://law.resource.org/pub/us/cfr/ibr/005/sae.j1979.2002.pdf
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://
ially being
overwritten whether it's okay to overwrite it?
I.e. a parameterless method returning a boolean.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.
necessary to do so, after all.
This would also make it possible for the inplace
operators to have different semantics from temp-elided
non-inplace ones if desired.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman
ways use /bin/sh, NOT the user's current login shell,
for this very reason.
I would hope that the Python versions of these, and also
the new subprocess stuff, do the same.
That still leaves differences between Unix and Windows,
but explicitly naming the shell
Fabio Zadrozny wrote:
Well, I must say that the exec(open().read()) is not really a proper
execfile implementation because it may fail because of encoding
issues...
It's not far off, though -- all it needs is an optional
encoding parameter.
--
ich
doesn't use PATH.
This seems like an unfortunate platform difference to me. It
would be better if PATH were searched on both platforms, or
better still, make it an option independent of shell=True.
--
Greg
___
Python-Dev mailing list
Py
Paul Moore wrote:
Huh? CreateProcess uses PATH:
Hmm, in that case Microsoft's documentation
is lying, or subprocess is doing something itself
before passing the command name to CreateProcess.
Anyway, looks like there's no problem
'd choose to use parentlocal instead of nonlocal with an
explicit assignment in the outer scope. Except maybe for the
class-scope situation, which seems like an extremely obscure
reason to introduce a whole new scoping concept with its
own keyword.
--
Greg
___
about the *scopes* in which
those iterators are evaluated, however.
Currently the only situation where the scoping makes a difference
is a generator expression that isn't immediately used, and you can
get a long way into your Python career without ever encountering
that
new keyword) whose justification is very little more
than "it makes explaining comprehension scopes easier".
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscri
cular case.
Like maybe adding an "as" clause to if-statements:
if pattern.match(s) as m:
do_something_with(m)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
like
[x for i in range(5) letting x = x + 1 given x = 0]
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
silently instead of
producing an ugly message. That would remove the source of pain
that's leading people to do this.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https:
They
also provide an opportunity to make the error of not making them
the same when they should be, and add the maintenance burden
of ensuring they stay the same when changes are made.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.
he sense that the others do. So maybe
"generator expression" is the best we could have done.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
first three after
you've run the iterators within it, but with a generator
expression, you already have a generator before you've
run it. That makes it feel different to me.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://
just codifies
a way of using them to represent types.
Also, PEP 484 does specify a way of using comments to
indicate types.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
from BASIC AFAIK which was geared towards regular users who don't
> deal with advanced mathematics.)
Criticising something because it comes from BASIC smacks of snobbery.
Anyway, it's also used by a number of entirely respectable languages
such as Pascal and SQL.
And what proportio
t was more or less a matter of "Guido wanted it that way".
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
uot;argument clinic on steroids" is actually a pretty
good description of Pyrex.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
what users want in most
cases
I don't think that's common knowledge; seems like citation needed?
It's not common enough for me to have heard of it before.
(BTW, how do you provide a citation for "common knowledge"?-)
--
Greg
I don't really get the statistical argument. If you're doing something
like calculating an average and care about accuracy, why are you rounding
the values before averaging? Why not average first and then round the
result if you need to
ou're doing.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
nt) you have to care about bias.
If I'm paying off a loan, it's what the bank calculates that
matters, not what I calculate. And I hope the bank isn't
relying on the vagaries of Python floating point arithmetic
for its critical financial calculations.
--
Greg
___
sents a value between
5 and 6 seconds.
So if you're fussy about rounding, you might want to round
clock readings differently from measurements on a ruler.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listi
My take on this is that os.system() is there because it's part
of the C stdlib, and Python generally aims to provide wrappers
for all of the C stdlib facilities. It's not Python's place to
start making value judgements about which things are worthy of
being wrapped and which a
When I have a bug that only happens after hours of run
time, I try to find a much shorter test case that reproduces
it.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https
Steven D'Aprano wrote:
The Debian box uses an ARM processor, so there's that difference too.
FWIW, I tried this on MacOSX 10.6 with an Intel Xeon and it also
seems to suppress sNaNs.
--
Greg
___
Python-Dev mailing list
Python-Dev@python
make and model (e.g. a 2007 Toyota
Corolla Ascent Sedan)
- the object value is a specific car (e.g. "that white Corolla over
there with 89000 km on the odometer")
A bit confusing, because "that white Corolla over there" is referring
to it
Chris Angelico wrote:
Licence plate numbers do get reused.
And they can change, e.g. if you get a personalised plate.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https
code that does anything with the address of an object
other than just pass it around is going to depend heavily on
the Python implementation being used, so the idea of an
implementation-independent way to deal with object addresses
seems problematic.
--
Greg
___
ill exists, after which it can get re-used for a different
object. So when an object is flushed from your cache, you would have
to chase down all the places its id is being stored and eliminate them.
Are you sure you couldn't achieve the same thing more safely using
weak refer
e for the docs
to talk about addresses in relation to id() -- it seems to
have given some people unrealistic expectations.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
an just call it:
>>> obj = (1,2,3)
>>> obj
(1, 2, 3)
>>> p = ctypes.py_object(obj)
>>> p
py_object((1, 2, 3))
>>> p.value
(1, 2, 3)
>>> p.value is obj
True
--
Greg
___
Python-Dev mailing list
Pyth
Stefan Behnel wrote:
So … are you suggesting to use the webbrowser module inside of the REPL to
look up the exception message of the previously printed stack trace in
stack overflow when a user types "why()"?
"Python is searching for an answer to your questi
f the compiler is smart enough, it can often arrange
the evaluation of the parameter expressions so that the results
end up in the right registers for making the call.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/lis
Joe Jevnik via Python-Dev wrote:
If Python switched to a global
stack and global registers we may be able to eliminate a lot of
instructions that just shuffle data from the caller's stack to the
callee's stack.
That would make implementing generators more complicated
Victor Stinner wrote:
LOAD_CONST_REG R0, 2 (const#2)
LOAD_GLOBAL_REG R1, 'range' (name#0)
CALL_FUNCTION_REG4, R1, R1, R0, 'n'
Out of curiosity, why is the function being passed twice here?
--
Greg
___
Python-Dev
Victor Stinner wrote:
Using a different register may require an explicit "CLEAR_REG R1"
(decref the reference to the builtin range function) which is less
efficient.
Maybe the source operand fields of the bytecodes could
have a flag indicating whether to clear the register
after use
s kind of an obvious thing to do.
You can argue about how far the analogy should be taken, but
you can't blame people for noticing the similarity.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/pytho
l the things that
non-idempotency could break, it would be easier to simply
document that idempotency is assumed.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.pyth
n any case, the word is easy enough to avoid in this case.
We could say something like:
"The optionxform function transforms option names to a
canonical form. If the name is already in canonical form,
it should be returned unchanged."
--
Greg
__
e other program.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Antoine Pitrou wrote:
On Wed, 20 Mar 2019 11:25:53 +1300
Greg Ewing wrote:
So use NamedTemporaryFile(delete = False) and close it before passing
it to the other program.
How is it more secure than using mktemp()?
It's not, but it solves the problem someone suggested of another
progra
.
Why is this being deprecated, instead of keeping it and making
it always 32 bits? It seems like useful functionality that can't
be easily obtained another way.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/ma
Christian Heimes wrote:
I couldn't find any current code that uses PyInstanceMethod_New. Let's
deprecate the feature and schedule it for removal in 3.10.
If it's designed for use by things outside of CPython, how
can you be sure nothing is usi
the correct result
-1.
This sounds like a bug in that platform's implementation of
expm1() to me. Which platform is it?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
number of separate features
that can be enabled individually?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail
would be harder to pull off for statically allocated objects,
although probably not impossible.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/opt
up to 9, or we feel like it, whichever
comes first."
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Chris Angelico wrote:
Except that it does. After calling locals() a second time, the result
of the *first* call will be updated to reflect changes.
Yeow. That's *really* unintuitive. There had better be an extremely
good reason for this behaviour.
--
x27;s* happening, but not *why* it was designed
that way. Would it really be probihitively expensive to create a
fresh dict each time?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
when tracing.
If the change to the behaviour of exec() and eval() is a concern,
then perhaps there should be a new localsview() function that
returns a mutable view, with locals() redefined as dict(localsview()).
--
Greg
___
Python-Dev mailing list
P
Nick Coghlan wrote:
Having a single locals() call de-optimize an entire function would be
far from ideal.
I don't see what would be so bad about that. The vast majority
of functions have no need for locals().
--
Greg
___
Python-Dev mailing
the ugliness of maintaining all the
fast/locals swapping stuff, not because of any principle that
the current behaviour is right or better in any way.
Given a locals proxy object, it would be much easier to support
the old behaviour (which seems obvious and correct to me) without
eval or exec
using some of its dynamic features. Removing features
entirely just because they *can* interfere with these things goes
against the spirit of the language, IMO.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listin
Armin Rigo wrote:
You have the occasional big function that benefits a lot from being
JIT-compiled but which contains ``.format(**locals())``.
There should be a lot less need for that now that we have f-strings.
--
Greg
___
Python-Dev mailing list
, and don't
also change a bunch of other things to the point that the new
version won't work on the same system that the old one did.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@
thon really should slap you on the ear and
make you specify exactly what you want.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.p
han having code appear to
work while doing something subtly different from what you wanted.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/li
o return one of `None`, `False`, or
> `True`?
No, it's possible for == to return almost anything (numpy arrays
return an array of booleans, for example). It just happens that
NotImplemented can't be returned, because it has a special
me
ready perfectly good ways to express those:
set(d1.values()) == set(d2.values())
list(d1.values()) == list(d2.values())
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://
is the one
the programmer intended. And we know what the Zen has to say about
guessing.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/pytho
-write that code to be explicit about what
is really wanted. There is no three-valued logic involved here.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailm
e algorithm for
comparing their values()?
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://
Rob Cliffe via Python-Dev wrote:
Sorry, that won't work. Strings are parsed at compile time, open() is
executed at run-time.
It could check for control characters, which are probably the result
of a backslash accident. Maybe even auto-correct them...
--
They seem to have a knack for making tricky stuff understandable.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Me
structure -- it was all in the directory entry.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https
be one of its
strengths.
I worry that adding four layers of clever speedup tricks will
completely destroy this simplicity, leaving us with something
that can no longer be maintained or contributed to by
ordinary mortals.
--
Greg
___
Python-Dev mailing list
te the *test* so that it fails. You write a proper test, and it
fails initially because you haven't yet written the code that it tests.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le
s kind of weird that just looking at data on the
disk can change something about it. Sometimes it's an
advantage to *not* have quantum computing!
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-d
r choosing a statement, not an expression?
Which is a *much* better way to say what I think you were trying to
say.
--
Greg
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.py
301 - 400 of 2499 matches
Mail list logo