Staging
v0.5.1
https://github.com/python/cpython
Revision 2acd9d0c6ccf0b4360e3b63beddb97996bcb9bb1 authored by Miss Islington (bot) on 19 November 2020, 16:51:01 UTC, committed by GitHub on 19 November 2020, 16:51:01 UTC

Fix hash implementation of `typing.Literal`.

Update docs regarding `typing.Litaral` caching.

Base implementation was done in PR GH-23294.
(cherry picked from commit 1b54077ff6f5c1379e097e9f8e8648da9826d6ec)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
1 parent 87c87b5
Raw File
Tip revision: 2acd9d0c6ccf0b4360e3b63beddb97996bcb9bb1 authored by Miss Islington (bot) on 19 November 2020, 16:51:01 UTC
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Tip revision: 2acd9d0
antigravity.py

import webbrowser
import hashlib

webbrowser.open("https://xkcd.com/353/")

def geohash(latitude, longitude, datedow):
    '''Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    '''
    # https://xkcd.com/426/
    h = hashlib.md5(datedow, usedforsecurity=False).hexdigest()
    p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
    print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
back to top