python 2.7.12 on Linux behaving differently than on Windows

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Dec 7 00:57:00 EST 2016


On Wednesday 07 December 2016 10:37, BartC wrote:

> On 06/12/2016 21:44, Gregory Ewing wrote:
>> BartC wrote:
> 
>>> And the justification? Well, %ENVIRONMENTVARIABLE% gets converted in
>>> Windows, so why not?!
>>
>> No, the justification is that the Unix convention allows
>> the shell to provide certain useful functions that Unix
>> users value.
>>
>> If you don't want those functions, you're free to write
>> your own shell that works however you want. Complaining
>> that everyone *else* should want the same things you
>> want is not reasonable.
> 
> How does that work?
> 
> Suppose I provide an assortment of applications that would work better
> if wildcards are expanded.
> 
> Do I then have to provide one more application, a shell, to be run first
> if someone wants to run any of my applications? Which they then have to
> quit if they want to run some other programs that depend on wildcard
> expansion.

Your question is ambiguous. If we're talking about Greg's tongue-in-cheek 
suggestion that you write your own shell, then the answer is, it depends 
entirely on you. This bartshell that doesn't expand wildcards is your baby, 
doing what *you* want it to do. So its your decision.

But I can tell you that by far the majority of Unix programs don't do their own 
globbing, or even offer it as an opt-in optional feature. Why would they need 
to? So if you want bartshell to be usable on Linux/Unix systems, you'll need 
some sort of opt-in setting to enable wildcard expansion.


> (Actually at this point I haven't got a clue as to how Unix applications
> are distributed. I guess it's not as simple as just providing a binary
> executable. For the moment, I'm using C source code as every Unix system
> has a C compiler. I suppose it could be Python source too, but I doubt
> if my interpreters written in Python will run quite as briskly -- 

bash is about an order of magnitude slower than Python, and its still plenty 
fast enough for practical work.



> I find C slow enough for this purpose.)

http://www.catb.org/jargon/html/story-of-mel.html



-- 
Steven
"Ever since I learned about confirmation bias, I've been seeing 
it everywhere." - Jon Ronson



More information about the Python-list mailing list