Exemplo n.º 1
0
    def hasProdable(self, prodable: Prodable = None, name: str = None) -> bool:
        assert lxor(prodable, name), \
            "One and only one of prodable or name must be provided"

        for p in self.prodables:
            if (prodable and p == prodable) or (name and name == p.name):
                return True

        return False
Exemplo n.º 2
0
    def hasProdable(self, prodable: Prodable = None, name: str = None) -> bool:
        if not lxor(prodable, name):
            raise ValueError(
                "One and only one of prodable or name must be provided, "
                "passed {} and {}".format(prodable, name))

        for p in self.prodables:
            if (prodable and p == prodable) or (name and name == p.name):
                return True

        return False
Exemplo n.º 3
0
    def hasProdable(self, prodable: Prodable=None, name: str=None) -> bool:
        if not lxor(prodable, name):
            raise ValueError(
                "One and only one of prodable or name must be provided, "
                "passed {} and {}".format(prodable, name)
            )

        for p in self.prodables:
            if (prodable and p == prodable) or (name and name == p.name):
                return True

        return False