Skip to main content

Aids for code sharing between python2 and python3.

Project description

Aids for code sharing between python2 and python3.

Latest release 20220523: Minor tweak to ustr().

This package presents various names in python 3 flavour for common use in python 2 and python 3.

Function ustr(s, e='utf-8', errors='strict')

Upgrade string to unicode: no-op for python 3.

Release Log

Release 20220523: Minor tweak to ustr().

Release 20200517: Add date_fromisoformat and datetime_fromisoformat being the datetime.date and datetime.datetime isoformat factories.

Release 20200229: Minor fixes.

Release 20190729: Add DEVNULL, which only arrived with 3.3.

Release 20190331: cs.py3._for3.raise3: bugfix raise-with-traceback.

Release 20190108: New raise_from function to provide raise...from in py3 and plain raise in py2.

Release 20181108: Small import fix for pread.

Release 20180805: Implement pread for systems lacking os.pread.

Release 20170903:

  • Make into a package subsuming cs.py3_for2 and cs.py3_for3.
  • Implementation of struct.iter_unpack.
  • Make bytes.eq work with str for Python 2.
  • New name joinbytes for Python 2 and 3.
  • Backports for Python 2.5.

Release 20160828: Use "install_requires" instead of "requires" in DISTINFO.

Release 20160827:

  • Move python 2 and 3 specific code into cs.py3_for2 and cs.py3_for3.
  • Do not bother with StringIO and BytesIO, modules can get them directly from the io module.
  • Redo python 2 bytes class.
  • Python3 compatible versions of struct.pack and struct.unpack.

Release 20150126: bugfix py2 ustr()

Release 20150120: cs.py3: add contains to python 2 bytes type

Release 20150112: Rerelease with separate README.rst file.

Release 20150111: ustr: accept errors= parameter, default "strict"; update PyPI distinfo and arrangements

Release 20150103: initial release tag for cs.py3

Project details


Download files

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

Source Distribution

cs.py3-20220523.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

cs.py3-20220523-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cs.py3-20220523.tar.gz.

File metadata

  • Download URL: cs.py3-20220523.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for cs.py3-20220523.tar.gz
Algorithm Hash digest
SHA256 5c76a03a835ea552524f512e7c1173df89984b4752a7ddba97d6bc8cb3259b15
MD5 88940325fb47e4053720df6343247bf8
BLAKE2b-256 0efb12196454542dccda16055fcfd75f81d77798b768d5b7f8d6f390d0b0623d

See more details on using hashes here.

File details

Details for the file cs.py3-20220523-py3-none-any.whl.

File metadata

  • Download URL: cs.py3-20220523-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for cs.py3-20220523-py3-none-any.whl
Algorithm Hash digest
SHA256 eb7c856bdd002e437d716fa07f0e13c9bff4b4d0b50721769b74089c41a60df4
MD5 57f8d590178c693c2c097f03bb15d014
BLAKE2b-256 8985ec93b65be6c0389e0c7d8ad658102e0d2dbe8b00984baf69f0f987e01f5d

See more details on using hashes here.

Supported by

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