PRE-PEP: new Path class

Discussion in 'Python' started by Michael Chermside, Jan 8, 2004.

  1. > > Another Point:
    > > Should Path be immutable like string?

    >
    > I have though about this, too. It should certainly not be fully mutable,
    > because if a path changes, it changes. But maybe we could have a
    > .normalise_inplace() which mutates the Path? What consequences would
    > this have for hashability?
    >
    > I like paths to be hashable. so they probably should be immutable.


    I agree... paths should be immutable.

    Instead of .normalize_inplace() which changes the behavior of the
    Path, how about .get_normalized_string() (please find a better name)
    which allows access to the normalized version without mutating the
    Path object? (Or perhaps it should be .get_normalized_Path()... I'm
    not sure.)

    -- Michael Chermside
     
    Michael Chermside, Jan 8, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Roth

    PRE-PEP: new Path class

    John Roth, Jan 5, 2004, in forum: Python
    Replies:
    31
    Views:
    774
    Christoph Becker-Freyseng
    Jan 11, 2004
  2. Gerrit Holl

    Re: PRE-PEP: new Path class

    Gerrit Holl, Jan 8, 2004, in forum: Python
    Replies:
    3
    Views:
    295
    Peter Hansen
    Jan 8, 2004
  3. Christoph Becker-Freyseng

    PEP for new modules (I read PEP 2)

    Christoph Becker-Freyseng, Jan 15, 2004, in forum: Python
    Replies:
    3
    Views:
    396
    Gerrit Holl
    Jan 16, 2004
  4. Reinhold Birkenfeld

    [path-PEP] Path inherits from basestring again

    Reinhold Birkenfeld, Jul 23, 2005, in forum: Python
    Replies:
    34
    Views:
    719
    Reinhold Birkenfeld
    Jul 30, 2005
  5. Juha Nieminen
    Replies:
    3
    Views:
    1,210
    Juha Nieminen
    Feb 22, 2008
Loading...

Share This Page