Skip to content
Annoying helper module that finds unicode/bytestring comparisions
Python
Find file
Latest commit 27e15a6 @abadger abadger committed with Add a MANIFEST so that the other files are placed in the tarball.
Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
Failed to load latest commit information.
.gitignore Added gitignore
CHANGES Better detect why things fail
LICENSE Added the unicode nazi
MANIFEST.in Add a MANIFEST so that the other files are placed in the tarball.
Makefile Better detect why things fail
README
funktionspruefung.py Better detect why things fail
setup.py Better way to invoke the nazi
unicodenazi.py Better detect why things fail

README


  // The Unicode Nazi //

    Once enabled the unicode nazi will complain whenever something is not
    purely unicode or bytestring.  It's annoying as hell and only useful
    when porting over libraries from Python 2 to Python 3.  It has a huge
    runtime impact on performance and will also complain about most of the
    stuff in the Python standard library.

  - usage:

    >>> import unicodenazi
    >>> 'foo' == u'foo'
    __main__:1: UnicodeWarning: Implicit conversion of str to unicode
    True

  - how to disable it again:

    >>> unicodenazi.disable()

  - and here is how to enable:

    >>> unicodenazi.enable()

  - if you want to enable it only for a given block:

    >>> unicodenazi.disable()
    >>> with unicodenazi.blockwise(enabled=True):
    ...  assert 'foo' == u'foo'
    ... 
    __main__:2: UnicodeWarning: Implicit conversion of str to unicode

    The reverse works too of course.

The module can be used from a command line:

   $ python -municodenazi your_script.py [script_args..]

Something went wrong with that request. Please try again.