Re:Interface Dispatch (2018)
by microtherion on Thursday April 18, 2019 @09:02AM
(#19690657)
"klass" is a common convention in OOP code when referring to classes, because "class" and "Class" are often reserved already.
[ Parent
| on HN ]
Re:Interface Dispatch (2018)
by mikepurvis on Thursday April 18, 2019 @10:53AM
(#19691428)
Python typically goes with `cls`, particularly in conjunction with the `@classmethod` decorator.
Python code uses both.
Re:Interface Dispatch (2018)
by mikepurvis on Thursday April 18, 2019 @09:41PM
(#19696369)
Um, not really. PEP8 explicitly says to use `cls`:
https://www.python.org/dev/peps/pep-0008/#function-and-metho...
Java seems to prefer `clazz`.
Re:Interface Dispatch (2018)
by MaxBarraclough on Thursday April 25, 2019 @06:04PM
(#19752924)
"klass" seems to somewhat outnumber "clazz" in OpenJDK, 1541 to 1021. Wonder if there's a reason they haven't settled on one.
Re:Interface Dispatch (2018)
by noblethrasher on Thursday April 18, 2019 @12:47PM
(#19692528)
C# prefers `@class`