Newbie pythoner, with bizzare problem

Cameron Laird claird at starbase.neosoft.com
Wed Jul 26 08:00:32 EDT 2000


In article <8lcef2$fbn$0 at 216.39.151.169>, Donn Cave  <donn at oz.net> wrote:
			.
			.
			.
>| What surprises me, though, is that no one ever
>| mentions the possibility of writing
>|   inp = __builtin__.open("c:/autoexec.bat",'r')
>
>What surprises me is that you mentioned it.  I mean,
>it's interesting in an academic way, but it's not
>clear to me how you would see that working in practice.
>
>	Donn Cave, donn at oz.net

It's a development idiom, like many of the introspective
facilities.  While it's not what I want to see in production
code, I personally might find it handy to be in the inter-
preter, type
  from os import *
as an abbreviation I think I can tolerate temporarily, and
then want access to __builtin__.open() without having to
restart my interpreter state.  Guido wisely keeps various
contaminants of the handy-abbreviation-for-something-already-
expressible (think of the "while 1" controversies) out of
the language; at the same time, I think it's right for a
working programmer to know tactical dodges that enhance
productivity while staying within the language.

Thanks, by the way, to Gordon, Paul, and the others who
supplied much more precise context for its semantics.
-- 

Cameron Laird <claird at NeoSoft.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list