Project: Jython

Revision: 5274

Author: zyasoft

Date: 30 Aug 2008 14:39:59

Changes:

Exposed unicode_toString, str_toString so that Jython code can
directly access the underlying java.lang.String backing our unicode
and str types. This enables writing code like this:

return Normalizer.normalize(unistr.toString(), normalizer_form)

without Jython automatically encoding the string on our behalf. That's
often what we want for CPython compatibility, but not when we are
calling methods like this. (Too bad we need to know.)

Added unicodedata.py and supporting data files UnicodeData.txt and
EastAsianWidth.txt, both from 4.10. (We may wish to update to be more
compliant with Java than Python 2.5.) Because the time it takes to
import, serious refactoring should be considered, including possibly
doing a codegen to Java approach. Currently does not pass MD5 hash
tests in test_unicodedata, which by their nature are highly sensitive.

Added collections.namedtuple. First 2.6 feature. (We should have a few
in Jython 2.5.) This was originally added to support Python version of
unicodedata.py, but is now just included.

Files:
copied: from /trunk/jython/src/org/python/modules/collections/Collections.java (r5273) to /trunk/jython/src/org/python/modules/_collections/Collections.java (try)
copied: from /trunk/jython/src/org/python/modules/collections/PyDequeDerived.java (r5273) to /trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java (try)
added: /trunk/jython/Lib/collections (try)
copied: from /trunk/jython/src/org/python/modules/collections (r5264) to /trunk/jython/src/org/python/modules/_collections (try)
deleted: /trunk/jython/src/org/python/modules/collections
modified: /trunk/jython/CoreExposed.includes (try)
modified: /trunk/jython/src/org/python/core/PyString.java (try)
modified: /trunk/jython/src/org/python/modules/Setup.java (try)
added: /trunk/jython/Lib/EastAsianWidth.txt (try)
added: /trunk/jython/Lib/UnicodeData.txt (try)
copied: from /trunk/jython/src/org/python/modules/collections/PyDefaultDict.java (r5273) to /trunk/jython/src/org/python/modules/_collections/PyDefaultDict.java (try)
modified: /trunk/jython/src/org/python/core/PyUnicode.java (try)
copied: from /trunk/jython/src/org/python/modules/collections/PyDefaultDictDerived.java (r5273) to /trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java (try)
added: /trunk/jython/Lib/collections/__init__.py (try)
modified: /trunk/jython/Lib/test/regrtest.py (try)
added: /trunk/jython/Lib/unicodedata.py (try)
copied: from /trunk/jython/src/org/python/modules/collections/PyDeque.java (r5273) to /trunk/jython/src/org/python/modules/_collections/PyDeque.java (try)
Diff: