You have a design problem here.
First of all, the class does not remember the order of attributes assigned to it. Second, in order to make the class (not an instance) iterable we would have to dive into metaprogramming, which is certainly overkill for what you are trying to do. Third, your class just holds a bunch of data without any methods, which often is a waste of a class. You might as well use a dictionary or an OrderedDict
from the collections module.
But there is a better way. Cue named tuples, which solve your problem much more elegantly and are iterable. The following demonstration uses only three attributes for brevity.
>>> from collections import namedtuple
>>>
>>> Coordinate = namedtuple('Coordinate', 'location x y')
>>> Building = namedtuple('Building', 'h_armory h_dependence h_villa')
>>>
>>> my_building = Building(Coordinate('h_armory', 284, 384),
... Coordinate('h_dependance', 176, 320),
... Coordinate('h_villa', 244, 188))
>>>
>>> for location, x, y in my_building:
... print(location, x, y)
...
h_armory 284 384
h_dependance 176 320
h_villa 244 188
(I used your names, but as far as I can tell the name City
or Village
would make more sense than the name Building
, because the latter seems to be holding the coordinates of a bunch of different buildings.)