Typing: __array_interface__

This commit is contained in:
Eric Soroos 2018-01-03 11:27:03 +00:00
parent e33706bc33
commit a0666ccb7c

View File

@ -631,7 +631,7 @@ class Image(object):
# type: (Optional[Text], Optional[Text], **Any) -> Text # type: (Optional[Text], Optional[Text], **Any) -> Text
import tempfile import tempfile
suffix = '' suffix = '' # type: Text
if format: if format:
suffix = '.'+format suffix = '.'+format
@ -690,9 +690,9 @@ class Image(object):
@property @property
def __array_interface__(self): def __array_interface__(self):
# type: () -> Dict[Text, Any] # type: () -> Dict[unicode, Any]
# numpy array interface support # numpy array interface support
new = {} new = {} # type: Dict[unicode, Any]
shape, typestr = _conv_type_shape(self) shape, typestr = _conv_type_shape(self)
new['shape'] = shape new['shape'] = shape
new['typestr'] = typestr new['typestr'] = typestr