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] Tutor Digest, Vol 115, Issue 27

2013-09-12 Thread Dino Bektešević
> Date: Wed, 11 Sep 2013 18:10:18 +0530 > From: zubair alam > To: tutor > Subject: [Tutor] class data member and objects of class in python > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > i am learning how a __class__ data member behaves in python as compared to > st

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