6 ms·
It's sad and ironic (for Python) that Zed actually had to switch from Python to C to make Mongrel more portable. Disclaimer: I love Python, but I hate that any
by donaq 16y ago
It's sad and ironic (for Python) that Zed actually had to switch from Python to C to make Mongrel more portable.
Disclaimer: I love Python, but I hate that anything but the most trivial code won't run across all versions.
- rbanffy 16y ago> I hate that anything but the most trivial code won't run across all versions. Please, define "all versions" and "most trivial code". I have very little problems with Pythons ranging from the ancient 2.4 to modern 2.7. Of course, I am careful with what I do. I know if I use a dictionary comprehension I will be limited to 2.7+, so I try not to. I am quite sure a lot of the code I write could run under any 2.x Python with little modification. As for 1.x, I will agree that things get more complicated.
- donaq 16y agoWell, it's a matter of opinion, but I would define "all versions" as versions sharing a major number, i.e. code targeting 2.2 should run on anything starting with 2. As for trivial code, just look at the string operations part of the documentation and search for "new in" and "changed in". My connection is rather slow right now, to the point that the page I mentioned is still loading, so I won't look for more examples, but string processing should IMO be trivial parts of any language. Don't get me wrong, the changes have mostly been useful ones for 2.x versions, but I have been caught testing scripts on my own box that end up not working after deploying. Since then, I have been, as you say, more careful, but I feel I have a valid gripe when I expect string and io operations to be consistent across major versions without having to do a fine print and version check. :)
- zedshaw 16y agogenerators
- rbanffy 16y agoI know that if I really need generators, then I really need to install something newer than the 2.4 that comes with RHEL/CentOS 4. Generators is 2.6+, right? BTW, an ugly approach I used (more or less as a joke) was to check for generator availability and, in case I can't use them, use a list comprehension instead. There is a performance/memory hit but, depending on what you are doing, it's a usable alternative. And a nice place to hang humorous comments. But I agree that, if your users don't want to install an alien (from the package manager POV) Python in order to run Mongrel, getting rid of python code is the right thing to do. It's like having a weird dependency, kind of requiring a Fortran 77 compiler in order to run Perl...
- pdonis 16y agoUm...generators are Python 2.2+ (introduction of the yield statement): http://docs.python.org/release/2.2/ref/yield.html http://docs.python.org/release/2.2/ref/yield.html Generator expressions are 2.4+: http://docs.python.org/release/2.4/ref/genexpr.html http://docs.python.org/release/2.4/ref/genexpr.html That said, I don't disagree with removing the Python dependency from the "core" of Mongrel2. As was noted in an earlier comment, people can always write a config file management tool in any language they want (or Mongrel2 bindings in general, for that matter).
- rbanffy 16y ago> Generator expressions are 2.4+: So, what is the big deal? I can swear the oldest Python I had to deal with for the last couple years was 2.4.