>> Something along the lines of : >> >> if sys.version_info[:2] == (3, X): >> from __preview__ import example >> else: >> raise ImportError( 'Package example is only available as preview in >> Python version 3.X. Please check the documentation of your version of >> Python to see if and how you can get the package example.' ) > > > A more normal incantation, as is often the way for packages that became > parts of the standard library after first being a third party library > (sometimes under a different name, e.g. simplejson -> json): > > try: > from __preview__ import thing > except ImportError: > import thing > > So no need to target a very specific version of Python. > Yep, this is what I had in mind. And it appeared too trivial to place it in the PEP. Eli
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4