Re: Proposal: add sys to __builtins__

2005-09-26 Thread Tom Anderson
On Sun, 25 Sep 2005, James Stroud wrote: > I'm into *real* purity. I would rather begin every script: > > from python import list, str, dict, sys, os > > Oh wait. I only use dict in less than 50% of my scripts: > > from python import list, str, sys, os > > That's better. What? How exactly is th

Re: Proposal: add sys to __builtins__

2005-09-25 Thread James Stroud
I'm into *real* purity. I would rather begin every script: from python import list, str, dict, sys, os Oh wait. I only use dict in less than 50% of my scripts: from python import list, str, sys, os That's better. On Saturday 03 September 2005 02:09, tiissa wrote: > I was just stating you

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Rick Wotnaz
"Michael J. Fromberger" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In article <[EMAIL PROTECTED]>, > Rick Wotnaz <[EMAIL PROTECTED]> wrote: > >> You're right that there is no necessity for such a change. I >> was not actually talking about importing *any* module in every >> case, bu

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Patrick Maupin
Sybren Stuvel wrote: > A programming language should not be ambiguous. The choice > between importing a module and calling a function should not > depend on the availability of a (local) variable. Yeah, this behavior would be as ambiguous as if we had a system-defined search-path for modules, whe

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Rick Wotnaz <[EMAIL PROTECTED]> wrote: > You're right that there is no necessity for such a change. I was > not actually talking about importing *any* module in every case, > but rather about importing, say, 'sys' when, for example, sys.argv > appeared in the co

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Christopher Subich
Michael J. Fromberger wrote: > While I'm mildly uncomfortable with the precedent that would be set by including the contents of "sys" as built-ins, I must confess my objections are primarily aesthetic: I don't want to see the built-in namespace any more cluttered than is necessary -- or at le

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Rick Wotnaz
"Michael J. Fromberger" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In article <[EMAIL PROTECTED]>, > Rick Wotnaz <[EMAIL PROTECTED]> wrote: > >> Michael Hoffman <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >> > What would people think about adding sys to __builtins__

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Rick Wotnaz <[EMAIL PROTECTED]> wrote: > Michael Hoffman <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > What would people think about adding sys to __builtins__ so that > > "import sys" is no longer necessary? This is something I must > > add to eve

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Sybren Stuvel
Rick Wotnaz enlightened us with: > That is, a reference to xxx.func(), without a previous import of xxx > *could* be resolvable automatically, at least for those modules that > can be found in a standard location. -1 on that one. If I want to use a module, I'll write an import statement for it. Th

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Rick Wotnaz
"Terry Reedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > "Colin J. Williams" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Rick Wotnaz wrote: >>> +1 here. As far as I'm concerned, both os and sys could be >>> special- cased that way. That said, I would guess the

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Terry Reedy
"Colin J. Williams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Rick Wotnaz wrote: >> +1 here. As far as I'm concerned, both os and sys could be special- >> cased that way. That said, I would guess the likelihood of that >> happening is 0. >> > +1 for both. Some people might pr

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Colin J. Williams
Rick Wotnaz wrote: > Michael Hoffman <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>What would people think about adding sys to __builtins__ so that >>"import sys" is no longer necessary? This is something I must >>add to every script I write that's not a one-liner since they >>hav

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Xiao Jianfeng
Paul Watson wrote: >This sounds pretty interesting. How about a switch to invoke this >handling for the one-liner crowd and those who wish to use it? > > > >Somehow, I never heard any C programmers suggest that the default >processing not include the need for: > >#include > > I think it

Re: Proposal: add sys to __builtins__

2005-09-03 Thread tiissa
Michael Hoffman wrote: > To the contrary, I agree with Larry Wall that laziness is one of the > cardinal virtues of a programmer. There's lazy and too lazy. You don't want to be too lazy to even get out of bed to code in Python. Of course, with Perl, that's entirely another mattress^Wmatter. >

Re: Proposal: add sys to __builtins__

2005-09-02 Thread Paul Watson
Steve Holden wrote: > Rick Wotnaz wrote: > >> Michael Hoffman <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> What would people think about adding sys to __builtins__ so that >>> "import sys" is no longer necessary? This is something I must >>> add to every script I write that's not

Re: Proposal: add sys to __builtins__

2005-09-02 Thread Michael Hoffman
tiissa wrote: > A developper should not be too lazy to add one small line in a complete > script/module. To the contrary, I agree with Larry Wall that laziness is one of the cardinal virtues of a programmer. Although my personal desire to be lazy is not at issue here--I always start new scripts

Re: Proposal: add sys to __builtins__

2005-09-02 Thread tiissa
Michael Hoffman a écrit : > MrJbQ7 wrote: > > > Besides, a better way is to use your ~/.pythonrc file for customizing > > according to your needs. > > > > A simple: > > > > echo "import sys, os" >> ~./pythonrc > > > > will do the job. > > Until someone else tries to use your script or module. A

Re: Proposal: add sys to __builtins__

2005-09-02 Thread Michael Hoffman
MrJbQ7 wrote: > Steve Holden wrote: > >>I wonder if it would be worth special-casing the AttributeError [snip] > > What is it that Tim Peters said? "Special cases aren't special > enough..." That suggestion is a little too much magic for me. > Besides, a better way is to use your ~/.pythonrc fi

Re: Proposal: add sys to __builtins__

2005-09-01 Thread MrJbQ7
Steve Holden wrote: > I wonder if it would be worth special-casing the AttributeError [snip] What is it that Tim Peters said? "Special cases aren't special enough..." Besides, a better way is to use your ~/.pythonrc file for customizing according to your needs. A simple: echo "import sys, os"

Re: Proposal: add sys to __builtins__

2005-09-01 Thread Steve Holden
Rick Wotnaz wrote: > Michael Hoffman <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>What would people think about adding sys to __builtins__ so that >>"import sys" is no longer necessary? This is something I must >>add to every script I write that's not a one-liner since they >>hav

Re: Proposal: add sys to __builtins__

2005-09-01 Thread Rick Wotnaz
Michael Hoffman <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > What would people think about adding sys to __builtins__ so that > "import sys" is no longer necessary? This is something I must > add to every script I write that's not a one-liner since they > have this idiom at the bottom:

Proposal: add sys to __builtins__

2005-09-01 Thread Michael Hoffman
What would people think about adding sys to __builtins__ so that "import sys" is no longer necessary? This is something I must add to every script I write that's not a one-liner since they have this idiom at the bottom: if __name__ == "__main__": sys.exit(main(sys.argv[1:])) Additionally,