Article View: pl.comp.lang.python
Article #27195Re: Python a hashmapa
From: wodzik
Date: Mon, 11 Jan 2010 08:57
Date: Mon, 11 Jan 2010 08:57
13 lines
1852 bytes
1852 bytes
Całkiem fajny ten kopiec, tylko nie da się odnieść do pierwszej
wartości bez kombinowania. Przy dodawaniu kod będzie taki sam, ale już
przy usuwaniu będziemy mieli:
tmp = a.keys()[0]
a[tmp].pop()
if not a[tmp]:
a.pop(tmp)
Kod co prawda banalny, ale po pythonie spodziewał bym się metody w stylu
first(), czy jakoś tak. W każdym razie dzięki wszystkim za naprowadzenie.
Pozdrawiam wodzik
Technical Details
Message-ID:
<hiep4s$81n$1@zeus.man.szczecin.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.man.szczecin.pl!not-for-mailReferences:
<hi9a48$c1b$1@zeus.man.szczecin.pl> <20100109102348.d563af8e.natural-born-killer@dontmailme.com> <hi9nmc$iqv$1@zeus.man.szczecin.pl> <hi9rbf$1ke$2@solani.org> <hiapsg$4mg$1@zeus.man.szczecin.pl> <op.u6aa9spdfvx12t@jerzozwiesz.home.aster.pl> <hiav57$7cf$1@zeus.man.szczecin.pl> <op.u6ao2ybrfvx12t@jerzozwiesz.home.aster.pl> <hidq2u$nm8$1@zeus.man.szczecin.pl> <hids1a$ojf$1@zeus.man.szczecin.pl> <e298bc19-d560-43c4-ae5b-ff2c7c761159@a32g2000yqm.googlegroups.com> <hiengm$74p$1@zeus.man.szczecin.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.man.szczecin.pl!not-for-mail From: wodzik <wodzik@noreply.com> Newsgroups: pl.comp.lang.python Subject: Re: Python a hashmapa Date: Mon, 11 Jan 2010 09:57:07 +0100 Organization: ACI - http://www.aci.com.pl Lines: 13 Message-ID: <hiep4s$81n$1@zeus.man.szczecin.pl> References: <hi9a48$c1b$1@zeus.man.szczecin.pl> <20100109102348.d563af8e.natural-born-killer@dontmailme.com> <hi9nmc$iqv$1@zeus.man.szczecin.pl> <hi9rbf$1ke$2@solani.org> <hiapsg$4mg$1@zeus.man.szczecin.pl> <op.u6aa9spdfvx12t@jerzozwiesz.home.aster.pl> <hiav57$7cf$1@zeus.man.szczecin.pl> <op.u6ao2ybrfvx12t@jerzozwiesz.home.aster.pl> <hidq2u$nm8$1@zeus.man.szczecin.pl> <hids1a$ojf$1@zeus.man.szczecin.pl> <e298bc19-d560-43c4-ae5b-ff2c7c761159@a32g2000yqm.googlegroups.com> <hiengm$74p$1@zeus.man.szczecin.pl> NNTP-Posting-Host: 212.14.0.154 Mime-Version: 1.0 X-Trace: zeus.man.szczecin.pl 1263200221 8247 212.14.0.154 (11 Jan 2010 08:57:01 GMT) X-Complaints-To: usenet@news.man.szczecin.pl NNTP-Posting-Date: Mon, 11 Jan 2010 08:57:01 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 In-Reply-To: <hiengm$74p$1@zeus.man.szczecin.pl> X-Antivirus: avast! (VPS 100110-1, 2010-01-10), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit