Skip to main content

Easy access to globals() from inside a python module.

See: https://stackoverflow.com/questions/15959534/visibility-of-global-variables-in-imported-modules/69029612#69029612

Using superglobals

import superglobals

from superglobals import *

superglobals()[var] = value

setglobal('test', 123)
defaultglobal('test', 456)
assert(getglobal('test') == 123)

setglobal('a.b.c', 7)
> a['b']['c'] == 7

setglobal('a\.b\.c', 8)
> globals()['a.b.c'] == 8

Changelog

0.0.10: initial release (2021-09-02) 0.0.13: added dotted object heirachy expansion (2021-09-13)

Metadata

Release files for superglobals 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superglobals 0.0.17
File Size Uploaded
superglobals-0.0.17.tar.gz 4.3 kB Details

Release files / superglobals-0.0.17.tar.gz

Download URL superglobals-0.0.17.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2c2326a1322d076efb2e4b5597ce24a3bbba2535f71fa953f6b4dc70ed9c2938
BLAKE2b-256 checksum
How to use checksums
ea8a95870470da2e4ec4b041f9a3041c2a33e793f983a91368114c7bd4cfe48d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.0.17 This release

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.10

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page