Browse Source

Added FAQ page

pull/54/head
Jure Šorn 4 years ago
parent
commit
7987db6e03
2 changed files with 53 additions and 0 deletions
  1. 53
      web/faq.html
  2. BIN
      web/image_social_2.png

53
web/faq.html

@ -0,0 +1,53 @@
<details open><summary><strong>Python 2 or Python 3?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Python 3.6 (Except for dataclasses and asyncio that require version 3.7).
</details><br>
<details open><summary><strong>What is the best way to use it?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;I keep the text file open on separate desktop at all times. It is also in a different text editor than the one I usually use, so it's easier to switch to with <code>Ctrl+↹</code> / <code>⌘↹</code>. Cheatsheet consists of minimal text and short examples so things are easy to find with <code>Ctrl+F</code> / <code>⌘F</code>.<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;I also keep the Python console open at all times to test a little snippets of code, to check out the available functions of a module using code completion and above all, to use <code>help(&lt;module/object/function/type&gt;)</code> command. If something is still unclear, then I search the Python docs by googling <code>'python docs &lt;module/function&gt;'</code>.
</details><br>
<details open><summary><strong>Why the '&lt;type&gt;' semantics?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;It makes examples much less ambiguous.
</details><br>
<details open><summary><strong>Why are some basics like <code>'&lt;list&gt; = [1, 2, 3]'</code> and <code>'&lt;el&gt; = &lt;list&gt;[&lt;int&gt;]'</code> missing?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;This cheatsheet is not intended for complete beginners. This way it can save some valuable space. Nonetheless it tries to be simple enough to be useful for somebody who completed the introductory course. A nice one page cheatsheet that can help you get started can be found <a href="https://github.com/kickstartcoding/cheatsheets/blob/master/build/topical/python.pdf">here</a>.</details><br>
<details open><summary><strong>What exactly is <code>&lt;el&gt;</code>?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;El is short for element and can be any object, but it usually denotes an object that is an item of a collection.
</details><br>
<details open><summary><strong>What exactly is <code>&lt;collection&gt;</code>?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Collection is my name for an iterable object. An iterable object in Python is any object that has at least one of iter() and getitem() special methods defined. <code>&lt;object&gt;.__iter__()</code> returns an iterator of object's items and <code>&lt;object&gt;.__getitem__(&lt;index&gt;)</code> returns an item at that index. I chose not to use the name iterable because it sounds scarier and more vague than collection, even though it has a precise definition.<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<code>&lt;iterable&gt;</code> should not be confused with abstract base class collections.abc.Iterable. Expression <code>instanceof(&lt;object&gt;, collections.abc.Iterable)</code> only checks if object has iter() special method. <code>instanceof(&lt;object&gt;, collections.abc.Collection)</code> checks for len(), iter() and contains().
</details><br>
<details open><summary><strong>What about PEP 8?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Check out <a href="https://google.github.io/styleguide/pyguide.html">Google Style Guide</a> and use <code>Ctrl+Alt+L</code> / <code>⌥⌘L</code> shortcut in PyCharm to automatically reformat code.
</details><br>
<details open><summary><strong>Why are import statement, virtual environment, tests, packaging and installation not covered?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Check out <a href="https://docs.python-guide.org/">The Hitchhiker’s Guide to Python</a> for a nice overview of mentioned topics.
</details><br>
<details open><summary><strong>Why are Django and Pandas not covered?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Maybe they will be in the future. For now here is a nice <a href="https://github.com/kickstartcoding/cheatsheets/blob/master/build/topical/django.jpg">Django cheatsheet</a>.
</details><br>
<details open><summary><strong>Why are there no concrete Regex examples?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Regular expressions are a separate technology that is independent from Python. There are many resources available online.
</details><br>
<details open><summary><strong>Why is there no old style string formating?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Because it's redundant and I don't want to encourage its use.
</details><br>
<details open><summary><strong>Why is staticmethod not covered in Class section?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Because it's of very limited use and is easy to mix up with classmethod.
</details><br>
<details open><summary><strong>Why are descriptors not covered?</strong></summary><br>
&nbsp;&nbsp;&nbsp;&nbsp;Because property is sufficient for everyday use.
</details><br>

BIN
web/image_social_2.png

Before After
Width: 1280  |  Height: 640  |  Size: 449 KiB
Loading…
Cancel
Save