I can fix some and can have some refer to Issue on the issue tracker
(some of that is done but not committed yet).
There is however also code that has nothing to do with format, but which
throws an exception.
This is e.g. the case with
INF = float('inf')
self.assertEqual('{0:f}'.format(INF), 'inf')
I have changed this into:
try:
INF = float('inf')
except ValueError:
pass
else:
self.assertEqual('{0:f}'.format(INF), 'inf')
so that when the proper handling of float('inf') gets implemented, the
tests will run.
Or is there a better way to solve that kind of dependencies?
Would it not be a bit harsh to leave format mentioned in BUILTINS.TODO
because float() is incomplete and not have float() in that list?
Regards
Anthon
On 2011-12-26 15:49, lkcl luke wrote:
On Mon, Dec 26, 2011 at 2:35 PM, Anthon van der Neut<[email protected]> wrote:
I now also implemented the builtin format(val, spec), which was easy,
good stuff!
But it took a bit to find out why format was not found. I had to add it to
pyjs/src/pyjs/translator_proto.py, but I was distracted by
pyjs/src/pyjs/translator_dict.py. for a while and that is not used .....
So now
print '{1}(0}'.format(2, 4)
and
print format(66, 'x')
both print: 42
There are additional testcases in BuildinTest.py, and a few that I have
to check (some might be Cpython-isms) and are currently commented out.
There are 645 tests passed now in BuiltinTest, and I hope someone can
review this to see if there are no major issues. If not format can,
IMHO, be removed from the BUILTINS.TODO list.
ok, it can only be removed when the tests that are commented out are
put back in.
the idea is to have the tests actually fail if, in fact, they fail.
this indicates to people that there is still work to be done.
if on the other hand the tests are removed, then that is basically
lying to people that things are all "ok" and we can't do that :)
l.