June 2017
Beginner
352 pages
8h 39m
English
We can use the type() function on any of these attributes to learn more about them. For instance, we can see that fetch_words is a function object:
>>> type(words.fetch_words)<class 'function'>
We can in turn use dir() on the function to reveal its attributes:
>>> dir(words.fetch_words)['__annotations__', '__call__', '__class__', '__closure__', '__code__','__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__','__format__', '__ge__', '__get__', '__getattribute__', '__globals__','__gt__', '__hash__', '__init__', '__kwdefaults__', '__le__', '__lt__','__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__','__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__','__subclasshook__'] ...
Read now
Unlock full access