Question about python 2.4 documentation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fouff

    #1

    Question about python 2.4 documentation

    Hello all.

    I have a small question concerning the functions open(...) and file(...)
    with python 2.4

    In the online version of the documentation in the build-in functions
    (section 2.1 http://docs.python.org/lib/built-in-funcs.html) here is an
    quote of the file(...) doc :[color=blue]
    > The file() constructor is new in Python 2.2 and is an alias for open().
    > Both spellings are equivalent.
    > The intent is for open() to continue to be preferred for use as a factory function which
    > returns a new file object.
    > The spelling, file is more suited to type testing (for example, writing "isinstance (f, file)").[/color]


    In my installed python 2.4 documentation the correspondig quote :[color=blue]
    > The file() constructor is new in Python 2.2.
    > The previous spelling, open(), is retained for compatibility, and is an alias for file().[/color]

    If I understand well, in my version it is recommended to use file()
    function instead of open(), and in the online version it is the opposite.

    what is the favorite function you recommend me to use ?


    Thanks for your responses .
  • Peter Otten

    #2
    Re: Question about python 2.4 documentation

    Fouff wrote:
    [color=blue]
    > I have a small question concerning the functions open(...) and file(...)
    > with python 2.4[/color]
    [color=blue][color=green]
    >> The intent is for open() to continue to be preferred for use as a factory
    >> function which returns a new file object.[/color][/color]

    versus
    [color=blue][color=green]
    >> The previous spelling, open(), is retained for compatibility, and is an
    >> alias for file().[/color][/color]
    [color=blue]
    > what is the favorite function you recommend me to use ?[/color]

    The former has BDFL blessing. Let Guido speak:



    Peter

    Comment

    Working...