Simple number generator
How do I write a function that simply returns incrementing numbers on each call?

    print counter() # 0
    print counter() # 1
    print counter() # 2
    print counter() # 3
    etc

For clarity, I'm not looking for a generator (although the answer would probably use it). The function should return an integer, not an iterable object. I'm also NOT looking for a solution involving global or otherwise shared variables (classes, function attribute etc).

Simple number generator
===

How do I write a function that simply returns incrementing numbers on each call?

    print counter() # 0
    print counter() # 1
    print counter() # 2
    print counter() # 3
    etc

For clarity, I'm not looking for a generator (although the answer would probably use it). The function should return an integer, not an iterable object. I'm also NOT looking for a solution involving global or otherwise shared variables (classes, function attribute etc).
