Python论坛  - 讨论区

标题:[python-chinese] 如何取得class的方法名 属性名列表?

2006年05月21日 星期日 22:45

Guofeng Yuan loocoo at gmail.com
Sun May 21 22:45:50 HKT 2006

如何取得class的方法名 属性名列表?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060521/215f6e22/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月21日 星期日 23:09

tocer tocer.deng at gmail.com
Sun May 21 23:09:25 HKT 2006

试试 classname.__dict__

Guofeng Yuan wrote::
> 如何取得class的方法名 属性名列表?
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese

-- 
Vim 中文 Google 论坛 http://groups.google.com/group/Vim-cn

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月21日 星期日 23:29

Guofeng Yuan loocoo at gmail.com
Sun May 21 23:29:08 HKT 2006

it's nothing but {}

On 5/21/06, tocer <tocer.deng at gmail.com> wrote:
>
> 试试 classname.__dict__
>
> Guofeng Yuan wrote::
> > 如何取得class的方法名 属性名列表?
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
> --
> Vim 中文 Google 论坛 http://groups.google.com/group/Vim-cn
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060521/de2e06e2/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月22日 星期一 09:04

tocer tocer.deng at gmail.com
Mon May 22 09:04:54 HKT 2006

>>> class foo:
...     def bar(self):
...             pass
...
>>> foo.__dict__
{'__module__': '__main__', 'bar': , '__doc__': None}


Guofeng Yuan wrote::
> it's nothing but {}
>
> On 5/21/06, *tocer* <tocer.deng at gmail.com tocer.deng at gmail.com>>
> wrote:
>
>     试试 classname.__dict__

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月22日 星期一 09:23

Robert Chen search.pythoner at gmail.com
Mon May 22 09:23:36 HKT 2006

他说的是classname,不是instancename哦

On 5/21/06, Guofeng Yuan <loocoo at gmail.com> wrote:
>
> it's nothing but {}
>
> On 5/21/06, tocer <tocer.deng at gmail.com> wrote:
> >
> > 试试 classname.__dict__
> >
> > Guofeng Yuan wrote::
> > > 如何取得class的方法名 属性名列表?
> > >
> > >
> > >
> > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> > --
> > Vim 中文 Google 论坛 http://groups.google.com/group/Vim-cn
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


-- 
Robert
Python源码剖析――http://blog.donews.com/lemur/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060522/f55ca908/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月22日 星期一 09:53

lubiao lubiao.py at gmail.com
Mon May 22 09:53:47 HKT 2006

>>> class A:
...   def abc (self):
...     pass
...
>>> dir (A)
['__doc__', '__module__', 'abc']
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060522/d336198e/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号