blueloveTH 2 лет назад
Родитель
Сommit
6eb2fa3ba1
3 измененных файлов с 59 добавлено и 1 удалено
  1. 19 0
      docs/modules/array2d.md
  2. 39 0
      docs/modules/line_profiler.md
  3. 1 1
      docs/retype.yml

+ 19 - 0
docs/modules/array2d.md

@@ -0,0 +1,19 @@
+---
+icon: package
+label: array2d
+---
+
+Efficient general-purpose 2D array.
+
+https://github.com/pocketpy/pocketpy/blob/main/include/typings/array2d.pyi
+
+## Example
+
+```python
+from array2d import array2d
+
+a = array2d(3, 4, default=0)
+
+a[1, 2] = 5
+print(a[1, 2]) # 5
+```

+ 39 - 0
docs/modules/line_profiler.md

@@ -0,0 +1,39 @@
+---
+icon: package
+label: line_profiler
+---
+
+Line-by-line profiler for Python.
+
+## Example
+
+```python
+from line_profiler import LineProfiler
+
+def my_func():
+    a = 0
+    for i in range(1000000):
+        a += i
+    return a
+
+lp = LineProfiler()
+
+lp.add_function(my_func)
+
+lp.runcall(my_func)
+
+lp.print_stats()
+```
+
+```txt
+Total time: 0.243s
+File: 84_line_profiler.py
+Function: my_func at line 3
+Line #      Hits         Time  Per Hit   % Time  Line Contents
+==============================================================
+     3                                           def my_func():
+     4         1            0        0      0.0      a = 0
+     5   1000001           69        0     28.4      for i in range(1000000):
+     6   1000001          174        0     71.6          a += i
+     7         1            0        0      0.0      return a
+```

+ 1 - 1
docs/retype.yml

@@ -3,7 +3,7 @@ output: .retype
 url: https://pocketpy.dev
 branding:
   title: pocketpy
-  label: v1.4.0
+  label: v1.4.1
   logo: "./static/logo.png"
 favicon: "./static/logo.png"
 meta: