Skip to content

Commit 1789bc8

Browse files
Update garbage_collector.md
Replace pycon annotation with python for better code visibility in GitHub env.
1 parent 71ede11 commit 1789bc8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

InternalDocs/garbage_collector.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ count field can be examined using the `sys.getrefcount()` function (notice that
1616
value returned by this function is always 1 more as the function also has a reference
1717
to the object when called):
1818

19-
```pycon
19+
```python
2020
>>> x = object()
2121
>>> sys.getrefcount(x)
2222
2
@@ -31,7 +31,7 @@ to the object when called):
3131
The main problem with the reference counting scheme is that it does not handle reference
3232
cycles. For instance, consider this code:
3333

34-
```pycon
34+
```python
3535
>>> container = []
3636
>>> container.append(container)
3737
>>> sys.getrefcount(container)
@@ -198,7 +198,7 @@ the case of a circular linked list which has one link referenced by a
198198
variable `A`, and one self-referencing object which is completely
199199
unreachable:
200200

201-
```pycon
201+
```python
202202
>>> import gc
203203

204204
>>> class Link:
@@ -438,7 +438,7 @@ These thresholds can be examined using the
438438
[`gc.get_threshold()`](https://docs.python.org/3/library/gc.html#gc.get_threshold)
439439
function:
440440

441-
```pycon
441+
```python
442442
>>> import gc
443443
>>> gc.get_threshold()
444444
(700, 10, 10)
@@ -448,7 +448,7 @@ The content of these generations can be examined using the
448448
`gc.get_objects(generation=NUM)` function and collections can be triggered
449449
specifically in a generation by calling `gc.collect(generation=NUM)`.
450450

451-
```pycon
451+
```python
452452
>>> import gc
453453
>>> class MyObj:
454454
... pass
@@ -562,7 +562,7 @@ The garbage collector module provides the Python function `is_tracked(obj)`, whi
562562
the current tracking status of the object. Subsequent garbage collections may change the
563563
tracking status of the object.
564564

565-
```pycon
565+
```python
566566
>>> gc.is_tracked(0)
567567
False
568568
>>> gc.is_tracked("a")

0 commit comments

Comments
 (0)