Add note about similarity between class methods and Delphi's virtual
class methods.
This commit is contained in:
parent
4673cd0bba
commit
21a691e0e5
10
pep-0252.txt
10
pep-0252.txt
|
@ -381,10 +381,12 @@ Static methods and class methods
|
|||
receive an implicit first argument that is the *class* for which
|
||||
they are invoked. This has no C++ or Java equivalent, and is not
|
||||
quite the same as what class methods are in Smalltalk, but may
|
||||
serve a similar purpose. (Python also has real metaclasses, and
|
||||
perhaps methods defined in a metaclass have more right to the name
|
||||
"class method"; but I expect that most programmers won't be using
|
||||
metaclasses.) Here's an example:
|
||||
serve a similar purpose. According to Armin Rigo, they are
|
||||
similar to "virtual class methods" in Borland Pascal dialect
|
||||
Delphi. (Python also has real metaclasses, and perhaps methods
|
||||
defined in a metaclass have more right to the name "class method";
|
||||
but I expect that most programmers won't be using metaclasses.)
|
||||
Here's an example:
|
||||
|
||||
class C:
|
||||
|
||||
|
|
Loading…
Reference in New Issue