Python论坛  - 讨论区

标题:[python-chinese] Rs: Re: 看看这段文章的输出

2007年09月05日 星期三 09:18

nmweizi nmweizi在163.com
星期三 九月 5 09:18:41 HKT 2007

python-chinese£¬ÄãºÃ
ÔËÐÐÁËһϡ£Êä³ö£º
 
A.__private()
B.public()
 
 
nmweizi£¬nmweizi在163.com
2007-08-17 
----- Original Message ----- 
From: ºî»ªÂ¡ 
To: pythonÖйú 
Sent: 2007-08-17, 15:49:42
Subject: [python-chinese] ¿´¿´Õâ¶ÎÎÄÕµÄÊä³ö


¸Õ¿´ÁËһƪÎÄÕÂ
class A(object):
       def __init__(self):
              self.__private()
              self.public()
       def __private(self):
              print 'A.__private()'
       def public(self):
              print 'A.public()'
class B(A):
       def __private(self):
              print 'B.__private()'
       def public(self):
              print 'B.public()'
b = B()
²Â²ÂÊä³öʲô?



ºî»ªÂ¡
2007-08-17
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070905/5159ea4e/attachment.html 

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

2007年09月05日 星期三 18:10

dezhong liu zhongliude在gmail.com
星期三 九月 5 18:10:04 HKT 2007

A.__private()
B.public()

ÔÚ07-9-5£¬nmweizi <nmweizi在163.com> дµÀ£º
>
>  python-chinese£¬ÄãºÃ
> ÔËÐÐÁËһϡ£Êä³ö£º
>
> A.__private()
> B.public()
>
>
> nmweizi£¬nmweizi在163.com<%3C%21--AID_FROMADDRESS_BEGIN--%3Enmweizi在163.com%3C%21--AID_FROMADDRESS_END--%3E>
> 2007-08-17
>
> ----- Original Message -----
> *From: *ºî»ªÂ¡ <hou_hl在sina.com>
> *To: *pythonÖйú <python-chinese在lists.python.cn>
> *Sent: *2007-08-17, 15:49:42
> *Subject: *[python-chinese] ¿´¿´Õâ¶ÎÎÄÕµÄÊä³ö
>
>   ¸Õ¿´ÁËһƪÎÄÕÂ
>  class A(object):
>         def __init__(self):
>                self.__private()
>                self.public()
>         def __private(self):
>                print 'A.__private()'
>         def public(self):
>                print 'A.public()'
>  class B(A):
>         def __private(self):
>                print 'B.__private()'
>         def public(self):
>                print 'B.public()'
>  b = B()
> ²Â²ÂÊä³öʲô?
>  ------------------------------
>  ºî»ªÂ¡
> 2007-08-17
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070905/38a50991/attachment.htm 

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

2007年09月05日 星期三 19:35

Cyril_Gmail terry6394在gmail.com
星期三 九月 5 19:35:08 HKT 2007

OOP考题中经常出现的题目

On 9/5/07, dezhong liu <zhongliude at gmail.com> wrote:
>
> A.__private()
> B.public()
>
> 在07-9-5,nmweizi <nmweizi at 163.com> 写道:
> >
> >  python-chinese,你好
> > 运行了一下。输出:
> >
> > A.__private()
> > B.public()
> >
> >
> > nmweizi,nmweizi at 163.com<%3C%21--AID_FROMADDRESS_BEGIN--%3Enmweizi at 163.com%3C%21--AID_FROMADDRESS_END--%3E>
> > 2007-08-17
> >
> > ----- Original Message -----
> >  *From: *侯华隆 <hou_hl at sina.com>
> > *To: *python中国 <python-chinese at lists.python.cn>
> > *Sent: *2007-08-17, 15:49:42
> > *Subject: *[python-chinese] 看看这段文章的输出
> >
> >   刚看了一篇文章
> >  class A(object):
> >         def __init__(self):
> >                self.__private()
> >                self.public()
> >         def __private(self):
> >                print 'A.__private()'
> >         def public(self):
> >                print 'A.public()'
> >  class B(A):
> >         def __private(self):
> >                print 'B.__private()'
> >         def public(self):
> >                print 'B.public()'
> >  b = B()
> > 猜猜输出什么?
> >  ------------------------------
> >  侯华隆
> > 2007-08-17
> >
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070905/7b24c2e0/attachment.htm 

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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号