Incorrect rate limit statuses


#1

Hi

I’m using app level auth, and while I was checking the rate limit status from the console I noticed something very strange: some of the rate limit checks returned values for the next window, then it returned the correct one again (this was using the tweepy python library).

    api = tweepy.API(auth, parser=tweepy.parsers.JSONParser())
    ...
    In [18]: datetime.datetime.now().strftime("%s")
    Out[18]: '1390554187'

    In [19]: api.rate_limit_status()['resources']['statuses']['/statuses/user_timeline']
    Out[19]: {'limit': 180, 'remaining': 0, 'reset': 1390554221}
    
    In [20]: api.rate_limit_status()['resources']['statuses']['/statuses/user_timeline']
    Out[20]: {'limit': 180, 'remaining': 180, 'reset': 1390555094}
    
    In [21]: api.rate_limit_status()['resources']['statuses']['/statuses/user_timeline']
    Out[21]: {'limit': 180, 'remaining': 0, 'reset': 1390554221}

    In [22]: api.rate_limit_status()['resources']['statuses']['/statuses/user_timeline']
    Out[22]: {'limit': 180, 'remaining': 180, 'reset': 1390555126}

This happened from a development environment, without any proxies/caches, and the second and fourth values are not even exactly the same, so I suppose these must have been the actual values returned by the API. Any ideas why this would happen?