Why Python Is Not My Favorite Language (2016)
So, this shortens down to &quot;I don&#x27;t want people touching my private class members&quot;, &quot;I want multi-line lambdas&quot;, and &quot;I want types&quot;.<p>WRT private class members, I can understand why this might be frustrating for library writers. But it&#x27;s just so damned useful to be able to reach into a library and get functionality the library&#x27;s writer didn&#x27;t think I&#x27;d need, that I&#x27;ll personally never consider this to be bad.<p>Multi-line lambdas would certainly be nice, but most of it can be handled with a scope-level function. It adds, on average, one line of boilerplate. As for syntax, no need to use Ruby&#x27;s syntax, just incorporate parenthesis (a well established continuation construct within Python):<p><pre><code>    with(open(&quot;foo.txt&quot;), lambda f: (
        print(f)
        print(&quot;I am a teapot&quot;)
    ))
</code></pre>
The sinatra example doesn&#x27;t really make the writer&#x27;s argument about decorators to me; since the Flask example exposes a bit more functionality for only two lines of code - I now have a distinct app object, and can create more, or explicitly access attributes of the app itself. I can even add authentication to that function with just two lines:<p><pre><code>    auth = flask.ext.httpauth.HTTPBasicAuth()

    @app.route(&quot;&#x2F;&quot;)
    @auth.login_required
    def handle_route():
        return &quot;I am a tea pot&quot;
</code></pre>
No, Python isn&#x27;t Ruby; it doesn&#x27;t support the same degree of metaprogramming. That&#x27;s good, IMO. Metaprogramming is the source of exponentially more technical debt (and bugs) than is reasonable, frankly.<p>As for the lack of a type system, yeah, that is definitely Python&#x27;s biggest weakness for large programs. A lot of it is resolved with the type hints in Python3, but a lot of it is just Python itself. Love it or hate it, that&#x27;s how Python is, was, and will be.<p>As for the example error - there is a typo. Of course it&#x27;s going to throw a traceback. The error message is even more explicit than I expected, frankly. It pointed out the missing function name, which would make the typo rather easy to find.