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-2.3.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file deck-2.3.tar.gz.

File metadata

  • Download URL: deck-2.3.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for deck-2.3.tar.gz
Algorithm Hash digest
SHA256 7c197ff3123107eff700088853de840415f0d84e26c03860b5f07c3a841d0feb
MD5 c9bb07c62bc635e1813dc2d8cba5e5fd
BLAKE2b-256 2caa270b32229e0ecaf17408c86060c6088beb1023c28fcbafe760e65ccd66ba

See more details on using hashes here.

File details

Details for the file deck-2.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for deck-2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5364f5f3f048483b34ad19a21e469c2db16bcd5f31fac2f30611ff8ccffe657f
MD5 6751cb2490e8aca2c14bb010123fe096
BLAKE2b-256 853e6bc4773679322b00be72451370046f2f9d25c9573aa601b60c94a46590ee

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