p3_c18
index
/Users/slott/Documents/Writing/Mastering OO Python/Code/p3_c18.py

Part 3 Chapter 18 Example.

 
Classes
       
builtins.object
Card

 
class Card(builtins.object)
    Definition of a numeric rank playing card.
Subclasses will define ``FaceCard`` and ``AceCard``.
 
:ivar rank: Rank
:ivar suit: Suit
:ivar hard: Hard point total for a card
:ivar soft: Soft total; same as hard for all cards except Aces.
 
  Methods defined here:
__init__(self, rank, suit, hard, soft=None)
Define the card.
 
:param rank: Numeric rank in the range 1-13.
:param suit: Suit object (often a character from '♣♡♢♠')
:param hard: Hard point total (or 10 for FaceCard or 1 for AceCard)
:param soft: The soft total for AceCard, otherwise defaults to hard.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
card(rank, suit)
Create a ``Card`` instance from rank and suit.
 
:param rank: Numeric rank in the range 1-13.
:param suit: Suit object (often a character from '♣♡♢♠')
:returns: Card instance
:raises TypeError: rank out of range.