Exemple #1
0
    def from_chars(cls, *args):
        """return a new object from pairs of character symbols

        works with either multiple arguments, or a single iterable
        """

        try:
            return cls(Card.from_chars(chars) for chars in args)
        except CardCreationError:
            try:
                return cls(Card.from_chars(chars) for chars in args[0])
            except (TypeError, CardCreationError):
                pass
            raise HandCreationError('invalid card symbols')