Re: [Python-Dev] yield * (Re: Missing operator.call)

2009-02-08 Thread Greg Ewing
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

[Python-Dev] Small misleadingness in docs

2009-02-13 Thread Greg Ewing
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

Re: [Python-Dev] Small misleadingness in docs

2009-02-13 Thread Greg Ewing
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

Re: [Python-Dev] Wow!

2009-02-13 Thread Greg Ewing
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

Re: [Python-Dev] Small misleadingness in docs

2009-02-14 Thread Greg Ewing
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

Re: [Python-Dev] Small misleadingness in docs

2009-02-14 Thread Greg Ewing
.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/

Re: [Python-Dev] Wow!

2009-02-16 Thread Greg Ewing
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. --

Re: [Python-Dev] Duck-typing self

2009-02-18 Thread Greg Ewing
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

Re: [Python-Dev] Duck-typing self

2009-02-18 Thread Greg Ewing
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

Re: [Python-Dev] IO implementation: in C and Python?

2009-02-20 Thread Greg Ewing
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

Re: [Python-Dev] Choosing a best practice solution for Python/extension modules

2009-02-20 Thread Greg Ewing
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

Re: [Python-Dev] Choosing a best practice solution for Python/extension modules

2009-02-20 Thread Greg Ewing
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

Re: [Python-Dev] Silencing IO errors on del/dealloc?

2009-02-22 Thread Greg Ewing
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

Re: [Python-Dev] Reviving restricted mode?

2009-02-22 Thread Greg Ewing
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 _

Re: [Python-Dev] Challenge: Please break this! [Now with blog post]

2009-02-23 Thread Greg Ewing
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/

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Greg Ewing
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

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-03 Thread Greg Ewing
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

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Greg Ewing
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 ___

Re: [Python-Dev] asyncore fixes in Python 2.6 broke Zope's version of medusa

2009-03-05 Thread Greg Ewing
) * 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

Re: [Python-Dev] asyncore fixes in Python 2.6 broke Zope's version of medusa

2009-03-05 Thread Greg Ewing
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

Re: [Python-Dev] Pickler/Unpickler API clarification

2009-03-05 Thread Greg Ewing
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 _

Re: [Python-Dev] asyncore fixes in Python 2.6 broke Zope's version of medusa

2009-03-05 Thread Greg Ewing
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://

Re: [Python-Dev] Pickler/Unpickler API clarification

2009-03-05 Thread Greg Ewing
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

Re: [Python-Dev] Pickler/Unpickler API clarification

2009-03-05 Thread Greg Ewing
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. --

Re: [Python-Dev] asyncore fixes in Python 2.6 broke Zope's version of medusa

2009-03-05 Thread Greg Ewing
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

Re: [Python-Dev] asyncore fixes in Python 2.6 broke Zope's version of medusa

2009-03-06 Thread Greg Ewing
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:

Re: [Python-Dev] Pickler/Unpickler API clarification

2009-03-07 Thread Greg Ewing
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

Re: [Python-Dev] Pickler/Unpickler API clarification

2009-03-07 Thread Greg Ewing
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

Re: [Python-Dev] Pickler/Unpickler API clarification

2009-03-07 Thread Greg Ewing
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

Re: [Python-Dev] Ext4 data loss

2009-03-11 Thread Greg Ewing
, 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

Re: [Python-Dev] Ext4 data loss

2009-03-11 Thread Greg Ewing
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

Re: [Python-Dev] Ext4 data loss

2009-03-11 Thread Greg Ewing
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. --

Re: [Python-Dev] Ext4 data loss

2009-03-11 Thread Greg Ewing
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

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-12 Thread Greg Ewing
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

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-12 Thread Greg Ewing
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:

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-13 Thread Greg Ewing
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

Re: [Python-Dev] Ext4 data loss

2009-03-15 Thread Greg Ewing
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

Re: [Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body

2009-03-15 Thread Greg Ewing
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

Re: [Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body

2009-03-16 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-21 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-21 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-22 Thread Greg Ewing
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-

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-22 Thread Greg Ewing
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

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-23 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-24 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-24 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-24 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-24 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] Adding PEP consistent aliases for names that don't currently conform

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

[Python-Dev] Revised**8 PEP on Yield-From

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] Adding PEP consistent aliases for names that don't currently conform

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] "setuptools has divided the Python community"

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] "setuptools has divided the Python community"

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] Revised**8 PEP on Yield-From

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] return from a generator [was:PEP 380 (yield from a subgenerator) comments]

2009-03-26 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-27 Thread Greg Ewing
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

Re: [Python-Dev] version compare function into main lib

2009-03-27 Thread Greg Ewing
#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

[Python-Dev] Revised**9 PEP on Yield-From

2009-03-27 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-27 Thread Greg Ewing
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://

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-27 Thread Greg Ewing
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 ___

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-28 Thread Greg Ewing
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

Re: [Python-Dev] PEP 380 (yield from a subgenerator) comments

2009-03-28 Thread Greg Ewing
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

Re: [Python-Dev] Broken import?

2009-03-31 Thread Greg Ewing
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

Re: [Python-Dev] And the winner is...

2009-03-31 Thread Greg Ewing
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 _

Re: [Python-Dev] Broken import?

2009-04-01 Thread Greg Ewing
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

Re: [Python-Dev] Let's update CObject API so it is safe and regular!

2009-04-02 Thread Greg Ewing
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

Re: [Python-Dev] Let's update CObject API so it is safe and regular!

2009-04-02 Thread Greg Ewing
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

Re: [Python-Dev] Let's update CObject API so it is safe and regular!

2009-04-02 Thread Greg Ewing
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

Re: [Python-Dev] graphics maths types in python core?

2009-04-04 Thread Greg Ewing
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.

Re: [Python-Dev] graphics maths types in python core?

2009-04-04 Thread Greg Ewing
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

Re: [Python-Dev] graphics maths types in python core?

2009-04-04 Thread Greg Ewing
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

Re: [Python-Dev] graphics maths types in python core?

2009-04-05 Thread Greg Ewing
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

Re: [Python-Dev] Possible py3k io wierdness

2009-04-05 Thread Greg Ewing
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

Re: [Python-Dev] graphics maths types in python core?

2009-04-05 Thread Greg Ewing
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

Re: [Python-Dev] Generator methods - "what's next" ?

2009-04-05 Thread Greg Ewing
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

Re: [Python-Dev] Possible py3k io wierdness

2009-04-05 Thread Greg Ewing
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

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-06 Thread Greg Ewing
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

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-07 Thread Greg Ewing
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-

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-07 Thread Greg Ewing
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

Re: [Python-Dev] Rethinking intern() and its data structure

2009-04-09 Thread Greg Ewing
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

Re: [Python-Dev] Rethinking intern() and its data structure

2009-04-09 Thread Greg Ewing
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

[Python-Dev] Lazy importing (was Rethinking intern() and its data structure)

2009-04-10 Thread Greg Ewing
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

Re: [Python-Dev] Dropping bytes "support" in json

2009-04-10 Thread Greg Ewing
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

Re: [Python-Dev] [Email-SIG] Dropping bytes "support" in json

2009-04-11 Thread Greg Ewing
. -- 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

Re: [Python-Dev] [Python-ideas] Proposed addtion to urllib.parse in 3.1 (and urlparse in 2.7)

2009-04-13 Thread Greg Ewing
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

Re: [Python-Dev] Dropping bytes "support" in json

2009-04-13 Thread Greg Ewing
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

Re: [Python-Dev] [Email-SIG] Dropping bytes "support" in json

2009-04-13 Thread Greg Ewing
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

Re: [Python-Dev] [Email-SIG] Dropping bytes "support" in json

2009-04-13 Thread Greg Ewing
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

Re: [Python-Dev] Dropping bytes "support" in json

2009-04-13 Thread Greg Ewing
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

Re: [Python-Dev] Python-Dev Digest, Vol 69, Issue 143

2009-04-16 Thread Greg Ewing
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

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Greg Ewing
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

<    3   4   5   6   7   8   9   10   11   12   >