[Twisted-Python] Twisted 1.0.4 - Possible typo in twisted.web.vhost ?

François Pinard pinard at iro.umontreal.ca
Tue Apr 29 15:35:47 EDT 2003


For Twisted 1.0.4, file twisted/web/vhost.py, line 100 is:

---------------------------------------------------------------------->
        return self.hosts.get(host, self.default or error.NoResource("host %s not in vhost map" % repr(host)))
----------------------------------------------------------------------<

Could it be (?) that this line should be written:

---------------------------------------------------------------------->
        return self.hosts.get(host, self.default) or error.NoResource("host %s not in vhost map" % repr(host))
----------------------------------------------------------------------<

or, to keep it under 80 columns:

---------------------------------------------------------------------->
        return (self.hosts.get(host, self.default)
                or error.NoResource("host %s not in vhost map" % repr(host)))
----------------------------------------------------------------------<

If we can rely on Python 2.2, we could simplify it a bit more:

---------------------------------------------------------------------->
        return (self.hosts.get(host, self.default)
                or error.NoResource("host %r not in vhost map" % host))
----------------------------------------------------------------------<

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Twisted-Python mailing list