Re: Is Lexical Binding The Norm Yet?

Liste des GroupesRevenir à cl lisp 
Sujet : Re: Is Lexical Binding The Norm Yet?
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.lisp
Date : 21. Jan 2024, 12:46:31
Autres entêtes
Organisation : Stefan Ram
Message-ID : <len-20240121124048@ram.dialup.fu-berlin.de>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
ram@zedat.fu-berlin.de (Stefan Ram) writes:
Alan Bawden <alan@csail.mit.edu> writes:
Why didn't that work?
Implicit invocations of special methods are only guaranteed
to work correctly if defined on an object's type, not in
the object's instance dictionary. (See: The Python Language
Reference, Release 3.13.0a0; 3.3.12 Special method lookup).

  That was a rhetorical question!

  To use "prototypes", you need to write a custom clone method anyway
  (I just posted one to "comp.lang.python"). So, while you're at it,
  you can then as well define your custom global "len" function:

def len( x ): return x.__len__()

  . (It might still be some work to get the rest of the
  standard library to use this definition, but now we are
  talking about a library and not about a language. Yes,
  the Python standard library assumes class-based objects.)


Date Sujet#  Auteur
21 Jan 24 * Re: Is Lexical Binding The Norm Yet?3Stefan Ram
21 Jan 24 `* Re: Is Lexical Binding The Norm Yet?2Stefan Ram
21 Jan 24  `- Re: Is Lexical Binding The Norm Yet?1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal