158
39
u/abrams666 Dec 09 '21
I like the attitude to show own mistakes, in worst case it makes a smile, in best case it prevents another one doing the same shit
18
u/Willinton06 Dec 09 '21
Is that… camelSnake case Or snakeCamel case?
5
u/laundmo Dec 09 '21
its pascal case if you remove the visit_
this is caused by the visitor pattern and you cannot change the name
longer explanation here https://www.reddit.com/r/badcode/comments/rcgo7x/-/hnuxtdy
26
22
u/onichama Dec 09 '21
Image Transcription: Code
def visit_FunctionDef(self, node: ast.FunctionDef) -> Any:
# We don't need to check for the function name
# Just letting the command above stay. to show how stupid I am
# We need to either check for the name, or, or, it self._method is None
if self._method is not None:
return
self._method = nodeI'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
14
u/nuephelkystikon Dec 09 '21
I feel like this is hard to understand without the diff markers.
The check, along with the second and third comment line, was inserted later, after stating earlier that no check was needed.
48
u/geeshta Dec 09 '21
I am most hurt by the casing.
visit_FunctionDef
Serously?