I'm trying to take advantage of Python's introspection capabilities to find
out what certain objects can do.  I'm not getting very far though.  Here's
what I've discovered so far about db.define_table and db itself:

    In[14]: import pydoc
    Out[14]:    
    In[15]: pydoc.help(db.define_table)
    Out[15]: Help on method define_table in module gluon.sql:

    define_table(self, tablename, *fields, **args) method of gluon.sql.SQLDB 
instance
    In[16]: help = pydoc.help
    Out[16]:    
    In[17]: help(db)
    Out[17]: Traceback (most recent call last):
      File "<input>", line 1, in <module>
      File "pydoc.pyc", line 1645, in __call__
      File "pydoc.pyc", line 1689, in help
      File "pydoc.pyc", line 1464, in doc
      File "pydoc.pyc", line 1459, in resolve
      File "gluon/sql.py", line 1271, in __getattr__
    KeyError: '__name__'

This is from a through-the-web Python prompt.  Is there some better way to
go about this?  I do see this:

    http://localhost:8000/examples/static/epydoc/index.html

but that's a little bit indirect.  (I see that help(type(db)) works where
help(db) fails.)  Maybe I'm on the right track but just stumbled upon a
pydoc bug?

Skip

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to