You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-16Lines changed: 7 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ a:
59
59
{}
60
60
```
61
61
62
-
Even better, it can track then changes of the object after the changes of the variable
62
+
Even better, it can track the changes of the object after the changes of the variable
63
63
64
64
```python
65
65
from watchpoints import watch
@@ -135,7 +135,7 @@ d["a"]:
135
135
1
136
136
```
137
137
138
-
watchpoints will try to guess what you want to monitor, and monitor it as you expect(well most of the time)
138
+
**watchpoints will try to guess what you want to monitor, and monitor it as you expect**(well most of the time)
139
139
140
140
### unwatch
141
141
@@ -157,7 +157,7 @@ Or you can unwatch everything by passing no argument to it
157
157
unwatch() # unwatch everything
158
158
```
159
159
160
-
monitoring variables will introduce a significant overhead, and should be used for debugging only.
160
+
**monitoring variables will introduce a significant overhead, and should be used for debugging only.**
161
161
162
162
### alias
163
163
@@ -170,18 +170,9 @@ watch(a, alias="james")
170
170
unwatch("james")
171
171
```
172
172
173
-
### customize print
174
-
175
-
By default, watchpoints uses ```pprint``` for data printing, and print for strings. You can use your own printer function to print in any format you like
176
-
177
-
```python
178
-
watch(a, printer=my_print)
179
-
```
180
-
181
-
182
173
### customize callback
183
174
184
-
Of course sometimes you want to print in your own format, or even something more than print. You can use your own callback for monitored variables
175
+
Of course sometimes you want to print in your own format, or even do something more than print. You can use your own callback for monitored variables
185
176
186
177
```python
187
178
watch(a, callback=my_callback)
@@ -193,9 +184,9 @@ The callback function takes three arguments
193
184
def my_callback(frame, elem, exec_info)
194
185
```
195
186
196
-
```frame``` is the current frame when a change is detected.
197
-
```elem``` is a ```WatchElement``` object that I'm to lazy to describe for now.
198
-
```exec_info``` is a tuple of ```(funcname, filename, lineno)``` of the line that changed the variable
187
+
*```frame``` is the current frame when a change is detected.
188
+
*```elem``` is a ```WatchElement``` object that I'm to lazy to describe for now.
189
+
*```exec_info``` is a tuple of ```(funcname, filename, lineno)``` of the line that changed the variable
199
190
200
191
You can also set change the callback function globally by
0 commit comments