Deutsch English Français Italiano |
<vgg5dn$ij48$1@solani.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock <janburse@fastmail.fm> Newsgroups: comp.lang.python Subject: Re: Two aces up Python's sleeve Date: Wed, 6 Nov 2024 17:27:37 +0100 Message-ID: <vgg5dn$ij48$1@solani.org> References: <seven-20241106014329@ram.dialup.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 6 Nov 2024 16:27:35 -0000 (UTC) Injection-Info: solani.org; logging-data="609416"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19 Cancel-Lock: sha1:M03Vtyt4+5BpqZEdwsaU730doy8= In-Reply-To: <seven-20241106014329@ram.dialup.fu-berlin.de> X-User-ID: eJwNysEBwCAIA8CVEEiQcaiU/UfQ9x2MiyecoGMwVC3iyBnZ2rHYTatPGvm/oNHtCE+ley2bytwm8OdZaXUBP+oUsA== Bytes: 2012 Lines: 32 Then please explain why I have to write: i += 1 Instead of the shorter: i ++ My short-term memory is really stressed. Stefan Ram schrieb: > ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted: >> last_item = my_list[ -1 ] >> Way cleaner than my_list[ len( my_list )- 1 ], don't you think? > > In "The Mental Game of Python," Raymond Hettinger spills the > beans about our noggins only being able to juggle 7 +/- 2 > things in our short-term memory. > > So, "last_item = my_list[ -1 ]" might still make the cut, > while "my_list[ len( my_list)- 1 ]" could be biting off > more than we can chew. > > |The problem is, the number of brain registers this uses is > |10. This is no longer a decryption effort. This is a puzzle. > |At the moment you put it together, you fully understand it. > |But if this is embedded in bigger code, every time you hit > |this line, you're going to have to pick apart "what does this > |thing do?". > Raymond Hettinger > >