Fork me on GitHub
  1. About refresh_token

    This post talks about security in web login system.

    The utility of refresh token

    It is a compromise between using refresh token and re-authentication by username and password. Refresh token reduce the probability of password disclosure and give convenience for users since they don''t have to re-input their passwords repeatly …

    read more
  2. One application of yield

    When you want to generate an iterable letter list such as ['A', 'B', ..., 'J'], using yield will be very graceful.
    An example is listed below:

    def letter_increment(letter):
        assert len(letter) == 1
        return chr(ord(letter) + 1)
    
    def iter_letter(start_letter='A', end_letter='J'):
        current_letter = start_letter
        while True:
            yield current_letter
            if …
    read more

« Page 2 / 2

links

social