On this page
  1. antigravity
  2. Import
  3. Overview
  4. Quick Start
  5. Implementation Walkthrough
  6. 1. What Happens on Import
  7. Gotchas & Boundaries

antigravity

Prev: annotationlib | Up: stdlib_module | Next: argparse
Rel: sys, sysconfig, builtins, warnings, dataclasses
Ref: docs.python.org — antigravity
Tags: #public #python3 #stdlib


Import

import antigravity

Overview

Classic Python Easter egg module inspired by xkcd #353 ("Python"): importing antigravity opens the xkcd Python comic in your default web browser via webbrowser, and also includes a whimsical geohash() implementation referencing xkcd #426. Purely a fun piece of Python culture—not a production dependency.

Quick Start

# Note: `import antigravity` immediately calls webbrowser.open("https://xkcd.com/353/")!
# It also defines antigravity.geohash(latitude, longitude, datedow) using hashlib.md5.

Implementation Walkthrough

1. What Happens on Import

At module top level, antigravity.py executes webbrowser.open("https://xkcd.com/353/") and defines geohash(latitude, longitude, datedow), which hashes datedow with MD5 to compute xkcd #426 geohash coordinates.

Gotchas & Boundaries

Linked from

Related notes