def f(_): class A(): def __init__(selfArg, x): if x > 0: selfArg.x = x else: selfArg.x = (-1) * x return A(1).x + A(-1).x
def f(arg): class A(): def __init__(selfArg): selfArg.x = 2 selfArg.x = selfArg.x + 1 return A().x + arg
def f(arg): class A(): def __init__(self, x): self.x = x self.y = self.x + 1 return A(arg).x
def f(arg): class A(): def __init__(self, x): self_x = arg self.x = x + self_x return A(2).x
def test_class_line_number_collision(self): from ufora.FORA.python.PurePython.testModules.same_line_number.A import A from ufora.FORA.python.PurePython.testModules.same_line_number.A import B line_number_of_class_A_definition = PyforaInspect.getsourcelines(A)[1] line_number_of_class_B_definition = PyforaInspect.getsourcelines(B)[1] self.assertEqual(line_number_of_class_A_definition, line_number_of_class_B_definition) with self.create_executor() as executor: x = 99999 with executor.remotely.downloadAll(): a = A(99999) self.assertIsInstance(a, A) self.assertEqual(a.__dict__, A(x).__dict__)
def f(arg): class A(): def __init__(self, x): self.x = x self.x = self.x + 1 def foo(self, y): return self.x + y return A(arg).foo(2)
def f(): class A(): def __init__(self, x): (self.x, self.y) = (x, x + 1) return A(2).x
def f(arg): class A(): def __init__(self, x): self.x = x + arg return A(2).x