Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Shouldn't the super call be:

    super(MyFancyRequestHandler, self).send_response(code, message=message)
instead of:

    super(MyFancyRequestHandler, self).send_response(code, message=None)
(or even better, with args and kwargs)? Otherwise it seems that the message is discarded and None is always passed. This is one of the places where python's syntax is awful IMHO. Setting a default value shouldn't be the same as passing a parameter.


Spot the python3 syntax:

    super(ClassYouObviouslyMean, self).send_response(*a, **kw) 
    super().send_response(*a, **kw) 
Spot the python3 syntax:

    def f(x=default_value, y=None): pass
    def f(x:arbitrary_object=default_value, 
          y:this_doesnt_equal_None_y_does=None) -> more_wtf: ...


Nice catch, thank you! I've updated the article and gist with your correction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: