Jason Tackaberry wrote: >> Nice. But that would move our target platform to 2.5. Do we want to do >> that? I agree, it looks much nicer this way. > > Well, I wasn't actually suggesting that, but we may want to consider > it. Here are the facts: > > 1. Python 2.5 was released in September 2006, and was included in > Fedora 7 (released May 2007) and Ubuntu Feisty (released April 2007).
Gentoo still uses 2.4 and 2.5 is still masked. I have no idea why they
still keep it.
> 2. Freevo 2 will not be out for at least a year.
That is a valid point. I will try to emerge Python 2.5 on my Gentoo
system later to test it.
> 3. Freevo 1.x uses kaa.base and targets Python 2.3 according to the
> wiki (Duncan, is this still true? Does 1.8 not use decorators?)
Python 2.4 is a mimimum because kaa uses decorators at some points and
you can't install decorated code even if you do not call it. The same
would be true for 'foo = yield something' which will fail to install
on Python < 2.5.
> I think the only python 2.4 feature we're using right now are decorators
> which I think aren't actually being used inside kaa proper. It should
> be possible to provide backward compatibility for the old idiom while
> supporting the new one on python 2.5. In other words, this will work on
> Python 2.5:
>
> @kaa.yield_execution()
> def foo():
> try:
> result = yield some_async_func()
> except Exception:
> ...
But I don't need a try/except. If I don't have it, the exception
should be raised to the InProgress object around foo.
> While this would work on both python 2.4 and 2.5:
>
> @kaa.yield_execution()
> def foo():
> def handle_exception(type, value, tb):
> ...
> ip = some_async_func()
> ip.exception.connect(handle_exception)
> yield ip
> result = ip()
You don't need that. The follwoing works fine:
@kaa.yield_execution()
def foo():
def handle_exception(type, value, tb):
...
ip = some_async_func()
yield ip
try:
result = ip()
except Exception:
...
> What's rather nice is that some_async_func() can be either a
> yield_execution or execute_in_thread decorated function and behave
> the same way.
That was the plan behind it. See asynctest.py in the base test
dir. some_async_func can also be a rpc and stuff like that. It can be
everything that returns an InProgress. So some_async_func can also be
Process('callme').start(). That is the reason why I added InProgress
objects all around the code.
Dischi
--
The trouble with work is... it's so daily.
pgpGER9VoK04m.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
