Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mo-future

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mo-future

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

  • 7.584.24095
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc