From a2a6c5a41e492cf26f092b4c4249b9ca85f60f57 Mon Sep 17 00:00:00 2001 From: Tpt Date: Thu, 2 Nov 2023 18:18:56 +0100 Subject: [PATCH] Python: annotate Triple and Quad with sequence behaviors They should behave like tuples --- python/src/model.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/src/model.rs b/python/src/model.rs index 61f327a4..ffd3f0e1 100644 --- a/python/src/model.rs +++ b/python/src/model.rs @@ -614,7 +614,7 @@ impl IntoPy for PyTerm { /// A triple could also be easily destructed into its components: /// /// >>> (s, p, o) = Triple(NamedNode('http://example.com'), NamedNode('http://example.com/p'), Literal('1')) -#[pyclass(frozen, name = "Triple", module = "pyoxigraph")] +#[pyclass(frozen, sequence, name = "Triple", module = "pyoxigraph")] #[derive(Eq, PartialEq, Debug, Clone, Hash)] pub struct PyTriple { inner: Triple, @@ -812,7 +812,7 @@ impl IntoPy for PyGraphName { /// A quad could also be easily destructed into its components: /// /// >>> (s, p, o, g) = Quad(NamedNode('http://example.com'), NamedNode('http://example.com/p'), Literal('1'), NamedNode('http://example.com/g')) -#[pyclass(frozen, name = "Quad", module = "pyoxigraph")] +#[pyclass(frozen, sequence, name = "Quad", module = "pyoxigraph")] #[derive(Eq, PartialEq, Debug, Clone, Hash)] pub struct PyQuad { inner: Quad,