Skip to main content

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

Project description

mo-future

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

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 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_type

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

    from mo_future import text_type

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-3.45.20031.tar.gz (4.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: mo-future-3.45.20031.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.3

File hashes

Hashes for mo-future-3.45.20031.tar.gz
Algorithm Hash digest
SHA256 aeed75cbd211e297526f7b0ea5f3111b6930edd0e334cc5042ee6bd263078ee1
MD5 a5aafdcd2e1e0869e886c0446ee96407
BLAKE2b-256 5fe46eb40d24f6aa0c9447915682ae143277c4dbb776c9b709c236d628fd5060

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