[Tutor] AttributeError: instance has no __call__ method

Marc Gartler gartler at express.cites.uiuc.edu
Thu Dec 16 04:32:29 CET 2004


# --superclass--
class FrameCost:
	def __init__(self):
		self.width = int(0)
		self.length = int(0)
     # Calculate cost per square foot
	def Cost_per_sqft(self, cost):
		return (((self.width) * (self.length) / 144.00) * (cost))
     # Calculate cost per linear foot
	def Cost_per_ft(self, cost):
		return (((((self.width) * 2.00) + ((self.length) * 2.00)) / 12.00) * 
(cost))
	def Width(self, argt):
		self.width = argt
	def Length(self, argt):
		self.length = argt

# --Three subclasses for glass --
		
class RegGlassCost(FrameCost):
	def Cost(self):
		self.cost = 3	# Define costs in dollars
		return (self.Cost_per_sqft(self.cost))
		
class BlueGlassCost(FrameCost):
	def Cost(self):
		self.cost = 4
		return (self.Cost_per_sqft(self.cost))
		
class YellowGlassCost(FrameCost):
	def Cost(self):
		self.cost = 5
		return (self.Cost_per_sqft(self.cost))
		
# -- Another Subclass for Labor --
class LaborCost(FrameCost):
	def Cost(self):
		self.cost = 5.25
		return (self.Cost_per_sqft(self.cost))


On Wednesday, December 15, 2004, at 09:20  PM, Max Noel wrote:
>
> 	Can we see your code for the *GlassCost classes?



More information about the Tutor mailing list