Re: path module

Discussion in 'Python' started by Just van Rossum, Jul 8, 2003.

  1. Skip Montanaro wrote:

    > Just> a.join(b, c, d)
    >
    > Just> which I don't think is all that bad.
    >
    > Yes, but
    >
    > a/b/c/d
    >
    > is nicely analogous to Unix pathname syntax.


    But when the items are variables, what you read is not what you get.
    Often you'll want (some) literals, and then you get

    path = basePath/"a"/"b"/"c"

    ....and _that_ I find quite horrible...

    (Did I mention that / usually means divide in Python? ;-)

    Just
     
    Just van Rossum, Jul 8, 2003
    #1
    1. Advertising

  2. Just van Rossum

    Nick Vargish Guest

    Just van Rossum <> writes:

    > (Did I mention that / usually means divide in Python? ;-)


    I believe you did... But doesn't % usually mean modulo in Python?

    :^)

    Nick

    --
    # sigmask | 0.2 | 2003-01-07 | public domain | feed this to a python
    print reduce(lambda x,y:x+chr(ord(y)-1),'Ojdl!Wbshjti!=obwAqbusjpu/ofu?','')
     
    Nick Vargish, Jul 8, 2003
    #2
    1. Advertising

  3. Just van Rossum

    Peter Hansen Guest

    Nick Vargish wrote:
    >
    > Just van Rossum <> writes:
    >
    > > (Did I mention that / usually means divide in Python? ;-)

    >
    > I believe you did... But doesn't % usually mean modulo in Python?


    I believe you'll find it's more common for it to mean "format",
    but the point is that it is well understood that it means *either*,
    depending on context.

    Using / for this new concatenation-like behaviour is tantamount
    to adding new syntax to Python again... :-(

    -Peter
     
    Peter Hansen, Jul 8, 2003
    #3
    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. Keith-Earl
    Replies:
    1
    Views:
    2,027
    Peter O'Reilly
    May 3, 2004
  2. Replies:
    0
    Views:
    2,301
  3. Mupota Muchelemba
    Replies:
    1
    Views:
    951
    Tony Morris
    Feb 4, 2004
  4. Ron Adam
    Replies:
    3
    Views:
    464
    Ron Adam
    Aug 2, 2005
  5. Maric Michaud
    Replies:
    0
    Views:
    7,222
    Maric Michaud
    Jun 24, 2006
Loading...

Share This Page