"prove"

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Fri May 9 10:32:00 CEST 2008


Lucas Prado Melo a écrit :
> Hello,
> How could I "prove" to someone that python accepts this syntax using
> the documentation (I couldn't find it anywhere):
> classname.functionname(objectname)

Why do you need the documentation ? Just fire up your python shell and 
hack a Q&D example:

Python 2.5.1 (r251:54863, May  2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> class Foo(object):
...     def bar(self):
...             print "in %s bar" % self
...
 >>> f = Foo()
 >>> Foo.bar(f)
in <__main__.Foo object at 0xb7dccd2c> bar
 >>> f.bar()
in <__main__.Foo object at 0xb7dccd2c> bar
 >>>



More information about the Python-list mailing list