Re: [Tutor] class data member and objects of class in python

2013-09-12 Thread Dave Angel
On 12/9/2013 05:10, zubair alam wrote: > class PizzaShop():    pizza_stock = > 10    def get_pizza(self):        while > PizzaShop.pizza_stock:            PizzaShop.pizza_stock -= > 1            yield "take yours pizza order, total pizzas left > {}".format(PizzaShop.pizza_stock) > mypizza_sho

Re: [Tutor] class data member and objects of class in python

2013-09-12 Thread Alan Gauld
On 12/09/13 10:10, zubair alam wrote: class PizzaShop(): pizza_stock = 10 def get_pizza(self): while PizzaShop.pizza_stock: PizzaShop.pizza_stock -= 1 yield "take yours pizza order, total pizzas left {}".format(PizzaShop.pizza_stock) mypizza_shop = Pi

Re: [Tutor] class data member and objects of class in python

2013-09-12 Thread zubair alam
class PizzaShop(): pizza_stock = 10 def get_pizza(self): while PizzaShop.pizza_stock: PizzaShop.pizza_stock -= 1 yield "take yours pizza order, total pizzas left {}".format(PizzaShop.pizza_stock) mypizza_shop = PizzaShop() pizza_order = mypizza_shop.get_pizz

Re: [Tutor] class data member and objects of class in python

2013-09-12 Thread Felix Dietrich
> i am learning how a __class__ data member behaves in python as > compared to static data member in java [...] The error is not related to class variables. Also could you elaborate on what you intended to find out with this snippet? > class PizzaShop(): > pizza_stock = 10 > > def get_pi

Re: [Tutor] class data member and objects of class in python

2013-09-11 Thread Marc Tompkins
On Wed, Sep 11, 2013 at 5:40 AM, zubair alam wrote: > i am learning how a __class__ data member behaves in python as compared to > static data member in java, but following code is throwing error > > > class PizzaShop(): > pizza_stock = 10 > def get_pizza(self): > while not PizzaSh

[Tutor] class data member and objects of class in python

2013-09-11 Thread zubair alam
i am learning how a __class__ data member behaves in python as compared to static data member in java, but following code is throwing error class PizzaShop(): pizza_stock = 10 def get_pizza(self): while not PizzaShop.pizza_stock: PizzaShop.pizza_stock -= 1