Q:

Calling any() on a generator with print() inside it produces unexpected behaviour

any is supposed to short-circuit once it finds a single truthy value in any iterable (whether that's an iterator, generator, list, etc.)
For normal generators, this is true:
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32  
Type "help", "copyright", "credits" or "license" for more information.
>>> gen = (i for i in range(100))
>>> gen
<generator object <genexpr> at 0x0341A360>
>>> next(gen)
0                         
>>> next(gen)
1   
>>> any(gen)
True                                                                                       
>>> next(gen)
3                                      
>>>

If you create a generate that includes print in it, any DOES NOT short-circuit:
>>> gen = (print(i) for i in range(100))
>>> next(gen)
0
>>> next(gen)
1
>>> any(gen)
2
3
4
5
6
7
8
9
...

Why does adding print prevent any from short-circuiting?                                                                    

A:

The function print() returns None. Consider this:
>>> gen = (print(i) for i in range(10))
>>> list(gen)
0
1
2
3
4
5
6
7
8
9
[None, None, None, None, None, None, None, None, None, None]

You can see that the generator returns None for each iteration.
any() runs until it finds a truthy value. Since None is never truthy, any() runs to completion.
You can salvage your original code by ensuring that the generator returns the intended value for each iteration:
>>> gen = (print(i) or i for i in range(10))
>>> next(gen)
0
0
>>> next(gen)
1
1
>>> any(gen)
2
True

