2012/6/19 Костя Лопухин <[email protected]>

> As Amaury Forgeot d'Arc noted here,
>
> https://bitbucket.org/pypy/pypy/pull-request/69/fix-issue-1180-implement-bool-formatting#comment-8635
> in CPython there is no specific code for booleans, but an empty
> format_spec always delegate to str().
> Is it better to try to achieve the same in PyPy? Or just delegate to
> str if there is no format string, and to int formatting if there is
> any, like here
> https://bitbucket.org/kostialopuhin/pypy-fix1180/changeset/99ddf04ded5a
> ?
>

Actually I think I found the cause:
bool.__format__ will correctly call format__Int_ANY(),
but the object is coerced into a int!

Adding a format__Bool_ANY fixes the problem (with the same implementation)1
but shouldn't we have W_BoolObject inherit from W_IntObject,
and remove delegate_Bool2IntObject?

And a second questing - where is the proper place for this discussion
> - here, in the pull request, or in the issues in bugtracker?
>

I don't think the volume of this mailing list is too high.
For quick round-trips, most of us also hang on IRC: #pypy on
irc.freenode.net.

-- 
Amaury Forgeot d'Arc
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to