1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 790e2ef

Document

  • Participants
  • Parent commits ae87826
  • Branches default

Comments (0)

Files changed (1)

File pypy/doc/coding-guide.rst

View file
  • Ignore whitespace
 
 + methods and other class attributes do not change after startup
 + single inheritance is fully supported
-+ simple mixins somewhat work too, but the mixed in class needs a
-  ``_mixin_ = True`` class attribute. isinstance checks against the
-  mixin type will fail when translated.
++ use `rpython.rlib.objectmodel.import_from_mixin(M)` in a class
+  body to copy the whole content of a class `M`.  This can be used
+  to implement mixins: functions and staticmethods are duplicated
+  (the other class attributes are just copied unmodified).
 
 + classes are first-class objects too