Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10529 > unrolled thread

PyWart: os.path needs immediate attention!

Started byrantingrick <rantingrick@gmail.com>
First post2011-07-29 10:22 -0700
Last post2011-08-03 11:52 +0200
Articles 7 on this page of 27 — 17 participants

Back to article view | Back to comp.lang.python


Contents

  PyWart: os.path needs immediate attention! rantingrick <rantingrick@gmail.com> - 2011-07-29 10:22 -0700
    Re: PyWart: os.path needs immediate attention! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 12:53 -0500
      Re: PyWart: os.path needs immediate attention! harrismh777 <harmar@member.fsf.org> - 2011-07-29 14:41 -0500
        Re: PyWart: os.path needs immediate attention! "Waldek M." <wm@localhost.localdomain> - 2011-07-29 21:55 +0200
      Re: PyWart: os.path needs immediate attention! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-30 10:50 +1000
        Function "modes" vs. separate functions (was: PyWart: os.path needs immediate attention!) Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 20:15 -0500
          Re: Function "modes" vs. separate functions Ben Finney <ben+python@benfinney.id.au> - 2011-07-30 11:57 +1000
            Re: Function "modes" vs. separate functions Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 21:28 -0500
        Re: PyWart: os.path needs immediate attention! Terry Reedy <tjreedy@udel.edu> - 2011-07-30 09:48 -0400
        Re: PyWart: os.path needs immediate attention! Robert Kern <robert.kern@gmail.com> - 2011-07-30 23:31 -0400
    Re: PyWart: os.path needs immediate attention! Teemu Likonen <tlikonen@iki.fi> - 2011-07-29 23:07 +0300
      Re: PyWart: os.path needs immediate attention! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-30 10:57 +1000
        Re: PyWart: os.path needs immediate attention! Teemu Likonen <tlikonen@iki.fi> - 2011-08-01 11:19 +0300
          Re: PyWart: os.path needs immediate attention! rantingrick <rantingrick@gmail.com> - 2011-08-02 09:03 -0700
            Re: PyWart: os.path needs immediate attention! Chris Angelico <rosuav@gmail.com> - 2011-08-02 17:36 +0100
    Re: PyWart: os.path needs immediate attention! Chris Angelico <rosuav@gmail.com> - 2011-07-30 06:25 +1000
    Re: PyWart: os.path needs immediate attention! Corey Richardson <kb1pkl@aim.com> - 2011-07-29 16:44 -0400
    Re: PyWart: os.path needs immediate attention! Alister Ware <alister.ware@ntlworld.com> - 2011-07-29 21:21 +0000
      Re: PyWart: os.path needs immediate attention! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 16:36 -0500
    Re: PyWart: os.path needs immediate attention! Chris Angelico <rosuav@gmail.com> - 2011-07-30 07:43 +1000
    Re: PyWart: os.path needs immediate attention! Terry Reedy <tjreedy@udel.edu> - 2011-07-29 19:30 -0400
    Re: PyWart: os.path needs immediate attention! Michael Poeltl <michael.poeltl@univie.ac.at> - 2011-07-30 02:30 +0200
      Re: PyWart: os.path needs immediate attention! Grant Edwards <invalid@invalid.invalid> - 2011-07-30 15:33 +0000
        Re: PyWart: os.path needs immediate attention! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-30 10:56 -0500
          Re: PyWart: os.path needs immediate attention! alex23 <wuwei23@gmail.com> - 2011-08-02 23:52 -0700
    Re: PyWart: os.path needs immediate attention! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-29 22:17 -0700
    Re: PyWart: os.path needs immediate attention! Gelonida N <gelonida@gmail.com> - 2011-08-03 11:52 +0200

Page 2 of 2 — ← Prev page 1 [2]


#10556

FromTerry Reedy <tjreedy@udel.edu>
Date2011-07-29 19:30 -0400
Message-ID<mailman.1644.1311982257.1164.python-list@python.org>
In reply to#10529
On 7/29/2011 1:22 PM, rantingrick wrote:

>   * Introduce a new method named "partition" which (along with string
> splitting methods) will replace the six methods "basename", "dirname",
> "split", "splitdrive", "splitunc", "splittext". The method will return
> a tuple of the path split into four parts: (drive, path, filename,
> extension).

A named tuple would be an even better return, so one could refer to the 
parts as t.drive, etc.

[toc] | [prev] | [next] | [standalone]


#10558

FromMichael Poeltl <michael.poeltl@univie.ac.at>
Date2011-07-30 02:30 +0200
Message-ID<mailman.1646.1311985849.1164.python-list@python.org>
In reply to#10529
join 'Python-Dev'-mailinglist and tell them!                                    
from now on I will just ignore threads you initiated

does trolling really make that much fun?
* rantingrick <rantingrick@gmail.com> [2011-07-29 19:25]:
> 
> --------------------------------------------------
>  Overview of Problems:
> --------------------------------------------------
> 
>  * Too many methods exported.
>  * Poor choice of method names.
>  * Non public classes/methods exported!
>  * Duplicated functionality.
> 
> --------------------------------------------------
>  Proposed new functionality:
> --------------------------------------------------
> 
>  * New path module will ONLY support one path sep! There is NO reason
> to support more than one. When we support more than one path sep we
> help to propagate multiplicity.We should only support the slash and
> NOT the backslash across ALL OS's since the slash is more widely
> accepted. If an OS does not have the capability to support only the
> slash then that OS is not worthy of a Python builtin module. The users
> of such OS will be responsible for managing their OWN os_legacy.path
> module. We are moving forward. Those who wish to wallow in the past
> will be left behind.
> 
>  * Introduce a new method named "partition" which (along with string
> splitting methods) will replace the six methods "basename", "dirname",
> "split", "splitdrive", "splitunc", "splittext". The method will return
> a tuple of the path split into four parts: (drive, path, filename,
> extension). This is the ONLY splitting method this module needs. All
> other splits can use string methods.
> 
> --------------------------------------------------
>  Expose of the Warts of current module:
> --------------------------------------------------
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>  1. Too many methods
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Follows is a list of what to keep and what to cull:
> 
>  + abspath
>  + altsep
>  - basename --> path.partition[-2]
>  + commonprefix
>  + curdir
>  + defpath
>  + devnull
>  - dirname --> os.path.join(drive,path)
>  + exists
>  + expanduser
>  + expandvars
>  + extsep
>  - genericpath --> should be private!
>  + getatime
>  + getctime
>  + getmtime
>  + getsize
>  + isabs
>  + isdir
>  + isfile
>  + islink
>  + ismount
>  + join
>  - lexists --> duplicate!
>  - normcase --> path = path.lower()
>  - normpath --> should not need this!
>  - os --> should be private!
>  + pardir
>  + pathsep
>  + realpath
>  + relpath
>  + sep
>  - split --> path.rsplit('/', 1)
>  - splitdrive --> path.split(':', 1)
>  - splitext --> path.rsplit('.')
>  - splitunc --> Unix specific!
>  - stat --> should be private!
>  + supports_unicode_filenames --> windows specific!
>  - sys --> should be private!
>  + walk
>  - warnings --> should be private!
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>  2. Poor Name Choices:
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>  * basename --> should be: filename
>  * split --> split what?
>  * splitext --> Wow, informative!
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>  3. Non Public Names Exposed!
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>  * genericpath
>  * os
>  * stat
>  * sys
>  * warnings
> 
> 
> Note: i did not check the Unix version of os.path for this.
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>  4. Duplicated functionality.
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> >>> os.path.lexists.__doc__
> 'Test whether a path exists.  Returns False for broken symbolic links'
> >>> os.path.exists.__doc__
> 'Test whether a path exists.  Returns False for broken symbolic links'
> 
> Should have been one method:
> >>> os.path.exists(path, ignoreSymLnks=False)
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
Michael Poeltl
Computational Materials Physics      voice: +43-1-4277-51409
Univ. Wien, Sensengasse 8/12         fax:   +43-1-4277-9514 (or 9513) 
A-1090 Wien, AUSTRIA   cmp.mpi.univie.ac.at 

[toc] | [prev] | [next] | [standalone]


#10583

FromGrant Edwards <invalid@invalid.invalid>
Date2011-07-30 15:33 +0000
Message-ID<j11888$iab$1@reader1.panix.com>
In reply to#10558
On 2011-07-30, Michael Poeltl <michael.poeltl@univie.ac.at> wrote:
> join 'Python-Dev'-mailinglist and tell them!                                    
> from now on I will just ignore threads you initiated
>
> does trolling really make that much fun?

RR must think so, considering how much effort he seems to put into it.
It is rather amusing to see how many people take him seriously.  I
plonked him ages ago, but thanks to all the people who reply with one
or two lines and then quote his entire flippin' rant, I still get to
see most of his posts.

> * rantingrick <rantingrick@gmail.com> [2011-07-29 19:25]:

[100+] lines of unnecessarily quoted bait elided.

[toc] | [prev] | [next] | [standalone]


#10585

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2011-07-30 10:56 -0500
Message-ID<mailman.1664.1312041405.1164.python-list@python.org>
In reply to#10583
On 2011.07.30 10:33 AM, Grant Edwards wrote:
> RR must think so, considering how much effort he seems to put into it.
He hasn't replied to his last two troll threads, though. It does seem
odd to write a wall of text and then not respond to replies. To be fair,
though, most replies either mock him or point out that he's a troll. :D

-- 
CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB

[toc] | [prev] | [next] | [standalone]


#10785

Fromalex23 <wuwei23@gmail.com>
Date2011-08-02 23:52 -0700
Message-ID<7034abec-975d-4ed6-9cb7-7cc54ff4ef7b@s21g2000pre.googlegroups.com>
In reply to#10585
Andrew Berg <bahamutzero8...@gmail.com> wrote:
> He hasn't replied to his last two troll threads, though. It does seem
> odd to write a wall of text and then not respond to replies. To be fair,
> though, most replies either mock him or point out that he's a troll. :D

His recent rants do seem a lot more Xah-Lee-like; a huge nonsensical
diatribe that badly applies logic to try and mask its emotive agenda.
A lot of the same "great mind struggling against the tyranny of
idiots" subtext too.

Not so much swearing though.

[toc] | [prev] | [next] | [standalone]


#10573

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2011-07-29 22:17 -0700
Message-ID<mailman.1652.1312003209.1164.python-list@python.org>
In reply to#10529
On Sat, 30 Jul 2011 07:43:15 +1000, Chris Angelico <rosuav@gmail.com>
declaimed the following in gmane.comp.python.general:

 
> Just tested this: You can type c:/foldername into the box at the top
> of a folder in Explorer, and it works. It will translate it to
> c:\foldername though.
>
	So far as I know, the only place that /requires/ the \ is the
command shell (since / is the "option" introducer). If one uses run-time
libraries only, and never invokes os.system() or similar, one is free to
use / all they want.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#10796

FromGelonida N <gelonida@gmail.com>
Date2011-08-03 11:52 +0200
Message-ID<mailman.1829.1312365181.1164.python-list@python.org>
In reply to#10529
On 07/29/2011 11:43 PM, Chris Angelico wrote:
> On Sat, Jul 30, 2011 at 6:44 AM, Corey Richardson <kb1pkl@aim.com> wrote:
>> Excerpts from rantingrick's message of Fri Jul 29 13:22:04 -0400 2011:
>>>  * New path module will ONLY support one path sep!
>>
>> People who use windows are used to \ being their pathsep. If you show
>> them a path that looks like C:/whatever/the/path in an app, they are
>> going to think you are nuts. It isn't up to us to decide what anyone
>> uses as a path separator. They use \ natively, so should we. If at
>> any point Windows as an OS starts using /'s, and not support, actually
>> uses (in Windows Explorer as default (or whatever the filebrowser's
>> name is)), it would be great to switch over.
> 
> Just tested this: You can type c:/foldername into the box at the top
> of a folder in Explorer, and it works. It will translate it to
> c:\foldername though.
> 
> We are not here to talk solely to OSes. We are here primarily to talk
> to users. If you want to display a path to the user, it's best to do
> so in the way they're accustomed to - so on Windows, display
> backslashes.
> 
>>>  - normcase --> path = path.lower()
>>
>> Not quite, here are a few implementations of normcase (pulled from 2.7)
>>
>> # NT
>>    return s.replace("/", "\\").lower()
>>
>> # Mac (Correct in this case)
>>    return path.lower()
>>
>> # POSIX
>>    return s
>>
>> But I can't think of where I would ever use that. Isn't case important on
>> Windows?
> 


well normcase might help to find out, whether two filenames are the same.


under unix 'myfile' and 'myFile' would be different
under windows they would refer to the same file.

normcase (perhaps to be combined with normpath) can tel you this.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web