Article View: pl.comp.lang.python
Article #28079Re: Interpretowany czy kompilowany?
From: Jordan Szubert
Date: Fri, 27 May 2011 14:40
Date: Fri, 27 May 2011 14:40
60 lines
3314 bytes
3314 bytes
Dnia 27-05-2011 o 12:48:58 jacek2v <jacek2v@gmail.com> napisał(a): > On 26 Maj, 21:16, Wojciech Malinowski <vir...@wp.pl> wrote: >> On 05/26/11 21:00, jacek2v wrote: >> >> > Dzięki za wyjaśnienie. Muszę przyznać, że jak to wielokrotnie bywało >> > logika Pythona jest niezaprzeczalna, powalająca i miła memu sercu :) >> >> Nie ma sprawy. >> >> BTW Skoro nikt się nie pofatygował sprostować tego co napisałem to sam >> sprostuję: funkcje nie są singletonami. Są normalnymi instancjami klasy >> function. > > Myślę, że się nie pomyliłeś. To jest singleton w rozumieniu tylko > "jedna instancja danej klasy". obawiam się, że albo Cię nie rozumiem, albo nie masz jednak racji: mi wychodzi, że funkcje są tej samej klasy, nie jest generowana oddzielna klasa dla każdej funkcji, a dopiero wtedy bym uznał określenie „singleton” za zasadne. Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> def foo(): ... pass ... >>> def bar(): ... pass ... >>> type(foo) is type(bar) True >>> foo.__class__ is bar.__class__ True >>> type(foo) <type 'function'> >>> Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> def foo(): ... pass ... >>> def bar(): ... pass ... >>> type(foo) <class 'function'> >>> type(foo) is type(bar) True >>> foo.__class__ is bar.__class__ True >>> -- Jordan Szubert
Technical Details
Message-ID:
<op.vv49ptxhhilul8@asus7.home>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!newsfeed2.atman.pl!newsfeed.atman.pl!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailReferences:
<iqmlha$r29$1@news.onet.pl> <iqugpk$vbu$3@solani.org> <64a9b1f5-e71a-4b1e-b54b-029a032d6a17@x1g2000yqb.googlegroups.com> <ir58gg$me$1@speranza.aioe.org> <2f93f4ca-ccb1-42a5-b199-2d9902ee8629@l18g2000yql.googlegroups.com> <ir90vs$nd8$1@speranza.aioe.org> <b807128c-8325-4ef6-93a9-c41ba1609583@h7g2000yqa.googlegroups.com> <irbh66$4fa$1@news.onet.pl> <c4a63f8f-afbc-4dab-ab9e-4c241433ab38@28g2000yqu.googlegroups.com> <irg9ua$pb6$1@news.onet.pl> <3ede9f91-b3da-4845-94e3-697e9301d530@d1g2000yqm.googlegroups.com> <20110525202013.b67a5b5a.gryf_esm-no@spam-o2.pl> <31a73c32-7483-4f0b-b2fa-386103875cf4@x6g2000yqj.googlegroups.com> <c72bf0b2-afa1-4e1b-80aa-7198e59e2e45@b42g2000yqi.googlegroups.com> <irjnsg$g0e$1@inews.gazeta.pl> <4f2c76ae-c4f5-4cac-99c8-138ec0019139@y12g2000yqh.googlegroups.com> <irm8uf$293$1@inews.gazeta.pl> <da18f5f5-5eba-4d14-a818-f9256cc31ae5@c41g2000yqm.googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!newsfeed2.atman.pl!newsfeed.atman.pl!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail Newsgroups: pl.comp.lang.python Subject: Re: Interpretowany czy kompilowany? References: <iqmlha$r29$1@news.onet.pl> <iqugpk$vbu$3@solani.org> <64a9b1f5-e71a-4b1e-b54b-029a032d6a17@x1g2000yqb.googlegroups.com> <ir58gg$me$1@speranza.aioe.org> <2f93f4ca-ccb1-42a5-b199-2d9902ee8629@l18g2000yql.googlegroups.com> <ir90vs$nd8$1@speranza.aioe.org> <b807128c-8325-4ef6-93a9-c41ba1609583@h7g2000yqa.googlegroups.com> <irbh66$4fa$1@news.onet.pl> <c4a63f8f-afbc-4dab-ab9e-4c241433ab38@28g2000yqu.googlegroups.com> <irg9ua$pb6$1@news.onet.pl> <3ede9f91-b3da-4845-94e3-697e9301d530@d1g2000yqm.googlegroups.com> <20110525202013.b67a5b5a.gryf_esm-no@spam-o2.pl> <31a73c32-7483-4f0b-b2fa-386103875cf4@x6g2000yqj.googlegroups.com> <c72bf0b2-afa1-4e1b-80aa-7198e59e2e45@b42g2000yqi.googlegroups.com> <irjnsg$g0e$1@inews.gazeta.pl> <4f2c76ae-c4f5-4cac-99c8-138ec0019139@y12g2000yqh.googlegroups.com> <irm8uf$293$1@inews.gazeta.pl> <da18f5f5-5eba-4d14-a818-f9256cc31ae5@c41g2000yqm.googlegroups.com> Date: Fri, 27 May 2011 16:40:31 +0200 MIME-Version: 1.0 From: "Jordan Szubert" <usenet@joru.us.to> Organization: HELL inc. Message-ID: <op.vv49ptxhhilul8@asus7.home> User-Agent: Opera Mail/11.11 (Win32) Lines: 75 NNTP-Posting-Host: 83.26.232.129 X-Trace: 1306507231 unt-rea-a-02.news.neostrada.pl 2505 83.26.232.129:18561 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit