3 ms·
"Of course, Python couldn't have told me 'request' [from Bottle] didn't have a member 'content_type' and ended the matter right then and there. No, it had to st
by dalke 12y ago
"Of course, Python couldn't have told me 'request' [from Bottle] didn't have a member 'content_type' and ended the matter right then and there. No, it had to string me along, doing anything except let me know something was wrong."
Umm, but the request object does have a content_type. See http://bottlepy.org/docs/dev/_modules/bottle.html#BaseRequest.content_type http://bottlepy.org/docs/dev/_modules/bottle.html#BaseReques... .
- th0br0 12y ago... which, in an ideal world, the compiler would tell you is immutable however.
- dalke 12y agoIn this ideal world of yours, the developer needs to mark if a property is mutable or immutable, yes? Python API developers already have the ability to produce immutable attributes. In fact, as you can see from the link I gave, the attribute is currently defined as a read-only property. According the version control log, it looks like it was added on "Tue Jun 26 12:14:42 2012 +0200". This essay was written only a few months later, on 2012-10-17. So while there are many reasons to not like Python-the-language, this specific complaint is 1) incorrect, in that content_type is an attribute of the request, and 2) a library API issue which has since been fixed, so is not intrinsic in the language. There is still the valid complaint that most Python API developers do not mark attributes as immutable. This is part of the Python worldview that we are all "consenting adults". However, the essayist did not voice that complaint.