Commit 1a0f0f5
committed
dynassign: make _DynLiveView a singleton
This lets us get rid of the thread-local observer registry, as well as the
destructor of _DynLiveView, since there is now always exactly one observer
monitoring _EnvBlock enter/exit events.
Concurrent iteration of the singleton's items() has been tested to work
correctly.
Removing the destructor improves PyPy compatibility, since in PyPy __del__
methods may be called at an arbitrary time later (at next garbage collection
time; no reference counting in PyPy's GC), if at all. Also, __del__ methods
are not very pythonic. Good riddance!
This also gets rid of a mysterious bug involving the REPL server (see comment
in the deleted destructor code).1 parent 2658ede commit 1a0f0f5
2 files changed
+11
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
41 | | - | |
42 | | - | |
| 36 | + | |
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
46 | | - | |
47 | | - | |
| 40 | + | |
48 | 41 | | |
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
52 | 45 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 46 | | |
70 | 47 | | |
| 48 | + | |
71 | 49 | | |
72 | 50 | | |
73 | 51 | | |
| |||
211 | 189 | | |
212 | 190 | | |
213 | 191 | | |
214 | | - | |
| 192 | + | |
215 | 193 | | |
216 | 194 | | |
217 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
| |||
0 commit comments