diff --git a/docs/coding/python.md b/docs/coding/python.md new file mode 100644 index 00000000..6073e0a1 --- /dev/null +++ b/docs/coding/python.md @@ -0,0 +1,43 @@ +# Python Guidelines +... + +## Sections + +- [Python Guidelines](#python-guidelines) + - [Sections](#sections) +- [Guidelines](#guidelines) + - [Pythonic](#pythonic) + - [Comprehensions](#comprehensions) + +# Guidelines + +## Pythonic + +... + +### Comprehensions +Favor list comprehensions over `.map` +```python +[ + index + for index + in range(5) +] +``` + +## Importing Modules +Favor using using module notation (?) over import functions directly. Importing functions directly generally reduces readability, as it is not immediately apparent that the function is being imported. + +Avoid +```python +from top.utils import do_thing + +do_thing() +``` + +Favor +```python +from top import utils + +utils.do_thing() +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 09424929..b9f6a066 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,6 +6,7 @@ Coding Guidelines ================ * [C#]({{ site.baseurl }}{% link coding/csharp.md %}) * [JavaScript]({{ site.baseurl }}{% link coding/javascript.md %}) +* [Python]({{ site.baseurl }}{% link coding/python.md %}) Analyzers =========