ession is a feasible thing
to do.
--
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
ys be true,
regardless of what attributes A has. However, this turns
out not to be so -- A must also have a __bases__ attribute,
otherwise it's rejected as not being sufficiently class-like.
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
bjects are accepted.
And nowhere does it mention that __bases__ must
be a 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/arch
ly good
garbage collection algorithm just now.
--
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
make isinstance() and issubclass() work in
the expected way when applied to wrappers around Ruby
classes. The ability to fake things using __classes__
and __bases__ turned out to be very handy.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
.x version, as it would make
writing code that works over multiple 2.x versions difficult.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/
Leif Walsh wrote:
If only we had a second Earth to mess with, we could just copy and swap.
Or we could use a generational approach, doing all our
messy stuff around the moon and copying to earth when
we've got our traffic control issues sorted out.
--
class, which can easily happen
if you change the base class of a class and forget
to update all of the inherited calls to match.
I believe this type check has been removed in 3.0,
so duck-typing of self is possible there.
--
Greg
___
Python-Dev mailing
like an unbound
method but without the type check (implementation
details left to the reader).
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
en?
Instead of defining things directly in foo.py, maybe it
should do
try:
from cFoo import *
except ImportError:
from pyFoo import *
Then the fast path will be taken if cFoo is available,
and you can directly import cFoo or pyFoo if you
Brett Cannon wrote:
So while this alleviates the worry
above, it does mean that anything that gets rewritten needs to have a
name that does not lead with an underscore for this to work.
You can use an __all__ list to explicitly say what
is to be exported.
--
Greg
obals
into their func_globals, but unfortunately it's
read-only. :-(
>>> f.func_globals = g
Traceback (most recent call last):
File "", line 1, in
TypeError: readonly attribute
Is there a reason it couldn't be made writeable?
--
Greg
are taking that
responsibility on ourselves.
--
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
n something not care
about segfaults, but care about memory overwriting?
If something is capable of causing a segfault, you
can't be sure it won't just corrupt memory in some
way that doesn't segfault but causes some other
problem.
--
Greg
_
nd,
applying it to Python is not easy to do in a
way that one can have confidence in.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/
priate
name for what we're talking about here -- basically
a sequence type that holds things in arbitrary order, but
with the additional ability to look things up quickly by
a key.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.py
keeps
itself sorted in key order
--
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
rdmur...@bitdance.com wrote:
I actually like StableDict best. When I hear that I think, "ah, the
key order is stable in the face of insertions, unlike a regular dict".
But it still doesn't convey what the ordering actually *is*.
--
Greg
___
)
* a select() or epoll like interface that allows waiting on
multiple channels
+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
nction
for me".
In other words it should be a light wrapper around
select/poll/whatever that provides a callback interface.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Uns
lack of documentation and tests?
I think the 2.4 and later docs make it clear that it's
no longer considered part of the public API, if it ever
was.
If seeding the memo is considered a legitimate need, an
API could be provided for doing that.
--
Greg
_
thing else people want that asyncore doesn't
provide, or is it just a matter of nailing down the existing
API a little?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://
attribute that returns
a wrapper around the underlying cache -- maybe with only a
clear() method if that's all you want to support.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
Guido van Rossum wrote:
Then it'd be better to have a method clear_memo() on pickle objects.
You should have that anyway. I was just suggesting a
way of preserving compatibility with old code without
exposing all the details of the memo.
--
as a separate thing from a select/poll
wrapper. The select/poll wrapper *is* the non-blocking
API.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailma
or first step towards a
select/poll wrapper. They're orthogonal issues, even
if you might sometimes want to use them together.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http:
new one?
Then you could keep the pickler that you used to pickle
the primer and "fork" new picklers off it, and similarly
with the unpicklers.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/l
different pickles.
--
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
stion, the master pickler would be primed
by pickling all the shared classes, and the resulting pickle
would be stored in the database.
When unpickling, the master unpickler would be primed by
unpickling the shared pickle.
--
Greg
___
Python-Dev mailing
, such as
MacOSX Finder attributes.
--
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
you're wrapping
another file object you just need to pass on the mode
string and it will all work.
--
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:
That should be implement by passing O_SYNC on open, rather than
explicitly calling fsync.
On platforms which have it (MacOSX doesn't seem to,
according to the man page).
This is another good reason to put these things in the
mode string.
--
Antoine Pitrou wrote:
What do you mean? open() doesn't allow you to wrap other file objects.
I'm talking about things like GzipFile that take a
filename and mode, open the file and then wrap the
file object.
--
Greg
___
Python-Dev ma
ng a particular thousands separator in
one place, it will probably want to use it everywhere.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
ce it. Send the number by email to a service centre
in India, where an employee formats it for us and sends it
back.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Stephen J. Turnbull wrote:
Greg Ewing writes:
> If an app is using a particular thousands separator in
> one place, it will probably want to use it everywhere.
Not if that app is internationalized (eg, a webapp that serves both
Americans and Chinese).
I don't think you'll
ng_file("blarg.txt", "w") as f:
...
--
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
idate values.
There is also no traceback carried by the thrown token.
(Although if something is thrown but not caught, an
exception should be raised at the point of the throw
with an appropriate traceback -- implementation of that
is left as an exercise for t
only about factoring out try/finally
statements.
There's no way that
try:
code_block
finally:
...
can fail to enter the code block if you get as far as
the "try". So it's not reasonable to expect the with
statement to
you still think there will
be difficulty in understanding or auditing 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
s that you *don't* need a special
framework to get the return value -- all you need is a
caller that uses a yield-from statement. There are uses
for that besides threading systems.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://ma
as something to do with generators, but
you'll have to RTM to find out exactly what. Nobody has
thus far suggested any better name, however.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-
g complete.
Even so, the intention is that if you understand the
semantics in the generator case, the behaviour in the
other cases should be something reasonable and
unsurprising. I certainly don't expect users to memorize
either the expansion or the full t
down to check for
this one particular error, among all the myriad ways
a malfunctioning extension module can cause a crash?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
ng the
inlining principle. When pondering what should happen
in such cases, I've been able to think to myself
"What would happen if the subgenerator were inlined?"
Most of the time that makes the answer fairly obvious,
at least in the case where
diate generator during next().
--
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 *motivation* needs more work; but IMO the
*explanation* should start with this simple model and then expand upon
the edge cases.
Perhaps what I should do is add a Motivation section before
the Proposal and move some of the material from the beginning
of the Rationale sectiomn there.
--
Gr
the end of a task and its
return value, in place of a value in the stream.
Difference in philosophy again. To me, the need for such
an unusual construct when using these frameworks is a
wart, not a feature.
--
Greg
___
Python-Dev mailing list
Pytho
onnotations of textual substitution.
That's not what it usually means, as far as I can see.
When you declare a function 'inline' in C, you're not
asking for a blind textual substitution. Rather, you're
asking the compiler to generate what
t the result
just be re-used for any future renaming exercises of
this kind?
--
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%4
wants to call a value-returning
generator and get the value without becoming a generator
itself. So if it's to be mentioned in the PEP at all,
a general solution might as well be given (whether it's
to use a trampoline or just write the necessary next()
and except
Trying to think of a better usage example that
combines send() with returning values, I've realized
that part of the problem is that I don't actually
know of any realistic uses for send() in the first
place.
Can anyone point me to any? Maybe it will help
to inspire a better example
document has been placed in the public domain.
..
Local Variables:
mode: indented-text
indent-tabs-mode: nil
sentence-end-double-space: t
fill-column: 70
coding: utf-8
End:
--
Greg
___
Python-Dev mailing list
Python-Dev@py
would
look a lot like my generator scheduling example.
--
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
Guido van Rossum wrote:
I'll gladly take that as an added rationalization of my plea not to
change datetime.
In the case of datetime, could perhaps just the
module name be changed so that it's not the same
as a name inside the module? Maybe call it
date_time or date_and_time
Guido van Rossum wrote:
Can I suggest that API this takes a glob-style pattern?
Globs would be nice to have, but the minimum
needed is some kind of listdir-like functionality.
Globbing can be built on that if need be.
--
Greg
___
Python-Dev mailing
Olemis Lang wrote:
... well ... it is too long ... :-§ ... perhaps it is better this way ...
--lmdtbicdfyeiwdimoweiiiapiyssiansey ... :P
Isn't that the name of a town in Wales somewhere?
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
technique avoids having
to do either of those things.
--
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
d, and the attendant syntactic
clumisiness and inefficiencies.
--
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
omewhere in the body.
Some people complained about that back when generators
were being designed, but we seem to have gotten used
to it. I don't anticipate any worse problem here.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mai
right.
it is also necessary to block close() in order to share an
iterator.
That's a typo -- I meant to say 'throw' and 'close'
there, I think.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/m
complication.
People are already trained to think of 'return' and 'yield'
as quite different things. I don't know why they would suddenly
start using 'return' when they mean 'yield'.
--
Greg
___
Python-Dev mail
ny further, so I haven't. A followup
PEP for it might be in order.
--
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
be any clearer
if all the returns were replaced by raising StopIteration?
--
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
self receives a
value is right at the very end when the subgenerator
terminates, and that's not a yielding operation, it's a
returning operation.
Yield-from is not a kind of yield. It's a kind of function
call.
--
Greg
___
Python-Dev mailing lis
#x27;alpha' and 'beta', these should compare in the
right order.
--
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
Draft 10 of the PEP. Removed the outer try-finally
from the expansion and fixed it to re-raise
GeneratorExit if the throw call raises StopIteration.
--
Greg
PEP: XXX
Title: Syntax for Delegating to a Subgenerator
Version: $Revision$
Last-Modified: $Date$
Author: Gregory Ewing
Status: Draft
und.
Okay, so would you be happy if the for-loop were to
raise an exception if it gets a StopIteration whose
value is not None?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://
hich would be
rather strange.
I think in either case a check in
PyIter_Next() would cover most cases
If that's acceptable, then the check might as well
be for None as the StopIteration value, and there's
no need for a new exception.
--
Greg
___
d what you were saying. What
check were you suggesting to perform in PyIter_Next?
--
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
tion? Then things that want to get generator
return values only have one exception to catch, and
things that only know about StopIteration will fail
to catch the new exception.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.o
the way you specify the module.
--
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
ard to look at a piece of code and decide whether it's
doing something high-level or low-level.
Python takes a uniformly high-level view of everything,
which is fine for the vast majority of application
programming, I think -- VCSes included.
--
Greg
_
sys.modules for "a.b", and then look on that object for a
"c" attribute. The cached "a.b.c' module in sys.modules is ignored.
Hasn't 'from a.b import c' always been that way, though?
Is the problem just that relative imports
ew
enhanced one could be added.
--
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
out it for
certain.
--
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
r uses for CObjects than this.
I see it as a quick way of creating a wrapper when
you don't want to go to the trouble of a full-blown
extension type. A small amount of metadata would
make CObjects much more useful.
--
Greg
___
Python-Dev mailing
es.
By making these functions that operate through the
buffer protocol rather than special types, they would
be much more flexible and interoperate with other
libraries very well.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.
Antoine Pitrou wrote:
Again, I don't want to spoil the party, but multidimensional buffers are
not implemented, and neither are buffers of anything other than single-byte
data.
When you say "buffer" here, are you talking about the
buffer interface itself, or the memoryview o
If so, writing some things that attempt to use it in
non-trivial ways would be a useful thing to do.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
useful to have. And if they work through the new buffer
protocol, they'll be ready for multi-dimensional types
if and when such types appear.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/pytho
then tell people to override _close() rather than
close().
--
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:
Still, as both you and Greg have pointed out, even in its current form
memoryview is already useful as a replacement for buffer that doesn't
share buffer's problems
That may be so, but I was more pointing out that the
elementwise functions I'm talking about
part of the iterator protocol
that applies to all iterators, whereas the others are
specific to generators. By your reasoning, any object that
has any __xxx__ methods should have all its other methods
turned into __xxx__ methods as well.
--
Greg
___
Python
before
closing, and make that the responsibility of the derived
class.
--
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
here or not. If
it accepted anything that looks like whitespace,
there would be no cause for complaint.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
it or not. And if it doesn't,
they'll resort to some ungodly mash such as Makefile+
shell+m4. Python has got to be a better choice than that.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-
hance of that happening
(e.g. the Python code can import parts of the
build system and call them directly, rather than
having to generate a file in some other language).
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailma
ly at module load time. It may not be worth attempting
to speed it up.
--
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%4
iable
name anywhere in any module.
--
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
n order
to diagnose missing auto-imported names.
--
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
r means you're
using to send the text.
--
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
.
--
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
way and
only converting them to a URL when needed.
--
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
Barry Warsaw wrote:
The default
would probably be some unstructured parser for headers like Subject.
Only for headers known to be unstructured, I think.
Completely unknown headers should be available only
as bytes.
--
Greg
___
Python-Dev mailing
Barry Warsaw wrote:
For an
Originator or Destination address, what does str(header) return?
It should be an error, I think.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
R. David Murray wrote:
That doesn't make sense to me. str() should return
_something_.
Well, it might return something like "". But you shouldn't rely on it
to give you anything useful for an arbitrary header.
--
Greg
___
Pyt
Alexandre Vassalotti wrote:
print("Content-Type: application/json; charset=utf-8")
input_object = json.loads(sys.stdin.read())
output_object = do_some_work(input_object)
print(json.dumps(output_object))
print()
That assumes the encoding being used by stdout has
ascii as a subset
event on a particular day of the month.
If you do this the naive way by just repeatedly adding one
of these monthdeltas to the previous date, and the date is
near the end of the month, it will eventually end up
drifting to the 28th of every month.
--
Greg
Steven D'Aprano wrote:
"2rd of March on leap years,
^^^
The turd of March?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opti
701 - 800 of 2499 matches
Mail list logo