5 ms·
"klass" is a common convention in OOP code when referring to classes, because "class" and "Class" are often reserved already.
by microtherion 8y ago
"klass" is a common convention in OOP code when referring to classes, because "class" and "Class" are often reserved already.
- chaosite 8y agoJava seems to prefer `clazz`.
- noblethrasher 8y agoC# prefers `@class`
- MaxBarraclough 8y ago"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=klass https://github.com/openjdk/jdk/search?q=clazz https://github.com/openjdk/jdk/search?q=clazz
- mikepurvis 8y agoPython typically goes with `cls`, particularly in conjunction with the `@classmethod` decorator.
- qwsxyh 8y agoPython code uses both.
- mikepurvis 8y agoUm, not really. PEP8 explicitly says to use `cls`: https://www.python.org/dev/peps/pep-0008/#function-and-method-arguments https://www.python.org/dev/peps/pep-0008/#function-and-metho...
- qwsxyh 8y agohttps://github.com/python/cpython/search?utf8=%E2%9C%93&q=klass&type= https://github.com/python/cpython/search?utf8=%E2%9C%93&q=kl...