AttributeError When Calling a Class with Another Class
<p>I have this code within a classless function: </p>

<pre><code>        while room.getNumCleanedTiles() &lt; min_coverage * room.getNumTiles():
            for index in range(0, len(roboList)):
                room.cleanTileAtPosition(positionList[index])
                roboList[index].updatePositionAndClean()
                positionList[index] = roboList[index].getRobotPosition
                count += 1
</code></pre>

<ul>
<li><code>positionList</code> is a list of positions of the class <code>Position</code>. </li>
<li>The <code>position</code> class has two methods, <code>getX</code> and <code>getY</code>. </li>
<li>The <code>room</code> variable is a room of class <code>Rectangular Room</code>, which has a method known as <code>cleanTileAtPosition</code>, which takes a position as its argument and does some operations using the <code>getX()</code> and <code>getY()</code> methods. </li>
</ul>

<p>The code is too large to reasonably attach here in its entirety, but the problem seems to be localized to the methods and classes I have described. I am getting an error that states: </p>

<pre><code>"AttributeError: 'function' object has no attribute 'getX.'" 
</code></pre>

<p>However, through print statements it is clear that <code>positionList[index]</code> is indeed a position of class <code>Position</code>; that <code>room</code> is a <code>RectangularRoom</code>; and that <code>getX()</code> and <code>getY()</code> work on the position when they are called independently of the <code>cleanTileAtPosition</code>. </p>

<p>Is there anything about this code that seems like it would raise the error I am getting? </p>
