Last active
December 5, 2018 16:30
-
-
Save foowaa/e2b12a798931535551c9f789e8e49014 to your computer and use it in GitHub Desktop.
decide object is generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_generator(obj): | |
return True if iter(obj) is iter(obj) else False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment