diff --git a/README.md b/README.md index 8759c40..54f1fdf 100644 --- a/README.md +++ b/README.md @@ -474,7 +474,7 @@ lambda , : = [i+1 for i in range(10)] # [1, 2, ..., 10] = {i for i in range(10) if i > 5} # {6, 7, ..., 9} = {i: i*2 for i in range(10)} # {0: 0, 1: 2, ..., 9: 18} - = (x+5 for x in range(10)) # (5, 6, ..., 14) + = (i+5 for i in range(10)) # (5, 6, ..., 14) ``` ```python @@ -519,7 +519,7 @@ Point = namedtuple('Point', 'x y') from enum import Enum Direction = Enum('Direction', 'n e s w') -Cutlery = Enum('Cutlery', {'knife': 1, 'fork': 2, 'spoon': 3}) +Cutlery = Enum('Cutlery', {'knife': 1, 'fork': 2, 'spoon': 3}) # Warning: Objects will share the objects that are initialized in the dictionary! Creature = type('Creature', (), {'position': Point(0, 0), 'direction': Direction.n}) @@ -634,9 +634,9 @@ class (Enum): = auto() # Can be used for automatic indexing. ... - @classmethod - def get_names(cls): - return [a.name for a in cls.__members__.values()] + @classmethod + def get_member_names(cls): + return [a.name for a in cls.__members__.values()] ``` ```python @@ -1460,7 +1460,7 @@ NumPy ``` ```python -value = .min([axis]) # 0: columns, 1: rows +value = .min([axis]) index = .argmin([axis]) ```