Skip to content

Commit 5be679a

Browse files
committed
Grammar
1 parent 8e16295 commit 5be679a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ for i, el in enumerate(<collection> [, i_start]):
151151
Named Tuple
152152
-----------
153153
* **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.**
155155

156156
```python
157157
>>> from collections import namedtuple
@@ -290,7 +290,7 @@ import re
290290

291291
* **Parameter `'flags=re.IGNORECASE'` can be used with all functions.**
292292
* **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.**
294294
* **Use `'?'` to make operator non-greedy.**
295295

296296
### Match Object
@@ -303,7 +303,7 @@ import re
303303
```
304304

305305
### 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.**
307307
```python
308308
'\d' == '[0-9]' # Digit
309309
'\s' == '[ \t\n\r\f\v]' # Whitespace
@@ -486,7 +486,7 @@ def f(<nondefault_args>, <default_args>): # def f(x, y=0)
486486
Splat Operator
487487
--------------
488488
### 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.**
490490
```python
491491
args = (1, 2)
492492
kwargs = {'x': 3, 'y': 4, 'z': 5}
@@ -499,7 +499,7 @@ func(1, 2, x=3, y=4, z=5)
499499
```
500500

501501
### 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.**
503503
```python
504504
def add(*a):
505505
return sum(a)
@@ -784,7 +784,7 @@ class MyComparable:
784784
```
785785

786786
### 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.**
788788
* **Hashable objects that compare equal must have the same hash value, meaning default hash() that returns `'id(self)'` will not do.**
789789
* **That is why Python automatically makes classes unhashable if you only implement eq().**
790790

@@ -1200,7 +1200,7 @@ db.commit()
12001200

12011201
Bytes
12021202
-----
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'.**
12041204

12051205
```python
12061206
<bytes> = b'<str>'
@@ -1374,7 +1374,7 @@ Metaprograming
13741374
**Code that generates code.**
13751375

13761376
### 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.**
13781378

13791379
```python
13801380
<class> = type(<class_name>, <parents_tuple>, <attributes_dict>)

0 commit comments

Comments
 (0)