We can define classes for the suits of our cards. The suits of playing cards are an example of a type with a domain that can be exhaustively enumerated. Some other types with very small domains of values include the None type, where there's only one value, and the bool type, which has only two values.
The suit of a playing card could be thought of as an immutable object: the state should not be changed. Python has one simple formal mechanism for defining an object as immutable. We'll look at techniques to assure immutability in Chapter 4, Attribute Access, Properties, and Descriptors. While it might make sense for the attributes of a suit to be immutable, the extra effort has no tangible benefit.
The following is a class that we'll use to build four manifest constants:
from enum import Enum
class Suit(str, Enum):
Club = "♣...