Bring object 'out of' Class?

dave squareswallower at 1ya2hoo3.net
Sun Jun 1 17:14:44 EDT 2008


> Then you can write:
> 
>>>> hands = deck.deal_cards(4, 5) # On fait une belotte?
> 
> And I don't see the need of defining 'Hand' inside 'Deck'.
> 
> HTH

Thanks for the input.

I believe using 'class Hand(Deck):' is to illustrate (in the book) 
inheritance and how it can be used.  By using 'Hand(Deck)' I can then 
use the methods (pop_card, add_cards, etc..) defined in the 'Deck' 
class.





More information about the Python-list mailing list