hout any
noise characters in them.
--
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
made?
Also, cacheing isn't the only thing to consider.
Last time I looked at the implementation of unix
file systems, they mostly seemed to do directory
lookups by linear search. Unless that's changed
a lot, I have a hard time seeing how that's
going to beat Python's high
sing a
datatype with a user-supplied dispatch table?
--
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
ct the vast majority of Python programs don't
need to track changes to the set of importable modules
during execution. The exceptions would be things like
IDEs, and they could do a cache flush before reloading
a module, etc.
--
Greg
___
Python-Dev
cache
> files used internally by the interpreter for speed reasons only, and
> bytecode files that can be shipped and imported.
That's a possibility.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/li
you think
the file is in. That might wipe out most of the
advantage.
It would be different on platforms which provide a
way of "watching" a directory and getting notified of
changes. I think MacOSX, Linux and Windows all provide
some way of doing that nowadays, although I'm not
f
to import it for the first time.
So I don't think there would be any visible change as
far as most people could tell.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://ma
fine, else the module doesn't exist.
BTW, I'm not thinking of cacheing individual directories,
but scanning all the directories and building a single
qualified_module_name -> pathname mapping. If the cache
gets invalidated, all the directories along the path
are re-scanned, so a ne
n-hidden location such as ~/local
seems just as good and less magical 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
applications
or libraries or whatever are even there in the first
place. You've got all this disk space being used up,
but no way of seeing where or by what, and no
obvious way of freeing it up. I think that's bad HCI.
--
Greg
___
Python-D
Steve Holden wrote:
> So the subgroups are numbered starting from
> 1 and subgroup 0 is a special case which returns the whole match.
But the subgroups can be nested too, so it's
not really as special as all that.
--
Greg
___
Python-Dev m
be better, e.g.
m.range --> the whole match
m.subgroups[i] --> another match object with its
own range and subgroups attributes
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
Could backwards compatibility concerns be addressed
by including more than one version of Python in
the LSB? Python already allows multiple versions
to coexist, so applications targeting the LSB
would just need to be explicit about which version
of the interpreter to launch.
--
Greg
has something to do
with threading, whereas the atexit mechanism could get
screwed up by someone who wasn't even thinking about
what effect it might have on threading.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,
as well if you want,
but it's not strictly necessary.
--
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
he operating system is doing certain things to
> the application (including, sometimes, when it is swapped out or
> deep in I/O.)
That sounds like an outright bug. I can't think
of any earthly reason why the handler shouldn't
be called eventually, if it remains installed and
the pro
method would
call 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
Martin v. Löwis wrote:
> Greg Ewing schrieb:
>
>>>Please
>>>try to come up with a patch (e.g. by putting a while(is_tripped) loop
>>>around the for loop).
>>
>>That isn't going to fix it.
>
> Why not?
Correct me if I'm wrong, but w
say that translation of absolute paths
is not supported in general.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand
m, in
which case Unix paths are used for both, or the Unix file
system must be mounted on the Windows system, in which case
they're both Windows paths. In neither case is a conversion
from Unix to Windows pathnames needed.
--
Greg Ewing, Computer Science Dept, +
as compact and doesn't suffer from
the weirdness of passing method names in as quoted
strings.
--
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
imes before.
It was a deliberate decision to have those methods
return None, because it makes it clear that they
operate in-place. I doubt that Guido's thinking
on that has changed at all.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
htt
ks like you're out of luck.
--
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
function that uses an array for locals.
--
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
st leaving nb_inplace_pow
null, so I suppose that's not necessary.
Might we want to add an in-place version of the 3-arg
pow() function one day? If so, leaving the third argument
there could be useful.
--
Greg
___
Python-Dev mailing l
Martin v. Löwis wrote:
> Greg Ewing schrieb:
>
>> Might we want to add an in-place version of the 3-arg
>> pow() function one day?
>
> What could the syntax for that be?
It wouldn't be a syntax, just a function, e.g.
ipow(x, n, 10)
> Also, it would break e
by a dict?
In my experience, the amount of code which truly needs
to use getattr is extremely small.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, | Carpe post meridiem! |
Christchurch, New Zealand |
rect call to the __getattr__ method, or
maybe even have a new opcode for doing that.
In other words, "special syntax" doesn't necessarily
have to look like special syntax. :-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.or
big
step, and it needs a very solid reason to jusify
it. I don't see this filling a use case that's
anywhere near common enough to reach that
threshold.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman
dea. It's downright
silly having each thing that uses async I/O doing its
own thing. There should be a standard mechanism in the
stdlib that everything can use.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mai
't want to follow
that path anyway -- because the end result would be too
convoluted for ordinary people to understand and maintain.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-
ows when both
strings are interned, so it can compare them quickly
whether they are equal or not. Your version could detect
equal strings quickly, but not unequal strings.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/ma
return wrapper objects, which provide a different interface to
the same data, and which can be used to mutate the underlying objects.
Aren't the set of ailasing concerns in these two cases exactly the
same?
+1 for attrview(), +0 for .[] syntax. (-1 for .[] if attrview() is accepted.)
Greg
Brett Cannon wrote:
> On 2/12/07, Collin Winter <[EMAIL PROTECTED]> wrote:
> > 2) {BinOp,AugAssign,BoolOp,etc}.op
>
> I can't think of a reason, off the top of my head, why they can't be
> singletons.
Why not j
Martin v. Löwis wrote:
> Greg Ewing schrieb:
> > the end result would be too
> > convoluted for ordinary people to understand and maintain.
>
> That very much depends on what the end result would be.
True. What I should have said is that Guido *believes*
the outcome wo
of
YAGNIOE (You Aren't Going to Need It Often Enough).
--
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
as getattr(a, 42), which depends on a's __getattr__
implementation.
--
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
Steve Holden wrote:
> I know that there's work in progress (and indeed
> almost complete) to put Stackless into 2.5
It might be less confusing to rename the current version of
Stackless to "microthreads" or something, since it's not
really
ate method, you can just
use 'is' to compare them.
--
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
rary choice, but to me it just
seems that the dot and bracket *should* be separare
tokens, perhaps because I would be thinking of the
[x] as a special kind of argument to the dot operator,
rather than there being a funny new operator called ".[".
--
Greg
a line by itself, with no
sub-expressions, i.e.
try:
x = getattr(obj, name)
except AttributeError:
...
else:
...
If you're doing that, I see no significant lack of
readability in the getattr call that needs to be
remedied.
So I
alled getattr. :-)
--
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
Josiah Carlson wrote:
> In a recent
> source checkout of the trunk Lib, there are 100+ uses of setattr, 400+
> uses of getattr ... and a trivial number of delattr calls.
That's out of about 250,000 lines, or 0.2%.
Not a huge proportion, I would have tho
Mike Klaas wrote:
> As a comparison, enumerate (that I would have believed was much more
> frequent a priori), is used 67 times, and zip/izip 165 times.
By that argument, we should be considering a special syntax
for zip and izip before getattr.
-
n seq2):
...
--
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
se its own special event mechanism, and everything else
needs to be modified to suit its requirements, then it's
part of the problem, not part of the solution.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailm
aster) to use an
array to go from C enum --> some object, which could
as well be an interned string as anything else.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http:
Guido van Rossum wrote:
> But if we ever turn it into a single token (which we just may for
> Py3k) don't complain if your code breaks.
I won't. I always treat it as a single token
anyway, unless I'm entering an obfuscated
python comp
Martin v. Löwis wrote:
> Greg Ewing schrieb:
>
> > The string comparison method knows when both
> > strings are interned
>
> No, it doesn't - see stringobject.c:string_richcompare.
Well, I'm surprised and confused.
It's certainly possible to tell v
treme
instance of this:
> def bar(b=my_sum((["b"] * (2 * 3))[:4])):
> print b
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailm
Jean-Paul Calderone wrote:
> Greg, productive discussion is not furthered by the
> unsupported statement of one position or another.
Sorry, I'll expand on that a bit. The "problem" I
was referring to is the turf wars between all the
event-driven frameworks that all want t
acks. The choice of
implementation should be made somewhere deep inside
the library, based on what platform is being used.
So at this point I'm skeptical that the Twisted
API for these things should be adopted as-is.
--
Greg
___
Python-Dev mailing li
[EMAIL PROTECTED] wrote:
> sounded like
> monkeypatching the socket and asyncore modules to provide asynchronous
> file I/O based on the platform-specific IOCP API for Windows.
I don't think anyone's suggesting that any long-term
solution to all this would involve monke
return Or_singleton;
Well, And_singleton and Or_singleton could be anything,
including integers or interned strings. Creating a
class and then a singleton instance for each one seems
like overkill and unnecessary bloat to me.
--
Greg
___
Python-Dev ma
Steve Holden wrote:
> A further data point is that modern machines seem to give timing
> variabilities due to CPU temperature variations even if you always eat
> exactly the same thing.
Oh, great. Now we're going to have to run our
benchmarks in a temperature-controlled ov
it might return a new object. So the return value
conveys useful information, unlike with list.sort() et al.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/m
rown interning
might not give the same results in all cases.
--
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
7;re not equal. But as has been pointed out, unless
you're very unlucky, you find out pretty fast when they're
not equal.
So I'm happy now.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/p
for adoption as-is this doesn't add to the discussion.
Okay, but one of the suggestions made seemed to be
"why not just use the Twisted API". I'm putting
forward a possible reason.
--
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
bstrate on any given platform. Then
they can coexist without the need for any top-level
choices.
I know that will be hard to do, but it's the only
way out of this mess that I can see.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http:/
*don't* have to use
threads.
And... how do you run multiple event loops simultaneously
in the *same* thread? That sounds self-contradictory to
me.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/p
Thomas Wouters wrote:
> If all (or all-but-one) of them have a 'run one iteration' method, you
> can call that from the 'main' mainloop.
But without some way of blocking until an event arrives
for *either* loop, you have to resort to some kind of
busy polling, whic
the standard, then
it would give people some guidance as to how to write
future event-driven code.
--
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
t mechanism, there's no
need to use the gtk event loop for these things -- you
can just use the central event mechanism directly.
The pygtk APIs for setting these up can redirect them
to the appropriate place, to accommodate existing code
that uses t
n the desert, but not so good at
winning a horse race (not camel race). Which is the point of the saying.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/ma
s.
So we need to standardise latitude/longitude/altitude,
time of year and phase of moon. Better check atmospheric
pressure and humidity, too, just to be on the safe
side.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.or
Nick Maclaren wrote:
> Threading
> -
>
> An I/O operation passes a buffer, length, file and action and receives a
> token back.
You seem to be using the word "threading" in a completely
different way than usual here, which may be causing
be enumerated.
Therefore, it technically does not implement a mapping.
Once Python grows a __dir__ special method, it's possible I could be
convinced this is the wrong choice, but I'm not sure of that.
Greg F
___
Python-Dev mailing list
Python
with a tuple subclass and
add descriptors to provide named access. If the descriptor
is implemented in C it should be just as efficient as
using __slots__, but with no duplication of the references.
Given a suitable descriptor type, it shouldn't be hard to
write a factory function to assemble such
he beginning, it probably would have been a
separate type altogether.
Hmmm... is that something that should be revisited
in 3.0?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Un
Martin v. Löwis wrote:
> One idiom that people use a lot is foo[b], where
> b is a boolean.
Could that be addressed using the new __index__ mechanism?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/li
left over for historical
reasons. Those people are mystified as to why anyone
would *want* a boolean to behave like an int.
Personally I'm +0 on this. I wouldn't object if it
happened, but I'm not pushing for it.
--
Greg
___
Python-Dev
time you want. I've
been careful to avoid tab-space mixing ever since
my earliest uses of Python.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mai
Stephen J. Turnbull wrote:
> RKN = reverse Knuth numbering?
No, for RKN you'd have to start with 3141.5926... (an
infinite number of digits following) and drop one off
the end each time... although it would take rather a
long time to get to the final release then. :-(
egitimate
reasons for wanting to pre-create exceptions, e.g. if
I'm intending to raise and catch a particular exception
frequently and I don't want the overhead of creating
a new instance each time.
For me, this is casting serious doubt on the whole
idea
Is this intentional? I would have expected the
// operator to always give an integer result.
Python 2.3 (#1, Aug 5 2003, 15:52:30)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more
to make the obvious way
wrong for subtle reasons. That doesn't seem pythonic
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/py
Adam Olsen wrote:
> It sounds like we should always copy the exception given to raise,
I don't like that either, for all the reasons that
make it infeasible to copy an arbitrary object in a
general way.
--
Greg
___
Python-Dev mailing list
Py
believe calling copy.copy() would be sufficient.
I never use that, because I have no confidence that
it would DWIM. I'd be unhappy if the system started
relying on it anywhere fundamental.
--
Greg Ewing, Computer Science Dept, +--+
University of
l create a new exception instance
and then make a copy of it", unless this can be optimised
away somehow, and it's not necessarily obvious that the
refcount == 1 trick will work (it depends on the exact
details of how the references flow through the exception
raising machinery).
--
Greg Ewin
define classes, since creating one involves setting
up a dict, etc. And if you use __slots__ you end up with
objects of different sizes, which isn't free-list-friendly.
--
Greg Ewing, Computer Science Dept, +--+
University of Canterbury, |
also be considerably *more* expensive to implement
than the current scheme, because it would require copying the
entire stack, instead of just linking stack frames together
as they are unwound during the search for an exception
handler.
--
Greg
___
d raising the same instance.
There's also the possibility of a traceback unexpectedly
kept alive causing GC problems -- cycles, files not
closed when you expect, etc.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyth
call it a 'catch' (used as a noun, as when
a fisherman might say "That's a good catch!")
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.pyt
27;s no memory to allocate a
traceback object, so you raise a MemoryError...
etc...
That might be a reason for pre-allocating the
MemoryError exception, too.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listi
for that rather than using
a 2-tuple.
--
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
k' clauses in both cases.
However, the apparent instantiation call wouldn't be
made -- it's just part of the syntax.
--
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
u can still raise a preinstantiated
exception, it wouldn't be safe to attach a traceback to
it, meaning we'd have to support two different ways of
handling tracebacks as well. It could all get terribly
messy.
--
Greg
___
Python-Dev mailing list
Pytho
ion context" object
that can hold other info.
--
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:
> Greg Ewing wrote:
>
> > An exception caught and raised in one thread would
> > be vulnerable to having its traceback clobbered by
> > another thread raising the same instance.
>
> Right - but that would still be *no worse* than the current situ
ther instantiating if it's a
class and gets caught with
except E:
or
except E with context:
--
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 cleaner, not
more messy.
--
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
g. (Assuming
we get rid of traceback objects and just link
the frames together directly.)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options
r
raising and reraising? Raising would complain if
there were already a traceback, and reraising
would expect an existing traceback and extend
it.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/p
n=None,
Emin=None, Emax=None,
capitals=None, _clamp=0,
_ignored_flags=None)
args.update(kwds)
for name, value in args:
...
So, no need for locals() here.
--
Greg
__
'm not sure if that's an argument for or against the patch, though.
It *might* be an argument for making the
behaviour platform-dependent.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pytho
ng should be a problem.
> Or, if you need to open more than
> one member file for writing in the same zip file, then this is not
> possible at all.
I don't think it would be unreasonable to just not
support writing to more than one member at a time.
--
Greg
__
Bill Janssen wrote:
> If you really need a name other than "timeout" (which seems fine to
> me), how about "waiting-with-mild-trepidation-timeout"?
Something like "response timeout" might be more descriptive.
--
Greg
__
y string for ext...
--
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 and get the same result
when subtracting two dates, as long as you pick the same
one for both dates. So it's not really assuming anything
here.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listi
1201 - 1300 of 2499 matches
Mail list logo