3 ms·
Off-topic Python question: is the use of “CapWords” / CamelCase for method names correct here? I assume this is the “prevailing style” of pyobjc or Objective C
by laingc 8y ago
Off-topic Python question: is the use of “CapWords” / CamelCase for method names correct here? I assume this is the “prevailing style” of pyobjc or Objective C itself, and it therefore comes under the exception in PEP8.
I ask because I find the use of CamelCase like this for method names really off-putting.
- fiddlerwoaroof 8y agoMy general experience was that idiomatic Python generally uses snake_case for method and function names (at least, this was true of Python 2, before I stopped using python regularly)
- fiddlerwoaroof 8y agoI believe this is camelCase because of objc requirements (I’ve run into similar annoyances working on my Common Lisp bindings to cocoa.)
- bobwaycott 8y agoIt’s a byproduct of Objective C. It’s pretty common to see just about anything that provides bindings/bridges into ObjC to match the casing of the ObjC code—this is typically to help with matching and looking up relevant ObjC documentation to understand the original code better. It is off-putting, for sure.
- laingc 8y agoThat makes sense. It's good that PEP8 makes exceptions for such cases, I suppose, but it just looks wrong to my eye.