1
- use std:: collections:: HashSet ;
2
-
3
1
use pyo3:: { prelude:: * , types:: PyTuple } ;
4
2
5
- #[ pyclass( subclass) ]
3
+ #[ pyclass( subclass, weakref ) ]
6
4
struct Base {
5
+ // Hashcons
7
6
#[ pyo3( get, set) ]
8
7
op : String ,
9
8
#[ pyo3( get, set) ]
@@ -16,13 +15,46 @@ struct Base {
16
15
symbolic : bool ,
17
16
#[ pyo3( get, set) ]
18
17
annotations : Py < PyTuple > ,
18
+
19
+ // Not Hashcons
20
+ #[ pyo3( get, set) ]
21
+ simplifiable : Option < PyObject > ,
22
+ #[ pyo3( get, set) ]
23
+ depth : Option < PyObject > ,
24
+
25
+ #[ pyo3( get, set) ]
26
+ _hash : Option < PyObject > ,
27
+ #[ pyo3( get, set) ]
28
+ _simplified : Option < PyObject > ,
29
+ #[ pyo3( get, set) ]
30
+ _cache_key : Option < PyObject > ,
31
+ #[ pyo3( get, set) ]
32
+ _cached_encoded_name : Option < PyObject > ,
33
+ #[ pyo3( get, set) ]
34
+ _errored : Option < PyObject > ,
35
+ #[ pyo3( get, set) ]
36
+ _eager_backends : Option < PyObject > ,
37
+ #[ pyo3( get, set) ]
38
+ _excavated : Option < PyObject > ,
39
+ #[ pyo3( get, set) ]
40
+ _burrowed : Option < PyObject > ,
41
+ #[ pyo3( get, set) ]
42
+ _uninitialized : Option < PyObject > ,
43
+ #[ pyo3( get, set) ]
44
+ _uc_alloc_depth : Option < PyObject > ,
45
+ #[ pyo3( get, set) ]
46
+ _uneliminatable_annotations : Option < PyObject > ,
47
+ #[ pyo3( get, set) ]
48
+ _relocatable_annotations : Option < PyObject > ,
49
+
19
50
}
20
51
21
52
#[ pymethods]
22
53
impl Base {
23
54
#[ new]
24
55
#[ pyo3( signature = ( op, args, length, variables, symbolic, annotations) ) ]
25
56
fn new (
57
+ py : Python ,
26
58
op : String ,
27
59
args : Py < PyTuple > ,
28
60
length : PyObject ,
@@ -37,6 +69,22 @@ impl Base {
37
69
variables,
38
70
symbolic,
39
71
annotations,
72
+
73
+ simplifiable : None ,
74
+ depth : None ,
75
+
76
+ _hash : None ,
77
+ _simplified : None ,
78
+ _cache_key : None ,
79
+ _cached_encoded_name : None ,
80
+ _errored : None ,
81
+ _eager_backends : None ,
82
+ _excavated : None ,
83
+ _burrowed : None ,
84
+ _uninitialized : None ,
85
+ _uc_alloc_depth : None ,
86
+ _uneliminatable_annotations : None ,
87
+ _relocatable_annotations : None ,
40
88
} )
41
89
}
42
90
}
0 commit comments