I'm trying to reference a variable tha I declared in init as a default value for one of my class methods but i get the NameError: name 'self' is not defined.
class A:
def __init__(self, f):
self.c = f
def b(self, d=self.c):
pass
how can I do this then?
this is parts of my code
class World:
def __init__(self, shp):
self.shape = shp
def position_finder(self, pos0=(int(self.shape[0]/2), int(self.shape[1]/2)), t_rang=int(self.shape[0]/2), f_rang=0):
pass
world_shape = (100, 100)
world = World(world_shape)
world.position_finder()