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.0rc3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

deck-3.0.0rc3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deck-3.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 82679cb47b9960daa30856097253477e92f34fecddf7092ba705015cf07a0a69
MD5 418c36089ea43eafb7ec77a56748b2d3
BLAKE2b-256 2d026aa246b52860f952fa2078872c355ead595d7545f7978ee62ce6512304db

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for deck-3.0.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 d20b79db75c036f0a51f59ec865925428891ae028c0665b0e47830fc60819a52
MD5 de48964b28bce3670bb8f3726b294428
BLAKE2b-256 90d1033903458730c0f33122ce6ac2ac4c8f56da2902e75740977b2de0a017dc

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