Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'sys': 0.05; 'warnings': 0.05; 'names.': 0.07; 'path,': 0.07; 'sep': 0.07; 'python': 0.08; 'backslash': 0.09; 'be:': 0.09; 'builtin': 0.09; 'filename': 0.09; 'method:': 0.09; 'splitting': 0.09; 'tuple': 0.09; 'broken': 0.12; "'test": 0.16; 'basename': 0.16; 'dirname': 0.16; 'filename,': 0.16; 'module:': 0.16; 'propagate': 0.16; 'rantingrick': 0.16; 'realpath': 0.16; 'received:131': 0.16; 'splits': 0.16; 'symbolic': 0.16; 'univ.': 0.16; 'what?': 0.16; 'wien,': 0.16; 'wow,': 0.16; '>>>': 0.16; 'exists': 0.19; 'exists.': 0.19; 'ignore': 0.21; 'header:In-Reply-To:1': 0.22; '(or': 0.25; 'moving': 0.25; 'string': 0.26; 'windows': 0.26; 'url:mailman': 0.27; 'module': 0.30; 'behind.': 0.30; 'forward.': 0.30; 'initiated': 0.30; 'stat': 0.30; 'threads': 0.30; 'version': 0.30; 'this.': 0.31; 'url:listinfo': 0.32; 'michael': 0.32; 'named': 0.32; 'overview': 0.32; 'proposed': 0.32; 'list': 0.32; 'too': 0.32; 'does': 0.32; 'to:addr:python-list': 0.34; 'header:User- Agent:1': 0.34; 'there': 0.34; 'module.': 0.35; 'widely': 0.35; 'charset:us-ascii': 0.36; 'skip:" 10': 0.36; 'non': 0.36; 'skip:o 20': 0.36; 'url:python': 0.37; 'url:org': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'help': 0.39; 'skip:s 20': 0.39; 'to:addr:python.org': 0.39; 'skip:- 50': 0.40; 'did': 0.40; 'methods': 0.40; 'skip:+ 10': 0.66; 'subject:!': 0.67; 'note:': 0.68; 'materials': 0.69; 'wish': 0.70; 'fun?': 0.73; 'introduce': 0.79; 'choices:': 0.84; 'methods)': 0.84; 'this!': 0.84; 'voice:': 0.84; 'worthy': 0.84; '-->': 0.91 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=univie.ac.at; s=rev2; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=BmyBuTHzHuBhW5i2Dn8x4I1w7LsO6+6My4Effixhlf0=; b=cLJY4TszSyuTS8iCCBga751LLhLrPOFe6GYR16tpCVb1JjMcF2XFnAE/raqDEiXupPtXVkPgkEfAOts3KYvCDkTQtFsagPtaGgul3luUaFA97dEa9NSE/cSDFPlTWr4FRY6u4I4uy8t/jJMy17MjoZPECJ03rdWnquC4PsbFiW8=; Date: Sat, 30 Jul 2011 02:30:47 +0200 From: Michael Poeltl To: python-list@python.org Subject: Re: PyWart: os.path needs immediate attention! References: <14874f59-a836-4031-a8c9-6b24f4d5e812@d7g2000vbv.googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14874f59-a836-4031-a8c9-6b24f4d5e812@d7g2000vbv.googlegroups.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Univie-Virus-Scan: scanned by ClamAV on joan.univie.ac.at X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 131 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311985849 news.xs4all.nl 23935 [2001:888:2000:d::a6]:44048 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10558 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 [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