@@ -151,7 +151,7 @@ for i, el in enumerate(<collection> [, i_start]):
151
151
Named Tuple
152
152
-----------
153
153
* ** Tuple is an immutable and hashable list.**
154
- * ** Named tuple is it's subclass with named elements.**
154
+ * ** Named tuple is its subclass with named elements.**
155
155
156
156
``` python
157
157
>> > from collections import namedtuple
@@ -290,7 +290,7 @@ import re
290
290
291
291
* ** Parameter ` 'flags=re.IGNORECASE' ` can be used with all functions.**
292
292
* ** Parameter ` 'flags=re.DOTALL' ` makes dot also accept newline.**
293
- * ** Use ` r'\1' ` or ` '\\\\ 1' ` for backreference.**
293
+ * ** Use ` r'\1' ` or ` '\\1' ` for backreference.**
294
294
* ** Use ` '?' ` to make operator non-greedy.**
295
295
296
296
### Match Object
@@ -303,7 +303,7 @@ import re
303
303
```
304
304
305
305
### Special Sequences
306
- ** Expressions below hold true for strings that contain only ASCII characters. Use capital letter for negation.**
306
+ ** Expressions below hold true for strings that contain only ASCII characters. Use capital letters for negation.**
307
307
``` python
308
308
' \d' == ' [0-9]' # Digit
309
309
' \s' == ' [ \t\n\r\f\v ]' # Whitespace
@@ -486,7 +486,7 @@ def f(<nondefault_args>, <default_args>): # def f(x, y=0)
486
486
Splat Operator
487
487
--------------
488
488
### Inside Function Call
489
- ** Splat expands collection into positional arguments, while splatty-splat expands dictionary into keyword arguments.**
489
+ ** Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.**
490
490
``` python
491
491
args = (1 , 2 )
492
492
kwargs = {' x' : 3 , ' y' : 4 , ' z' : 5 }
@@ -499,7 +499,7 @@ func(1, 2, x=3, y=4, z=5)
499
499
```
500
500
501
501
### Inside Function Definition
502
- ** Splat combines zero or more positional arguments into tuple, while splatty-splat combines zero or more keyword arguments into dictionary.**
502
+ ** Splat combines zero or more positional arguments into a tuple, while splatty-splat combines zero or more keyword arguments into a dictionary.**
503
503
``` python
504
504
def add (* a ):
505
505
return sum (a)
@@ -784,7 +784,7 @@ class MyComparable:
784
784
```
785
785
786
786
### Hashable
787
- * ** Hashable object needs both hash() and eq() methods and it's hash value should never change.**
787
+ * ** Hashable object needs both hash() and eq() methods and its hash value should never change.**
788
788
* ** Hashable objects that compare equal must have the same hash value, meaning default hash() that returns ` 'id(self)' ` will not do.**
789
789
* ** That is why Python automatically makes classes unhashable if you only implement eq().**
790
790
@@ -1200,7 +1200,7 @@ db.commit()
1200
1200
1201
1201
Bytes
1202
1202
-----
1203
- ** Bytes object is immutable sequence of single bytes. Mutable version is called 'bytearray'.**
1203
+ ** Bytes object is an immutable sequence of single bytes. Mutable version is called 'bytearray'.**
1204
1204
1205
1205
``` python
1206
1206
< bytes > = b ' <str>'
@@ -1374,7 +1374,7 @@ Metaprograming
1374
1374
** Code that generates code.**
1375
1375
1376
1376
### Type
1377
- ** Type is the root class. If only passed the object it returns it's type (class). Otherwise it creates a new class.**
1377
+ ** Type is the root class. If only passed the object it returns its type (class). Otherwise it creates a new class.**
1378
1378
1379
1379
``` python
1380
1380
< class > = type (< class_name> , < parents_tuple> , < attributes_dict> )
0 commit comments