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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mo_future-7.685.25166-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file mo_future-7.685.25166.tar.gz.

File metadata

  • Download URL: mo_future-7.685.25166.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for mo_future-7.685.25166.tar.gz
Algorithm Hash digest
SHA256 0846fc97bb12a688f44d98b246dab69a5757ab68b46ed1a641f2df317d455bed
MD5 3787e615cbf444bd3a263f65296a624f
BLAKE2b-256 973db786f81ab44df988875797746b227c4743c35a1bb8d5009d6bdf02215501

See more details on using hashes here.

File details

Details for the file mo_future-7.685.25166-py3-none-any.whl.

File metadata

File hashes

Hashes for mo_future-7.685.25166-py3-none-any.whl
Algorithm Hash digest
SHA256 a1b30ae9331094ccf33780fe8726bf947f6250f8a1ae65568c3d632a7fbcfdd3
MD5 953c9e72cb680998c34bebebcfb22180
BLAKE2b-256 1c8127b4857b508f62a0e715b995b2a406eff618a1ad217538d330cf0b4d06be

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