open vs. open 
Author Message
 open vs. open

Hi all,

I'm surely not the first one who was trapping into the
'__builtin__.open vs. os.open' problem.

Question: is it possible to rename the __builtin__.open call to
__builtin__.fopen because it does really a fopen library call??

Or does it break something ??

Regards

Armin



Tue, 20 Apr 2004 05:14:23 GMT  
 open vs. open


Quote:
> Hi all,

> I'm surely not the first one who was trapping into the
> '__builtin__.open vs. os.open' problem.

> Question: is it possible to rename the __builtin__.open call to
> __builtin__.fopen because it does really a fopen library call??

Yes.

Quote:

> Or does it break something ??

Probably.

It sounds like you're doing from os import open.  Why not import os, then
refer to os.open?

Emile van Sebille



Tue, 20 Apr 2004 05:31:51 GMT  
 open vs. open

Quote:

> I'm surely not the first one who was trapping into the
> '__builtin__.open vs. os.open' problem.

That what module names are for.

Quote:
> Question: is it possible to rename the __builtin__.open call to
> __builtin__.fopen because it does really a fopen library call??

> Or does it break something ??

It would break all existing code which uses it.

--

 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.



Tue, 20 Apr 2004 05:35:46 GMT  
 open vs. open

    Armin> Question: is it possible to rename the __builtin__.open call to
    Armin> __builtin__.fopen because it does really a fopen library call??

    Armin> Or does it break something ??

Any code that calls open(fname) would no longer work.  You'd have to replace
it with something else.

--

http://www.mojam.com/
http://www.musi-cal.com/



Tue, 20 Apr 2004 05:25:46 GMT  
 open vs. open

| I'm surely not the first one who was trapping into the
| '__builtin__.open vs. os.open' problem.

Sure, lots of people have done that.  Overall, I suppose this
particular conflict is good thing, because you'll run into it
early enough that there's a chance you'll learn from it.  The
potential for such conflicts is limitless, if you think of it
in terms of "from x import *" for any combination of more than
one x, but this concrete example makes that more real for people
who aren't impressed by potential problems.




Tue, 20 Apr 2004 06:29:31 GMT  
 open vs. open

Quote:

> Hi all,

> I'm surely not the first one who was trapping into the
> '__builtin__.open vs. os.open' problem.

> Question: is it possible to rename the __builtin__.open call to
> __builtin__.fopen because it does really a fopen library call??

> Or does it break something ??

$ python2.2
python 2.2b1 (#1, Oct 21 2001, 19:50:56)
Quote:
>>> __builtins__.file is __builtins__.open

1

\Xi



Tue, 20 Apr 2004 22:17:25 GMT  
 open vs. open

Quote:


>> Hi all,

>> I'm surely not the first one who was trapping into the
>> '__builtin__.open vs. os.open' problem.

>> Question: is it possible to rename the __builtin__.open call to
>> __builtin__.fopen because it does really a fopen library call??

>> Or does it break something ??

>$ python2.2
>Python 2.2b1 (#1, Oct 21 2001, 19:50:56)
>>>> __builtins__.file is __builtins__.open

Many thanks! Good to know ...

Armin

Quote:
>1

>\Xi



Mon, 26 Apr 2004 03:33:44 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. LV5 VISA Open vs LV6 VISA Open

2. opening file vs. opening pipeline on NT.

3. Opening file vs. opening pipeline on NT.

4. Realbasic opens a window without a NewDocument event on opening the application

5. Closing an open browsebox when another browsebox opens

6. File Open, or not Open, question

7. Opening Child on MDI open

8. OPEN(VIEW) without OPEN(FILE)

9. P1275/Open Firmware/Open Boot newsgroup?

10. Open Source/Open Science conference announcement

11. VM Open Edition and MVS/ESA Open Edition

12. Open minds, err, open books... (repost)

 

 
Powered by phpBB® Forum Software