[issue23920] Should Clinic have "nullable" or types=NoneType?

Larry Hastings report at bugs.python.org
Sun Apr 12 16:00:58 CEST 2015


Larry Hastings added the comment:

Saying that "str" is redundant makes me think you don't understand what "types" does.  "types" accepts a text string listing all of the Python types the converter accepts.  You can accept the converter's default, or you can specify your own value.  If you specify your own value you must list all the types.  So "str" is not redundant there.

The problem with "which one is more obvious": we could get rid of "nullable" and just use "types".  But we can't get rid of "types".  If we keep both, now we theoretically have two ways to specify it.  Which should you use?  Do we say "you must use the nullable parameter, you're not allowed to specify NoneType in types", and if so, why?

p.s. I promised to rename "nullable" to "accepts_none".  Obviously if I just get rid of it I needn't bother.

p.p.s. Should types accept a "+" to mean "all the defaults, and..."?  For example, calling str(types="+ foo") was equivalent to str(types="str foo")?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23920>
_______________________________________


More information about the Python-bugs-list mailing list