Skip to main content

Implementation of the deck collection type.

Project description

Deck

Code style: black

Deck is an implementation of the deck collection type, commonly confused with collections.deque.

>>> from deck import Deck
>>> d = Deck()
>>> d.shuffle()
>>> d.deal()
Card(<Suit.Diamonds: '♦'>, <Value.Two: 2>)
>>> d.deal()
Card(<Suit.Diamonds: '♦'>, <Value.Three: 3>)
>>> d.deal()
Card(<Suit.Hearts: '♥'>, <Value.Ten: 10>)
>>> d.deal()
Card(<Suit.Diamonds: '♦'>, <Value.Nine: 9>)

Deck supports cheating, if that's how you want to play.

>>> d.deal_from_bottom()
Card(<Suit.Spades: '♠'>, <Value.Five: 5>)

Importing the deck module also globally corrects other typographical errors that may occur in your code.

>>> import deck
>>> from collections import deck
>>> deck
<class 'deck.Deck'>

Taking this module too seriously would be a mistake.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deck-3.0.0rc2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

deck-3.0.0rc2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file deck-3.0.0rc2.tar.gz.

File metadata

  • Download URL: deck-3.0.0rc2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for deck-3.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 032ddceed733ca064245ba03833ba99bde2a85e5176914eeb49b9b18bdbd576f
MD5 ce77d28188baf505c8577184e99ac896
BLAKE2b-256 b50287af19b79c1419c7b04364471b24856fff2ccf0d32e08fce7fb5c2e68671

See more details on using hashes here.

File details

Details for the file deck-3.0.0rc2-py3-none-any.whl.

File metadata

  • Download URL: deck-3.0.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for deck-3.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 1673a9114951621589675c89b591fd89d91bb4ea670e6752d7693921fe1fce38
MD5 02db203d5b9b98aa3dd0ce49c6cd4a95
BLAKE2b-256 587db575d5abf8e4bc5fbb5142a6cfc8e863361f78be20a0c3b9b1a385fcf254

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page