#!/usr/local/bin/python2 from copy import copy, deepcopy def fizzbuzz(n): for i in range(1, n+1): if i % 15 == 0: yield 'FizzBuzz' elif i % 5 == 0: yield 'Buzz' elif i % 3 == 0: yield 'Fizz' else: yield i def f(): pass a = f b = deepcopy(f) print (f, 1, []) == (f, 1, [])