2006年05月21日 星期日 22:45
如何取得class的方法名 属性名列表? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060521/215f6e22/attachment.html
2006年05月21日 星期日 23:09
试试 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
2006年05月21日 星期日 23:29
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
2006年05月22日 星期一 09:04
>>> 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__
2006年05月22日 星期一 09:23
他说的是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
2006年05月22日 星期一 09:53
>>> 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
Zeuux © 2025
京ICP备05028076号