Hacker News new | ask | show | jobs
by microtherion 2622 days ago
"klass" is a common convention in OOP code when referring to classes, because "class" and "Class" are often reserved already.
2 comments

Python typically goes with `cls`, particularly in conjunction with the `@classmethod` decorator.
Python code uses both.
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`.
"klass" seems to somewhat outnumber "clazz" in OpenJDK, 1541 to 1021. Wonder if there's a reason they haven't settled on one.

https://github.com/openjdk/jdk/search?q=klass

https://github.com/openjdk/jdk/search?q=clazz

C# prefers `@class`