🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Największy problem Pythona.

#8788
From: Darek Suchojad
Date: Thu, 12 May 2005 11:38
50 lines
1963 bytes
Qertoip wrote:


> A teraz dla wszystkich proponujących dir( obj ) zamieszczam screenshota: 
> http://www.wlodarek.top100.net.pl/ObjectMembersList.png
> 
> "Bajer", "pierdółka"? 

Ale, heh, co to jest za przykład? Co on ma pokazywać tak naprawdę?
W pedivtu4nyre$.1wvgjjhuk1780$.dlg@40tude.net podałeś przykład
w Pythonie:


def f(a):
    return a

p = True
if p:
    obj = f(1)
else:
    obj = f("")

obj.???

co Twoje IDE powiedziałoby na coś takiego?

class Testowa  {
    class A {
        void a1() {}
        void a2() {}
    }
    class B {
        void b1() {}
        void b2() {}
    }

    static object make_foo(string arg) {
    if(arg == "1")
        return new A();
    else
        return new B();
    }

    public static void Main(string[] args) {
        object foo = make_foo(args[0]);
        foo.? // O, to ta linijka
    }
}

darek
Technical Details
Message-ID: <d5vf78$dgt$1@slupsk.slp.vectranet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.vectranet.pl!news.slp.vectranet.pl!not-for-mail
References: <jsq2enrcpp4r$.nmpn8bgh83ge.dlg@40tude.net> <d5r1l6$flm$1@nemesis.news.tpi.pl> <1njwce3cqj46q.11f4hsu79ksgd.dlg@40tude.net> <1gvuz1q6mpswb.2m8e9kggxehl.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.vectranet.pl!news.slp.vectranet.pl!not-for-mail
From: Darek Suchojad <dsuch@users.sarovar.org>
Newsgroups: pl.comp.lang.python
Subject: Re: Największy problem Pythona.
Date: Thu, 12 May 2005 13:38:21 +0200
Organization: VectraNet.pl
Lines: 50
Message-ID: <d5vf78$dgt$1@slupsk.slp.vectranet.pl>
References: <jsq2enrcpp4r$.nmpn8bgh83ge.dlg@40tude.net> <d5r1l6$flm$1@nemesis.news.tpi.pl> <1njwce3cqj46q.11f4hsu79ksgd.dlg@40tude.net> <1gvuz1q6mpswb.2m8e9kggxehl.dlg@40tude.net>
NNTP-Posting-Host: 10.12.246.241
Mime-Version: 1.0
X-Trace: slupsk.slp.vectranet.pl 1115897896 13853 10.12.246.241 (12 May 2005 11:38:16 GMT)
X-Complaints-To: admin@slp.vectranet.pl
NNTP-Posting-Date: Thu, 12 May 2005 11:38:16 +0000 (UTC)
In-Reply-To: <1gvuz1q6mpswb.2m8e9kggxehl.dlg@40tude.net>
X-Accept-Language: en-us, en
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.3) Gecko/20040910
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit