🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #27361

Re: Przestrzeń nazw (?)

#27361
From: pakalk
Date: Sun, 21 Mar 2010 19:12
40 lines
1837 bytes
On 14 Mar, 13:06, pr <crico...@gmail.com> wrote:
> Witam,
>
> Czy w Pythonie (3.1) można zrobić coś takiego (jeden plik):
>
> class A:
>   class AA:
>     obj = B()
>
> class B:
>   class BB:
>     obj = A()
>
> A()
> B()
>
> ?

Nie wdając się w to, czy to co robisz ma sens... tak nie może być:

class A:
    class AA:
        o = None

        def __init__(self):
            self.o = B()


class B:
    class BB:
        o = None

        def __init__(self):
            self.o = A()


a = A()
b = B()

?
Technical Details
Message-ID: <80426773-174a-43db-bdbe-0930299c67cb@c16g2000yqd.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!feed.news.interia.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!c16g2000yqd.googlegroups.com!not-for-mail
References: <9100aa5e-8f93-493a-8e57-23dd86779de2@o3g2000yqb.googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!feed.news.interia.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!c16g2000yqd.googlegroups.com!not-for-mail
From: pakalk <pakalk@gmail.com>
Newsgroups: pl.comp.lang.python
Subject: Re: Przestrzeń nazw (?)
Date: Sun, 21 Mar 2010 12:12:48 -0700 (PDT)
Organization: http://groups.google.com
Lines: 40
Message-ID: <80426773-174a-43db-bdbe-0930299c67cb@c16g2000yqd.googlegroups.com>
References: <9100aa5e-8f93-493a-8e57-23dd86779de2@o3g2000yqb.googlegroups.com>
NNTP-Posting-Host: 83.4.183.231
Mime-Version: 1.0
X-Trace: posting.google.com 1269198768 29898 127.0.0.1 (21 Mar 2010 19:12:48 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 21 Mar 2010 19:12:48 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: c16g2000yqd.googlegroups.com; posting-host=83.4.183.231;  posting-account=rLTIYAoAAAAC0UY184o3dcMgnRpikGCw
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)  AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036  Safari/532.5,gzip(gfe),gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit