@@ -11,10 +11,13 @@ def __init__(self, series):
11
11
12
12
def __getitem__ (self , key ):
13
13
"""
14
- :param key: Either a serie name or a 2-tuple(serie_name, tags_dict)
15
- If the given serie name is None then any serie (matching
16
- the eventual given tags) will be given its points one
17
- after the other.
14
+ :param key: Either a serie name, or a tags_dict, or
15
+ a 2-tuple(serie_name, tags_dict).
16
+ If the serie name is None (or not given) then any serie
17
+ matching the eventual given tags will be given its points
18
+ one after the other.
19
+ To get the points of every serie in this resultset then
20
+ you have to provide None as key.
18
21
:return: A generator yielding `Point`s matching the given key.
19
22
NB:
20
23
The order in which the points are yielded is actually undefined but
@@ -34,10 +37,8 @@ def __getitem__(self, key):
34
37
name = key
35
38
tags = None
36
39
37
- # TODO(aviau): Fix for python 3.2
38
- # if not isinstance(name, (str, bytes, type(None))) \
39
- # and not isinstance(name, type("".decode("utf-8"))):
40
- # raise TypeError('serie_name must be an str or None')
40
+ if not isinstance (name , (bytes , type (b'' .decode ()), type (None ))):
41
+ raise TypeError ('serie_name must be an str or None' )
41
42
42
43
for serie in self ._get_series ():
43
44
serie_name = serie .get ('name' , 'results' )
0 commit comments