|
105 | 105 | _TripleOrQuadSelectorType = Union["_TripleSelectorType", "_QuadSelectorType"] |
106 | 106 | _TriplePathType = Tuple["_SubjectType", Path, "_ObjectType"] |
107 | 107 | _TripleOrTriplePathType = Union["_TripleType", "_TriplePathType"] |
108 | | -# _QuadPathType = Tuple["_SubjectType", Path, "_ObjectType", "_ContextType"] |
109 | | -# _QuadOrQuadPathType = Union["_QuadType", "_QuadPathType"] |
110 | 108 |
|
111 | 109 | _GraphT = TypeVar("_GraphT", bound="Graph") |
112 | 110 | _ConjunctiveGraphT = TypeVar("_ConjunctiveGraphT", bound="ConjunctiveGraph") |
@@ -677,7 +675,7 @@ def __iter__(self) -> Generator["_TripleType", None, None]: |
677 | 675 | """Iterates over all triples in the store""" |
678 | 676 | return self.triples((None, None, None)) |
679 | 677 |
|
680 | | - def __contains__(self, triple: _TriplePatternType) -> bool: |
| 678 | + def __contains__(self, triple: _TripleSelectorType) -> bool: |
681 | 679 | """Support for 'triple in graph' syntax""" |
682 | 680 | for triple in self.triples(triple): |
683 | 681 | return True |
@@ -1979,7 +1977,7 @@ def _spoc( |
1979 | 1977 | c = self._graph(c) |
1980 | 1978 | return s, p, o, c |
1981 | 1979 |
|
1982 | | - def __contains__(self, triple_or_quad: _TripleOrQuadPatternType) -> bool: |
| 1980 | + def __contains__(self, triple_or_quad: _TripleOrQuadSelectorType) -> bool: |
1983 | 1981 | """Support for 'triple/quad in graph' syntax""" |
1984 | 1982 | s, p, o, c = self._spoc(triple_or_quad) |
1985 | 1983 | for t in self.triples((s, p, o), context=c): |
@@ -2753,7 +2751,7 @@ def triples( |
2753 | 2751 | for s1, p1, o1 in graph.triples((s, p, o)): |
2754 | 2752 | yield s1, p1, o1 |
2755 | 2753 |
|
2756 | | - def __contains__(self, triple_or_quad: _TripleOrQuadPatternType) -> bool: |
| 2754 | + def __contains__(self, triple_or_quad: _TripleOrQuadSelectorType) -> bool: |
2757 | 2755 | context = None |
2758 | 2756 | if len(triple_or_quad) == 4: |
2759 | 2757 | # type error: Tuple index out of range |
|
0 commit comments