Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99c54f5

Browse files
committed
Replace six.filter with a generator expression
Probably more readable.
1 parent 38763ec commit 99c54f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/type1font.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
unicode_literals)
2727

2828
import six
29-
from six.moves import filter
3029
from six import unichr
3130

3231
import binascii
@@ -209,8 +208,9 @@ def _parse(self):
209208
# Start with reasonable defaults
210209
prop = {'weight': 'Regular', 'ItalicAngle': 0.0, 'isFixedPitch': False,
211210
'UnderlinePosition': -100, 'UnderlineThickness': 50}
212-
tokenizer = self._tokens(self.parts[0])
213-
filtered = filter(lambda x: x[0] != self._whitespace, tokenizer)
211+
filtered = ((token, value)
212+
for token, value in self._tokens(self.parts[0])
213+
if token is not self._whitespace)
214214
# The spec calls this an ASCII format; in Python 2.x we could
215215
# just treat the strings and names as opaque bytes but let's
216216
# turn them into proper Unicode, and be lenient in case of high bytes.

0 commit comments

Comments
 (0)