Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > cz.comp.lang.python > #3271

Re: [python] Porovnání některých Ruby a Pythonu 3

From Vláďa Macek <macek@sandbox.cz>
Subject Re: [python] Porovnání některých Ruby a Pythonu 3
Newsgroups cz.comp.lang.python
Message-ID <mailman.5.1522415835.12408.python@py.cz> (permalink)
References <eece083e-feca-f3df-2bd0-73f69d725b4f@centrum.cz> <CA+7MNVqhgsi7mQKK=39_EbEMPx=wV-bBet0WRcQfTXLjhMRVhQ@mail.gmail.com> <a6504326-af8e-a2b9-b1fe-55ce825a6588@sandbox.cz>
Organization usenet-news.net
Date 2018-03-30 15:17 +0200

Show all headers | View raw


On 30.3.2018 10:31, starenka . wrote:
> Je nejakej duvod, proc vsude, kde resis neco s polem je 'array[0] if
> len(array) > 0 else None' na misto kratsiho a stejne citelnyho 'array[0]
> if len(array) else None' ?

Odkazovaný doc jsem ještě neviděl a předem za něj díky. Ale myslím, že do
podobnných "promo" matrošů patří výhradně

(lambda i: None, lambda i: array[i])[bool(array)](0)

:-)

V.

Back to cz.comp.lang.python | Previous | Next | Find similar


Thread

Re: [python]  Porovnání některých Ruby a Pythonu 3 Vláďa Macek <macek@sandbox.cz> - 2018-03-30 15:17 +0200

csiph-web