ix it.
--
Greg
___
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
x27;t think this ought to increase the stat call
count, since the interpreter will always be looking
for a particular version of bytecode, so it can
just stat for the appropriate subdirectory
directly.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
ion of use cases to ignore the fact that the
cancel failed and carry on regardless. If not, then raising an
exception makes it much harder to accidentally ignore the
situation.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.o
thing meaningful in debugging output.
But it also doesn't hurt to export named constants for them,
in the interests of catching typos.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
27;ve been thinking for a while that it would be a big help
if there were one, standardised module in the stdlib for
handling async events, and all the other gui toolkits
etc. were made to use it.
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
of the arguments is not a guaranteed part of the API.
There isn't necessarily any need to enforce that, though.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.
is built, not the order
of matching in a list of rules).
--
Greg
___
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
Michael Foord wrote:
Wouldn't it have to be the Tcl event loop then?
No, tcl/tk would have to be threatened with the comfy chair
until it allowed itself to be spliced into the official
event loop somehow.
--
Greg
___
Python-Dev mailing list
P
Mark Russell wrote:
Boolean flags are a common enough case that I'd be inclined to add a wrapper
method,
parser.add_bool_argument('--plot')
+1, this looks good.
--
Greg
___
Python-Dev mailing list
Python-Dev@
Steven Bethard wrote:
Because the names are so long and you'd have to import them, I've left
them as private attributes of the module, but if there's really
demand, we could rename them to argparse.StoreTrueAction, etc.
What's wrong with just
natural way to write things even if
you don't care about the order, but you need all the results
before proceeding. You're going to be held up until the
longest-running task completes anyway, so it doesn't matter
if some of them finish earlier and have to sit around
waiting for
some such instead of an Action:
parser.add(options.Bool('--plot'))
--
Greg
___
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
ou could achieve the same thing just by
assigning to a name in a module.
In other words, instead of inventing your own mechanism for
managing a namespace, just use a module as your namespace.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http:
X, it makes it impossible
to look inside using the Finder if you want to, and it won't
have any effect on Windows anyway.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
in 2.7 to match
the current 3.x behaviour.
--
Greg
___
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 be explicit about how to do it.
--
Greg
___
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
nimum-digits basis.
--
Greg
___
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
ed number of decimal digits available,
which you always do at any given moment with the Decimal
type.
And even if there are enough digits, an exact conversion
mightn't be what you really want. This problem doesn't arise
with int->float conversion -- there is only one obvious wa
hon 2.5.4 (r254:67916, May 15 2009, 15:21:20)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2j < 3+4j
Traceback (most recent call last):
File "", line 1
half the problem, though? Even if
you find that the hashes are equal, you still have to decide
whether the values themselves are equal.
Is there some similarly clever way of comparing two
rational numbers without having explicit access to the
numerators and denominators?
--
Antoine Pitrou wrote:
We forbid comparisons when there is a real danger or ambiguity, such as unicode
vs. bytes. There is no such danger or ambiguity when comparing a decimal with a
float.
So do you think that float("0.1") and Decimal("0.1") should be
equal or no
equality.
--
Greg
___
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
rational numbers,
which can be done without loss of precision.
--
Greg
___
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
.. despite some misguided souls
occasionally storing them in floating point. :-)
--
Greg
___
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/arch
float->float appears better, there
seems to be another one for which Decimal+float->Decimal
appears better.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.pyth
produce an inexact result. It's
not like an int or Fraction where the result can expand
to whatever size is needed.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Nick Coghlan wrote:
Note that Antoine's point was that float("0.1") and
Decimal.from_float(0.1) should compare equal.
That would mean that Decimal("0.1") != float("0.1"), which might be
surprising to someone who didn't realise they w
on't get a chance to
do anything else, so something outside of __getattribute__ must
catch the AttributeError and calling __getattr__. So I think the
docs *are* specifying the behaviour here, if only by implication.
--
Greg
___
Python-Dev mailing
Nick Coghlan wrote:
int -> Decimal -> Fraction -> float -> complex
I don't think it's a good idea to put Decimal below Fraction,
because Decimal has to be considered an implicitly inexact
type like float, and we don't want to coerce from an inexact
typ
ppened to get a float mixed in somehow.
There is no way of distinguishing between these
automatically.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/
every decimal
value would have a flag indicating whether it was
tainted with inexactness, and this flag would propagate
through calculations.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
we're talking about would be done to whatever precision
is set in the context. Am I wrong about that? Is the intention
to always use enough digits to get an exact representation?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.
cimal operation is going to do. It's probably justified in
this case, though.
--
Greg
___
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
cimal operation is going to do. It's probably justified in
this case, though.
--
Greg
___
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
oating point numbers have limited
precision. What really surprises people is when *binary*
floating point numbers behave differently from the decimal
ones they're used to.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.or
for Decimals
concern operations between two Decimals, and we have a
Decimal and a Fraction here, so all bets could be considered
off.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsub
Cowlishaw
appears to mean by "numbers are exact" is that Decimals
represent particular values, not *intervals*.
This is not really the same thing as the notion of inexact
numbers in the numeric tower. There, it means more like
"this number may not quite represent the value the programm
taller? I don't like the
idea of being required to use an installation tool in order to
get .pyc files.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.o
there, the attacker would have
to be capable of either changing the owner of the parent
directory or removing it and replacing it with a different
one, and if he can do that, he can do whatever he wants
anyway.
--
Greg
___
Python-Dev mailing list
Pytho
ncorrect to say that "__getattribute__
raises an exception".
When we say that a function raises an exception, we normally
mean that the exception propagates out of the function and
can be seen by the caller, not that it was raised and caught
somewhere insi
Mark Dickinson wrote:
It might make sense for
Decimal + complex mixed-type operations to be disallowed, for example.
As long as you're allowing Decimal-float comparisons,
Decimal-complex comparison for equality has an obvious
interpretation.
--
Antoine Pitrou wrote:
Having the Web server execute ad hoc system
administration code is far from elegant and user-friendly.
With the right piece of code, you could create yourself
a setuid-apache shell and solve this problem once and for
all. :-)
--
Greg
ain* one.
Personally I would benefit most from it during development.
I hardly ever look in the directories of installed packages,
so I don't care what they look like.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/ma
u can get it to make a
copy of /bin/sh and suid it.
Of course, if you have permission to su apache, then this
is not necessary. But then you wouldn't have to go through
web server contortions to fix apache-generated botchups
either.
--
Greg
___
Pyt
to me.
--
Greg
___
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
.e. __pycache__ could
be created but nothing could be written to it because of a
umask issue.
If you install in a shared site-packages by dragging, you
already have to be careful about setting the permissions. You'd
just have to be sure to extended that diligence to any
contained __pycache__ d
tribute__ won't call __getattr__ on
its own.
I concede that the wording could be improved to remove any
possibility of doubt, though.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-de
Isaac Morland wrote:
the
benefit to me and to Greg and to others writing .py code is that our
directories will contain *.py and __pycache__, rather than *.py and
*.pyc. So it will be much easier to see what is actually there.
Yes. When using MacOSX I do most of my work using the
Finder
(I don't think that should be the case, BTW -- complex
numbers live on a two-dimensional plane, and from a
geometrical point of view there's no reason to single
out the x-axis and give it special treatment.)
--
Greg
___
Python-Dev mailing l
#x27;s a *sane* compromise I'm not sure.
--
Greg
___
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
algorithms exist that benefit from Nan == NaN being
false, so it's fair to ask for examples to back
that up.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.pyt
he payload of a NaN in typical hardware implementations
is quite small, because it has to fit into the exponent
field.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.pyt
27;re *not* the
same person, because it's meaningless to say *anything*
about the properties of nonexistent people.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http:
That gives
us enough flexibility to make == do what we want and still
claim compliance with the standard.
BTW, does IEEE754 give us the same flexibility? If so,
we may not have much of a problem in the first place.
--
Greg
___
Python-Dev mailing list
Python
sting. :-)
--
Greg
___
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
Steven D'Aprano wrote:
I disagree -- if I ask:
3.0 in [1.0, 2.0, float('nan'), 3.0]
I should get True, not an exception.
Yes, I don't think anyone would disagree that NaN should compare
unequal to anything that isn't a NaN. Problems only arise when
com
in alphabetical
order for quick scanning.
Since I suspect this is most people's main use for
dir(), I think it's a good enough reason for leaving
things as they are.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyt
ace them with another function called something like
scope(). It would return a mapping object that looks up
names in the current scope. It could also improve on locals()
by being writable.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.
e that you'd be taking on a very
challenging project -- at least if you intend the compiled
code to be substantially faster than interpretation.
You should also check out what others have been doing in
this area: PyPy, Cython, Unladen Swallow.
--
Greg
__
.
--
Greg
___
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
few locals, in which case
building a dict containing all of them would be wasteful.
--
Greg
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/
ate of
the art, you first need to find out what the state of the art
is.
--
Greg
___
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/arch
ocals view" object shouldn't be too much
harder.
If it can't, then you have already given up full CPython
compatibility.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
were
successful, I'd be interested in using it!
--
Greg
___
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
create the appropriate
backend to target the machine in question. I wouldn't like
to rely on a generic C-generating backend to target something
very tiny in an effective way.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pytho
ss.py
Traceback (most recent call last):
File "traceback_class.py", line 8, in
print tb.__class__
AttributeError: __class__
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Uns
Nick Coghlan wrote:
I'm not sure what build you're getting that behaviour on, but my svn
build of 2.6 has a __class__ attribute for traceback objects,
It's 2.6.1. Guess it's been fixed since then.
--
Greg
___
Python-Dev mai
is subject to uncertain delays, so how long do you wait for
a reply before deciding that the connection is dead? If you
don't wait long enough, you could end up killing a connection
that would have come back if you had waited longer.
--
Greg
___
Python
t the normal
"./configure; make; make install" sequence works fine without
any further intervention.
If you want a framework installation you have to read the
README and use a couple of extra options, but it still works
very smoothly.
--
Greg
___
says "TypeError: Keyword dict contains non-string
keys", but upon examination, the dict clearly does not contain
any such thing?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Uns
en you understand
exactly what's going on, it's annoying having to make the
mental adjustment every time.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.py
x27; is the traditional term used
when talking about that. I can't think of anything that would
be more accurate without being excessively verbose or pedantic.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
o call the function
underlying the bound method, at which point it can't be
distinguished from any other way of calling it.
However, it could be made to raise a special subclass of
TypeError that the bound method wrapper could catch and
replace with its own exce
no longer exist in Py3, so you would get
the standard message about incorrect number of arguments
instead. Not sure whether that's better or worse in this
situation.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mail
for stdlib inclusion.
--
Greg
___
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
for Python. Slavishly
copying an API from another language is often not the best
approach when designing an API for a Python module.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
much discussion there is and how much
apparent agreement is reached, it's no substitute for
practical experience. Often API design mistakes are only
found when trying to use the library for real.
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
Andrew Svetlov wrote:
BTW, is 'cancelled' correct name? Spell-checkers likes only single 'l'
form: 'canceled'.
I think this is an English vs. American thing. Double 'l'
looks right to me, but then I was brought up as a loyal
subject of the antipodean br
ve more than one Executor active
at a time? The fact that as_completed() is a module-level
function rather than an Executor method suggests that it
is, but it would be good to have this spelled out one
way or the other in the PEP.
--
Greg
___
Python-Dev
arily going to be easy for him to follow.
* Is it possible to have more than one Executor active
at a time?
Of course.
That's good, but I don't think that the "of course" is at
all obvious, considering that things such as GUI
op-level code is
screwy in the first place. Are there any use cases for
it? Maybe the second scope argument to exec() should
be deprecated?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
ks to finish
to explicitly wait for that to happen.
Also, automatically doing (2) would seem to make it
difficult for a program to bail out if something
unexpected happens. It would have to explicitly
shut down the thread pool instead of just letting
an exception prop
ather than adding another
module that provides almost exactly the same thing with
different options?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/op
On 27/05/10 11:33, Michael Foord wrote:
On 27/05/2010 00:38, Greg Ewing wrote:
Maybe the second scope argument to exec() should
be deprecated?
Sounds good to me, certainly ends the confusion over this undoubtedly
unintuitive behaviour. :-)
Although it's a fair point that it can be u
.
I was referring to the issue of ThreadPool vs. ThreadPoolExecutor
etc. By your own argument above, concurrent.futures.ThreadPool is
quite descriptive enough of what it provides. It's not a problem
if some other module also provides something called a ThreadPool
fell out of the
implementation. The function in the interpreter that
executes code objects requires two namespaces as
arguments, and they were both exposed via exec just
in case anyone found a use for them.
--
Greg
___
Python-Dev mailing list
Python-Dev
.
--
Greg
___
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
= dict(__builtins__ = stuff)
exec(code, g)
del g['__builtins__']
--
Greg
___
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
son I'd
use such a module rather than just spawning a thread myself
for each task.
--
Greg
___
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
Nick Coghlan wrote:
We can accept PEP 3148 by saying that we're happy to add the extra
namespace level purely for disambiguation purposes,
If that's the only rationale for the namespace, it makes it
sound like a kludge to work around a poor choice of name
x27;t set up, because code further along the tp_dealloc
chain may rely on it. That includes fields in the object
header.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://ma
Guido van Rossum wrote:
bind the instance to the first argument when it
is called on an instance. I can't think of a good name for that one
right now, but we'll think of one.
dynamicmethod?
--
Greg
___
Python-Dev mailing list
Python-Dev@
left out of the ABC ecosystem. No worse than what
happens to any other existing user-defined class that
predates ABCs -- if people want them to inherit from
ABCs, they have to update their code. In this case, the
update would consist of changing subclasses to inherit
from list or dict instead.
--
Ronald Oussoren wrote:
That's because setgroups(3) is limited to 16 groups
> (that is, the kernel doesn't support more than 16 groups at all).
So how does an account being a member of 18 groups ever work?
--
Greg
___
Python-Dev mailin
.
Not exactly the same, but closely related.
--
Greg
___
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
tract string-access API would have to
be devised, and all existing C code updated to use it. Also,
this new API would not be as easy to use as the number API,
because it would involve asking for the data in some specified
encoding, which would require memory allocation and management.
--
ython with UTF-8 as the internal string representation?
--
Greg
___
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
Stefan Behnel wrote:
Greg Ewing, 26.06.2010 09:58:
Would there be any sanity in having an option to compile
Python with UTF-8 as the internal string representation?
It would break Py_UNICODE, because the internal size of a unicode
character would no longer be fixed.
It's not fixed a
e memory. If they do that, they
also need to deal with sequence items not corresponding
to characters. If they can handle that, they may be able
to handle utf-8 just as well.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.
ressed into service as an
infix operator, with
s...@i
being equivalent to
s[i:i+1]
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/
901 - 1000 of 2499 matches
Mail list logo