From c5bfdb03a49942cadb1caef029ee289e0fa9ba96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 25 Sep 2019 00:55:00 +0200 Subject: [PATCH] Typos --- README.md | 18 +++++++++--------- index.html | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 199172d..7dd0807 100644 --- a/README.md +++ b/README.md @@ -1943,22 +1943,22 @@ Array ```python from array import array - = array('', ) # Array from coll. of numbers. - = array('', ) # Array from bytes object. + = array('', ) # Array from coll. of numbers. + = array('', ) # Array from bytes object. = .tobytes() ``` Memory View ----------- -* **A seqence object that points to the memory of another object.** +* **A sequence object that points to the memory of another object.** * **Each element can reference a single or multiple consecutive bytes, depending on format.** * **Order and number of elements can be changed with slicing.** ```python = memoryview() = [] # Can be int or float. - = [] # Mview with rearanged elements. + = [] # Mview with rearranged elements. = .cast('') # Casts a memoryview to a new format. .release() # Releases the object's memory buffer. ``` @@ -1984,10 +1984,10 @@ from collections import deque ``` ```python -.appendleft() # Opposite element is dropped if full. - = .popleft() # Raises IndexError if empty. -.extendleft() # Collection gets reversed. -.rotate(n=1) # Rotates elements to the right. +.appendleft() # Opposite element is dropped if full. + = .popleft() # Raises IndexError if empty. +.extendleft() # Collection gets reversed. +.rotate(n=1) # Rotates elements to the right. ``` @@ -2286,7 +2286,7 @@ with open('test.csv', encoding='utf-8', newline='') as file: Curses ------ -#### Clears terminal, prints message and waits for ESC key press: +#### Clears the terminal, prints a message and waits for an ESC key press: ```python from curses import wrapper, curs_set, ascii from curses import KEY_UP, KEY_RIGHT, KEY_DOWN, KEY_LEFT diff --git a/index.html b/index.html index 830df9e..ed2b6dd 100644 --- a/index.html +++ b/index.html @@ -1723,19 +1723,19 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,

#Array

List that can only hold numbers of a predefined type. Available types and their sizes in bytes are listed above.

from array import array
-<array> = array('<typecode>', <collection>)  # Array from coll. of numbers.
-<array> = array('<typecode>', <bytes>)       # Array from bytes object.
+<array> = array('<typecode>', <collection>)    # Array from coll. of numbers.
+<array> = array('<typecode>', <bytes>)         # Array from bytes object.
 <bytes> = <array>.tobytes()
 

#Memory View

    -
  • A seqence object that points to the memory of another object.
  • +
  • A sequence object that points to the memory of another object.
  • Each element can reference a single or multiple consecutive bytes, depending on format.
  • Order and number of elements can be changed with slicing.
<mview> = memoryview(<bytes/bytearray/array>)
 <num>   = <mview>[<index>]                     # Can be int or float.
-<mview> = <mview>[<slice>]                     # Mview with rearanged elements.
+<mview> = <mview>[<slice>]                     # Mview with rearranged elements.
 <mview> = <mview>.cast('<typecode>')           # Casts a memoryview to a new format.
 <mview>.release()                              # Releases the object's memory buffer.
 
@@ -1754,10 +1754,10 @@ db = connector.connect(host=<str>, user=<str>, password=<str>, -
<deque>.appendleft(<el>)                    # Opposite element is dropped if full.
-<el> = <deque>.popleft()                    # Raises IndexError if empty.
-<deque>.extendleft(<collection>)            # Collection gets reversed.
-<deque>.rotate(n=1)                         # Rotates elements to the right.
+
<deque>.appendleft(<el>)                       # Opposite element is dropped if full.
+<el> = <deque>.popleft()                       # Raises IndexError if empty.
+<deque>.extendleft(<collection>)               # Collection gets reversed.
+<deque>.rotate(n=1)                            # Rotates elements to the right.
 

#Threading

  • CPython interpreter can only run a single thread at a time.
  • @@ -1974,7 +1974,7 @@ pyplot.clf() # Clears figur
-

#Curses

Clears terminal, prints message and waits for ESC key press:

from curses import wrapper, curs_set, ascii
+

#Curses

Clears the terminal, prints a message and waits for an ESC key press:

from curses import wrapper, curs_set, ascii
 from curses import KEY_UP, KEY_RIGHT, KEY_DOWN, KEY_LEFT
 
 def main():