From 383e5c9086224af3c88853623feaa09e52ca88a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 20 Nov 2018 03:21:22 +0100 Subject: [PATCH] Fixes --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4395696..ad08140 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Dictionary ``` ```python -collections.defaultdict() # Creates a dictionary with default values. +collections.defaultdict() # Creates a dictionary with default values of type. collections.OrderedDict() # Creates ordered dictionary. dict() # Initiates a dict from list of key/value pairs. dict(zip(keys, values)) # Initiates a dict from two lists. @@ -169,7 +169,7 @@ String ------ ```python = .replace(old_str, new_str) - = .split(sep=None, maxsplit=-1) + = .split(sep=None, maxsplit=-1) # Splits on whitespaces. = .strip([chars]) = .join() = .startswith() # Pass tuple of strings for multiple options. @@ -487,6 +487,7 @@ class (Enum): ```python Cutlery = Enum('Cutlery', ['knife', 'fork', 'spoon']) +Cutlery = Enum('Cutlery', 'knife fork spoon') Cutlery = Enum('Cutlery', {'knife': 1, 'fork': 2, 'spoon': 3}) list() # == [, , ...] random.choice(list()) # == random @@ -643,14 +644,14 @@ Bytes ```python = b'' = .encode(encoding='utf-8') - = .to_bytes(, byteorder='big|small', signed=False) + = .to_bytes(, byteorder='big|little', signed=False) = bytes.fromhex() ``` ### Decode ```python = .decode('utf-8') - = int.from_bytes(, byteorder='big|small', signed=False) + = int.from_bytes(, byteorder='big|little', signed=False) = .hex() ```