Skip to main content

More future! Make Python 2/3 compatibility a bit easier

Project description

More Future!

For old code written against Python2, plus some tiny useful functions

Recent Changes

December 2022 - No longer points to Python2 modules.

Description

Problem

future or six are hard to use: It is easy to google how to import an object in Python2, or Python3, but finding the full path to the same in these compatibility libraries is difficult.

Solution

All the modules and types required for compatibility are put into the mo-future top-level module so they are easy to find.

Flat namespace

Instead of

    from future.utils import text

you get the same, but without having to discover what sub-module the text is hiding:

    from mo_future import text

Simpler imports

Instead of writing conditional imports like

    try:
        from io import StringIO
    except:
        from StringIO import StringIO

or

    if PY3:
        from io import StringIO
    else:
        from StringIO import StringIO

you can use mo-future:

    from mo_future import StringIO

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mo-future-7.298.22349.tar.gz (10.0 kB view details)

Uploaded Source

File details

Details for the file mo-future-7.298.22349.tar.gz.

File metadata

  • Download URL: mo-future-7.298.22349.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for mo-future-7.298.22349.tar.gz
Algorithm Hash digest
SHA256 fcbb843a431cfa89c20b253c08983b64945abd8974bba04b52e14d87fc693a44
MD5 296c4f5704ca32c0bdfc499a33b88521
BLAKE2b-256 25c90e0954d6581c3fdd005cf38fccc7c92d057039f62b5247f1a4a0d9d68956

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page