Imports not working in Google App Engine project
Question: Im working in python to build a webapp using GAE. The project was originally
built with out GAE, and it worked just great, then I brought those files into
the GAE project, and all of a sudden they don't play so nice anymore. One file
land.py has 4 classes representing different land types, and a list of list
containing several instances of each one. They are all based off the land
class, in the land.py file.

    
    
    class Land():
        def __init__(self):
            self.elevation = 0
            self.neighbors = []
            self.creatures = []
            self.location = (0, 0)
            self.was = None#to keep track of when flooded     
        def __str__(self):
            return("location " + str(self.location) + 
                   " elevation " + str(self.elevation) + 
                   " neighbors " + str(len(self.neighbors)) + 
                   " creatures " + str(x.name for x in self.creatures) + " | ")
        def redefine(self, land):
            self.elevation = land.elevation
            self.neighbors = land.neighbors
            self.creatures = land.creatures
            self.location = land.location
            self.was = land
    

The other class simulation.py imports land, and should be able to use it, but
when I try

    
    
    self.map =  Land.landMass(the list of list's)    
    for row in self.map: 
            print(row)
    

It will print `'[,,,,,,,][,,,,,,,][,,,,,,,][,,,,,,,]'` it does see that there
are objects in there because when I do

    
    
    for i in self.map:
                for x in i:
                    output += x.__str__()
    

it prints each land object's proper output. This is a problem because when I
want to check

    
    
    for row in self.map:
        for column in row: 
            if isinstance(land, Land.Water):  #or type(land) 
    

it first has no clue what land is but it also does know what Land.Water is. I
can provide code if you like, but it's hard to figure out exactly where the
problem could be. Again, in its own project file it all works but in the GAE
project it doesn't. Anyone know why?


Answer: print(row) is doing a repr(object) not str(obj) If you look at the source of
the page you will see something like

As for the rest of your code, without knowing the definition of Land it's hard
to tell. Is Land a db/ndb Model ?

Also your title for this question doesn't really have anything to do with the
question you have asked. I don't see any problems with imports.

As to the specific question about "it first has no clue what land is" I assume
you are getting a `NameError name 'land' is not defined` , if not please
include a bit more detail as to the error. And if it is the correct error,
where are you defining `land` ?

Also this line looks wrong `if isinstance(land, Land.Water): or type(land)`
that would give you a SyntaxError

