From: Frank Wierzbicki <fwierzbicki@gm...> - 2006-05-27 02:09:29
Adding a BooleanType isn't really that hard -- It would just be a
subclass of PyInterger. The hard part is that the java dispatch
algorithm has to be re-written so calls to java methods like
choose the correct method (today the int will always get called).
David Patterson is working on a new dispatch that was prototyped by
Samuele Pedroni, but it will not make it into the coming release,
which is primarily based on Python 2.2. However, the 2.2 release is
getting pretty close to feature completion, and a beta is not far
away. I know I've said that before -- but I have a better feel for it
now. I'm going to avoid giving a particular date, but as soon as
reduce, slots, and (probably) PyType subclassing is done we'll be
feature complete for a beta. Around that time I'm likely to make a
2.3 branch and then a PyBoolean would be a good idea. If you want to
have a try at writing a PyBoolean, download the trunk from subversion
and look at PyString and PyUnicode, since the relationship will be
similar (PyUnicode subclasses PyString as PyBoolean will subclass
PyInteger). Note that a big part of the code is generated. For that
see the sandbox/jt which contains str.expose, str.derived,
There is mainly bugfixing left for 2.2, but there is plenty of work we
to be done on 2.3, so please, have a go at it.
On 5/26/06, Jeff Norton <jnorton@...> wrote:
> I'd really like to add BooleanType to Jython (mostly because I have a lot=
> Python code that uses it).
> Any ideas on how I would go about it?
> Jeff Norton.