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: recipes/artificial-intelligence/llm.md
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -20,26 +20,26 @@ Always add docstrings.
20
20
21
21
For Bash, keep docstrings to one line.
22
22
23
-
For Python, prefer list comprehensions and dict comprehensions, but use `for` loops if that makes the code more readable.
24
-
25
-
For Python, write Python docstrings using Google style format e.g.
23
+
For Python, prefer list comprehensionsi and dict comprehensions, but use `for` loops if that makes the code more readable.
24
+
For Python, remember to add imports when using new objects or types and put imports at the top of the file.
25
+
For Python, write Python docstrings using Google style format including `:param name:` style and ending with a fullstop and empty between `:param:` and `:returns:` as below e.g.
26
26
"""
27
27
Return the sum of abc and def.
28
28
29
29
:param abc: Description.
30
30
:param def: Description.
31
31
32
-
:return xyz: Description.
32
+
:returns xyz: Description.
33
33
"""
34
34
35
35
For Python, write one-line docstrings on 3 lines. e.g.
36
36
"""
37
-
Description
37
+
Return the sum of abc and def.
38
38
"""
39
39
40
40
For Python, prefer f-string formatting over other string formatting methods.
41
41
42
-
For Python and JS, always use type annotations for function parameters and return types. Create custom types for complex structures, especially for lists and dicts.
42
+
For Python and JS, always use type annotations for function parameters and return types. Create custom types for complex structures, especially for lists and dicts. Use the most modern types available for Python e.g. favor `list` over `List`.
43
43
44
44
For JS, prefer functional React components with hooks over class components.
0 commit comments