Skip to content

Should the deck methods return <DeckOfCards> object instead of returning <List<Card>> ? #2

@sammysignal

Description

@sammysignal

I noticed that the documentation indicates that methods add_deck, order_deck, shuffle_deck, reset_deck are returning deck objects, but that's not actually the case - they are instead returning a list of cards which is a bit confusing. It may be fine to return a list of cards, as long as the docs are updated, however, you could also instead simply return self. If we return self we could also write a __getitem__ function so that you can index directly into the cards object (e.g., card_obj[0]) - that way it would feel more like a list.

happy to make a pr for either option, curious which way you prefer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions