On 02/05/2014 04:14 PM, Russell Keith-Magee wrote: > On Wed, Feb 5, 2014 at 10:13 PM, Thomas Güttler <[email protected] > <mailto:[email protected]>> wrote: > > Hi, > > here is some feedback to the check framework, documented at: > > https://docs.djangoproject.__com/en/dev/ref/checks/ > <https://docs.djangoproject.com/en/dev/ref/checks/> > > --- > > > {{{ > Error('error message', None) # Good > }}} > > I don't think this is "good". The "hint" should be optional. The > above line > is ugly, since you don't know why there is second argument (None). > > > This was intended as a case of enforcing explicit > implicit. The next > line in the documentation reads: > > {{{ > Error('error message', hint=None) # Better > }}} > > suggesting that the preferred syntax is to explicitly state that there > isn't a hint. > > However, I can see how this might be slightly contrary to expectation > for Python developers generally. I'd be interested in hearing other > opinions on this.
I don't think there's a reason to require the argument; if `None` is a valid value for the argument, then clearly it is semantically optional, so give it a default of `None` and make it actually optional. Carl -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/52F2C9DF.4090909%40oddbird.net. For more options, visit https://groups.google.com/groups/opt_out.
