The pypy'ers have written a brief description on
using rpython to create standalone executables:
http://codespeak.net/pypy/dist/pypy/doc/standalone-howto.html
This is definately worth playing around with, it's very nice writing
(r)python code that gets executed as if it were c code.
Simon.
--
def methclass(meth):
cls = meth.im_class
name = meth.im_func.__name__
meth = getattr(cls,name,None)
for cls in cls.mro():
_meth = getattr(cls,name,None)
if _meth is not None and _meth==meth:
result = cls
return result
>>> methclass(b.foo)
(Turns
>>>
>>> class A(object):
... def foo(self): pass
...
>>>
>>> class B(A):
... pass
...
>>>
>>> b=B()
>>> b.foo
>
How can I work out what class b.foo was defined in ?
Simon.
--
http://mail.python.org/mailman/listinfo/python-list
I've been doing a little c programming again (ouch!) and it's just hit
me
why python does not allow assignment inside expressions (as in c):
because it is absolutely essential that all assignments are as visible
as possible. In python the assignment is the declaration; when
declarations
are as che
the more esoteric python projects,
such as the AST integration,
and PyPy. Participating in a sprint would be brilliant.
The line-up of talks at this year's PyCon looks more interesting to me,
compared to Europython 2005.
thanks,
Simon Burton.
--
http://mail.python.org/mailman/listinfo/p
Hi,
I'm having some trouble linking one extension module to another because
the linker expects a "lib" prefix and my python modules cannot have
this prefix.
I found two ways of doing it on a linux box (either symlink or create a
dummy .so that links to extension module) but I can get neither of
In my case the deeply nested function calls are recursive calls for a
tree traversal.
This is similar to the visitor design pattern, where the Context class
above is the Visitor. The difference is that the Context instance does
not "visit" or "act" upon the nodes, but just stores state/context
info
Yes!
I do this a lot when i have deeply nested function calls
a->b->c->d->e
and need to pass args to the deep function without changing the
middle functions.
In this situation I think i would prefer this variation:
class Context(dict):
def __init__(self,**kwds):
dict.__init__(self,kwds)
Hello,
i've just found out that the ast-branch has been merged into the main
python cvs.
** Woohoo ! **
I'd like to experiment with this, does anyone know where to start ?
It seems that the parser module still produces the same junk as before.
So where do we find these nice high level AST objects
ict__["__all__"] = dir(master)
def __getattr__(self, name):
attr = getattr( self._master, name )
return attr
# ... end of file:
sys.modules["mymod"] = ModuleProxy("mymod",sys.modules["mymod"])
--Simon Burton
--
http://mail.python.org/mailman/listinfo/python-list
uot; [2], but i don't quite see how i can
use it while maintaining python source compatability.
bye!
Simon.
[1]: http://occs.cs.oberlin.edu/~jwalker/nullObjPattern/
[2]: http://students.ceid.upatras.gr/~sxanth/pyc/
--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph
11 matches
Mail list logo