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

2015-05-08 Thread Larry Hastings
Larry Hastings added the comment: The final version of this has been implemented as part of 41fb7fd04b5d for issue #24001. However, I'll mention here for posterity's sakes: there's an additional discussion on #24145. (Everyone on the nosy list has already been invited to the party!) ---

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

2015-04-20 Thread Larry Hastings
Larry Hastings added the comment: I've implemented this change in the latest patch (#3) for #24001. -- ___ Python tracker ___ ___ Pyth

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

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: I've posted about this to python-dev. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

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

2015-04-19 Thread Larry Hastings
Larry Hastings added the comment: p.s. I'm now leaning heavily towards renaming "types" to "accept", and putting NoneType in the set passed to accept= instead of a separate parameter. -- ___ Python tracker ___

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

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: Oh, I misremembered. The name "allow_none" was inflicted on me by python-dev, in this thread: https://mail.python.org/pipermail/python-dev/2014-August/135650.html -- ___ Python tracker

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

2015-04-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: accepts_none=True looks as "doesn't accept anything" to me. -- ___ Python tracker ___ ___ Python-b

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

2015-04-18 Thread Larry Hastings
Larry Hastings added the comment: I'm now converging on changing types= to accept a set of real types, see issue #24001. That change has an impact on this decision. (By the way, let's assume that if "nullable", I have to rename it to "accepts_none". I'll use that name below.) What makes me

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

2015-04-12 Thread Larry Hastings
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 spec

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

2015-04-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This will break other principle. Don't Repeat Yourself. "str" for the "Py_UNICODE" converter looks redundant. -- ___ Python tracker ___ _

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

2015-04-11 Thread Zachary Ware
Zachary Ware added the comment: s/Only One/One Obvious/ ;) Which way is more obvious? How would it affect nullable ints? -- ___ Python tracker ___ __

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

2015-04-11 Thread Larry Hastings
New submission from Larry Hastings: I was staring at Clinic tonight and a thought came to me. We could express "nullable=True" as "types='NoneType'". For example, the converter for 'Z' could change from Py_UNICODE(nullable=True) to Py_UNICODE(types="str NoneType") There Should Be