def f(parentObject):
return [parentObject.b for parentObject in parentObject.c]
class ChildExampleClass:
def __init__(self, someInteger):
self.b = someInteger
class ParentExampleClass:
def __init__(self):
self.c = [ChildExampleClass(1), ChildExampleClass(2)]
parentEx = ParentExampleClass()
print(f(parentEx))
outputs [1,2]
It gets minified to:
def f(parentObject):return[A.b for A in A.c]
class ChildExampleClass:
def __init__(A,someInteger):A.b=someInteger
class ParentExampleClass:
def __init__(A):A.c=[ChildExampleClass(1),ChildExampleClass(2)]
parentEx=ParentExampleClass()
print(f(parentEx))
Notice how now f isn't well defined, and it will complain that A is not defined.
I'm aware this code is against multiple clean code practices.
This code:
outputs [1,2]
It gets minified to:
Notice how now f isn't well defined, and it will complain that A is not defined.
I'm aware this code is against multiple clean code practices.