Two aces up Python's sleeve

Liste des GroupesRevenir à cl python 
Sujet : Two aces up Python's sleeve
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 06. Nov 2024, 02:49:15
Autres entêtes
Organisation : Stefan Ram
Message-ID : <seven-20241106014329@ram.dialup.fu-berlin.de>
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



Date Sujet#  Auteur
6 Nov 24 * Two aces up Python's sleeve15Stefan Ram
6 Nov18:27 `* Re: Two aces up Python's sleeve14Mild Shock
7 Nov09:25  `* Re: Two aces up Python's sleeve13Annada Behera
7 Nov13:03   +- Re: Two aces up Python's sleeve1Stefan Ram
7 Nov16:04   +* Re: Two aces up Python's sleeve6Mild Shock
8 Nov00:15   i`* Re: Two aces up Python's sleeve5Greg Ewing
8 Nov02:07   i +- Re: Two aces up Python's sleeve1dn
8 Nov02:25   i `* Re: Two aces up Python's sleeve3Mild Shock
8 Nov02:29   i  `* Re: Two aces up Python's sleeve2Mild Shock
8 Nov02:47   i   `- Re: Two aces up Python's sleeve1Mild Shock
8 Nov03:10   `* Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)5Lawrence D'Oliveiro
8 Nov03:40    `* Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)4Mild Shock
8 Nov21:09     +* Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)2dn
8 Nov21:49     i`- Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)1Mild Shock
9 Nov00:00     `- Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)1Thomas Passin

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal