Browse Source

Small one character or word changes

pull/115/head
Jure Šorn 3 years ago
parent
commit
6468d76833
4 changed files with 10 additions and 10 deletions
  1. 6
      README.md
  2. 10
      index.html
  3. 2
      pdf/index_for_pdf.html
  4. 2
      pdf/index_for_pdf_print.html

6
README.md

@ -1046,7 +1046,7 @@ class <class_name>:
```
* **Objects can be made sortable with `'order=True'` and immutable with `'frozen=True'`.**
* **For object to be hashable, all attributes must be hashable and frozen must be True.**
* **Function field() is needed because `'<attr_name>: list = []'` would make a list that is shared among all instances. Argument 'default_factory' can be any [callable](#callable).**
* **Function field() is needed because `'<attr_name>: list = []'` would make a list that is shared among all instances. Its 'default_factory' argument can be any [callable](#callable).**
* **For attributes of arbitrary type use `'typing.Any'`.**
#### Inline:
@ -1906,7 +1906,7 @@ with <conn>: # Exits the block with commit()
# $ pip3 install mysql-connector
from mysql import connector
<conn> = connector.connect(host=<str>, …) # `user=<str>, password=<str>, database=<str>`.
<cursor> = <conn>.cursor() # Only cursor has execute method.
<cursor> = <conn>.cursor() # Only cursor has execute() method.
<cursor>.execute('<query>') # Can raise a subclass of connector.Error.
<cursor>.execute('<query>', <list/tuple>) # Replaces '%s's in query with values.
<cursor>.execute('<query>', <dict/namedtuple>) # Replaces '%(<key>)s's with values.
@ -2951,7 +2951,7 @@ while all(event.type != pg.QUIT for event in pg.event.get()):
<Rect> = pg.Rect(x, y, width, height) # Floats get truncated into ints.
<int> = <Rect>.x/y/centerx/centery/… # Top, right, bottom, left. Allows assignments.
<tup.> = <Rect>.topleft/center/… # Topright, bottomright, bottomleft. Same.
<Rect> = <Rect>.move((x, y)) # Use move_ip() to move in place.
<Rect> = <Rect>.move((x, y)) # Use move_ip() to move in-place.
```
```python

10
index.html

@ -226,7 +226,7 @@ pre.prettyprint {
<body>
<header>
<aside>November 16, 2021</aside>
<aside>November 17, 2021</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -1040,7 +1040,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
<ul>
<li><strong>Objects can be made sortable with <code class="python hljs"><span class="hljs-string">'order=True'</span></code> and immutable with <code class="python hljs"><span class="hljs-string">'frozen=True'</span></code>.</strong></li>
<li><strong>For object to be hashable, all attributes must be hashable and frozen must be True.</strong></li>
<li><strong>Function field() is needed because <code class="python hljs"><span class="hljs-string">'&lt;attr_name&gt;: list = []'</span></code> would make a list that is shared among all instances. Argument 'default_factory' can be any <a href="#callable">callable</a>.</strong></li>
<li><strong>Function field() is needed because <code class="python hljs"><span class="hljs-string">'&lt;attr_name&gt;: list = []'</span></code> would make a list that is shared among all instances. Its 'default_factory' argument can be any <a href="#callable">callable</a>.</strong></li>
<li><strong>For attributes of arbitrary type use <code class="python hljs"><span class="hljs-string">'typing.Any'</span></code>.</strong></li>
</ul>
<div><h4 id="inline-1">Inline:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> make_dataclass
@ -1734,7 +1734,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
<div><h3 id="mysql">MySQL</h3><p><strong>Has a very similar interface, with differences listed below.</strong></p><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install mysql-connector</span>
<span class="hljs-keyword">from</span> mysql <span class="hljs-keyword">import</span> connector
&lt;conn&gt; = connector.connect(host=&lt;str&gt;, …) <span class="hljs-comment"># `user=&lt;str&gt;, password=&lt;str&gt;, database=&lt;str&gt;`.</span>
&lt;cursor&gt; = &lt;conn&gt;.cursor() <span class="hljs-comment"># Only cursor has execute method.</span>
&lt;cursor&gt; = &lt;conn&gt;.cursor() <span class="hljs-comment"># Only cursor has execute() method.</span>
&lt;cursor&gt;.execute(<span class="hljs-string">'&lt;query&gt;'</span>) <span class="hljs-comment"># Can raise a subclass of connector.Error.</span>
&lt;cursor&gt;.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;list/tuple&gt;) <span class="hljs-comment"># Replaces '%s's in query with values.</span>
&lt;cursor&gt;.execute(<span class="hljs-string">'&lt;query&gt;'</span>, &lt;dict/namedtuple&gt;) <span class="hljs-comment"># Replaces '%(&lt;key&gt;)s's with values.</span>
@ -2543,7 +2543,7 @@ rect = pg.Rect(<span class="hljs-number">240</span>, <span class="hljs-number">2
<div><h3 id="rectangle">Rectangle</h3><p><strong>Object for storing rectangular coordinates.</strong></p><pre><code class="python language-python hljs">&lt;Rect&gt; = pg.Rect(x, y, width, height) <span class="hljs-comment"># Floats get truncated into ints.</span>
&lt;int&gt; = &lt;Rect&gt;.x/y/centerx/centery/… <span class="hljs-comment"># Top, right, bottom, left. Allows assignments.</span>
&lt;tup.&gt; = &lt;Rect&gt;.topleft/center/… <span class="hljs-comment"># Topright, bottomright, bottomleft. Same.</span>
&lt;Rect&gt; = &lt;Rect&gt;.move((x, y)) <span class="hljs-comment"># Use move_ip() to move in place.</span>
&lt;Rect&gt; = &lt;Rect&gt;.move((x, y)) <span class="hljs-comment"># Use move_ip() to move in-place.</span>
</code></pre></div>
@ -3020,7 +3020,7 @@ $ pyinstaller script.py --add-data '&lt;path&gt;:.' <span class="hljs-comment">
<footer>
<aside>November 16, 2021</aside>
<aside>November 17, 2021</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

2
pdf/index_for_pdf.html

@ -64,7 +64,7 @@
<h3 id="i">I</h3>
<p><strong>image, <a href="#scrapespythonsurlversionnumberandlogofromitswikipediapage">35</a>, <a href="#image">39</a>-<a href="#animation">40</a>, <a href="#surface">42</a>-<a href="#basicmariobrothersexample">43</a></strong><br>
<strong>imports, <a href="#imports">12</a></strong><br>
<strong>inline, <a href="#otheruses">11</a>-<a href="#namedtupleenumdataclass">12</a>, <a href="#inline-1">15</a>, <a href="#inline-2">20</a></strong><br>
<strong>inline, <a href="#otheruses">11</a>, <a href="#inline-1">15</a>, <a href="#inline-2">20</a></strong><br>
<strong>input function, <a href="#input">22</a></strong><br>
<strong>introspection, <a href="#introspection">31</a></strong><br>
<strong>ints, <a href="#abstractbaseclasses">4</a>, <a href="#ints">7</a>, <a href="#binhex">8</a>, <a href="#encode-1">28</a></strong><br>

2
pdf/index_for_pdf_print.html

@ -64,7 +64,7 @@
<h3 id="i">I</h3>
<p><strong>image, 35, 39-40, 42-43</strong><br>
<strong>imports, 12</strong><br>
<strong>inline, 11-12, 15, 20</strong><br>
<strong>inline, 11, 15, 20</strong><br>
<strong>input function, 22</strong><br>
<strong>introspection, 31</strong><br>
<strong>ints, 4, 7, 8, 28</strong><br>

Loading…
Cancel
Save