def shuffle_location_tiles(self):
del self.the_game_location_tiles.locationTiles
The fdel
function should not be called directly. It will be called for you when the instance tries to delete the property.
For example,
class Foo(object):
def x():
def fget(self):
"""I'm the 'x' property."""
return self._x
def fset(self, value):
self._x = value
def fdel(self):
print('deleting x')
del self._x
return locals()
x = property(**x())
def __init__(self):
self._x = None
c = Foo()
del c.x
# deleting x
self.the_game_location_tiles.locationTiles()
raises the error
"Type error: 'locationTile' is not a callable
because self.the_game_location_tiles.locationTiles
calls fget
and returns the value, self._locationTiles[0]
. That value happens to not be callable.
You could access the property itself using GamePlayLocationTiles.locationTiles
, and call fdel
with
GamePlayLocationTiles.locationTiles.fdel(self.the_game_location_tiles)
but there is no reason to do that when you can just use the statement
del self.the_game_location_tiles.locationTiles