Type function

Dr. Bobus drbobus en gulic.org
Mie Dic 27 23:22:47 CET 2006


El Wed, 27 Dec 2006 16:36:04 +0100
Oswaldo Hernández <listas en soft-com.es> dijo:

> ¿Como podria evaluar si un objeto es una función?
> 
> Gracias.


No se si es muy ortodoxo o no... lo he tenido que usar y me ha funcionado, pero no se muy bien si es correcto o no hacerlo.
Si alguien sabe más que no se corte y cuente algo.


Python 2.3.5 (#2, Oct 16 2006, 19:19:48)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import new
>>> def f():
...    pass
...
>>> type(f)
<type 'function'>
>>> type(f) == new.function
True
>>>    


Saludos


Dr. Bobus
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: no disponible
Type: application/pgp-signature
Size: 189 bytes
Desc: no disponible
URL: <http://mail.python.org/pipermail/python-es/attachments/20061227/22dbdfab/attachment.pgp>
------------ próxima parte ------------
_______________________________________________
Python-es mailing list
Python-es en aditel.org
http://listas.aditel.org/listinfo/python-es


Más información sobre la lista de distribución Python-es