Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Collect the representations of boolean values #78

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

lmctv commented Jan 17, 2013

to simplify subclassing by defining explicit sets
of True and False booleans.

Don't change the existing interface.

Collect the representations of boolean values
to simplify subclassing by defining explicit sets
of ``True`` and ``False`` booleans.

Don't change the existing interface.
Owner

tseaver commented Jan 29, 2013

Thanks for the pull request!

Before I look at the merge, could you please add tests which exercise the various paths, as well as some minimal docs showing how the two attributes would be used in downstream code? And could you add yourself to CONTRIBUTORS.txt?

Contributor

lmctv commented Jan 29, 2013

Will do both.

Thank you,

l.

On Tue, 29 Jan 2013, Tres Seaver wrote:

TS>
TS> Thanks for the pull request!
TS>
TS> Before I look at the merge, could you please add tests which exercise the
TS> various paths, as well as some minimal docs showing how the two attributes
TS> would be used in downstream code? And could you add yourself to
TS> CONTRIBUTORS.txt?
TS>
TS> —
TS> Reply to this email directly or view it on GitHub.
TS>
TS> Web Bug fromhttps://github.com/notifications/beacon/neMVlejeguAgJQpdcXBa-RQEdv2YRBlqir9
TS> -qK_2cajDjk07pSyCAcIUn5V8PGRM.gif
TS>

+-------------------------+----------------------------------------------+
| Lorenzo M. Catucci | Centro di Calcolo e Documentazione |
| catucci@ccd.uniroma2.it | Università degli Studi di Roma "Tor Vergata" |
| | Via O. Raimondo 18 ** I-00173 ROMA ** ITALY |
| Tel. +39 06 7259 2255 | Fax. +39 06 7259 2125 |
+-------------------------+----------------------------------------------+

@lmctv lmctv referenced this pull request Jan 29, 2013

Merged

Iso8601 truncation #79

lmctv added some commits Jan 29, 2013

Add tests for Boolean's subclass behaviour.
Exercize both the default true and the no defaults cases.
Allow setting true/false strings from __init__
This would in turn allow defining translated true/false
strings like in:
    bool=Boolean(false_strings=(_('no'),_('false'),_('n'),_('f'), '0'),
                 true_strings=(_('yes'),_('true'),_('y'),_('t'), '1'))
Contributor

lmctv commented Jan 30, 2013

Just to know: should I leave the pull request in this form, or should I rebase it squashing all the "real" commits into one?

Owner

tseaver commented Jan 30, 2013

We don't need to have the history squashed: thanks for checking.

lmctv added some commits Jan 30, 2013

Update documentation
and change attribute names, to the corresponding __init__ parameter name.
Customize behaviour only on Boolean.__init__()
Dropping mixed init/subclassing customization leads to
a simplified usage and documentation.
Contributor

lmctv commented Feb 4, 2013

Now I think I should retitle the series to "Allow customization of Boolean serializer/deserializer", since I dropped
the class-level attributes.

Hope you can spare some time for a review. Thank you,

l.

Contributor

lmctv commented Feb 5, 2013

I've added a rebased version of this pull request at https://github.com/lmctv/colander/tree/customized_booleans.

@jayd3e jayd3e referenced this pull request Mar 19, 2013

Merged

Custom boolean values #97

Owner

tseaver commented May 6, 2013

Thanks @lmctv and @jayd3e. Merged with #97.

@tseaver tseaver closed this May 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment