[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-dev
Subject:    Re: [Python-Dev] The path module PEP
From:       Toby Dickenson <tdickenson () devmail ! geminidataloggers ! co ! uk>
Date:       2006-01-25 12:30:06
Message-ID: 200601251230.06230.tdickenson () devmail ! geminidataloggers ! co ! uk
[Download RAW message or body]

On Tuesday 24 January 2006 20:22, BJörn Lindqvist wrote:

>     Replacing glob.glob
>     -------------------
> 
>     glob.glob("/lib/*.so")
>     ==>
>     Path("/lib").glob("*.so")

This definition seems confusing because it splits the glob pattern string in 
two ('/lib', and '*.so'). Unless there is an intention to change the behavior 
of the current glob module, why not make the glob method parameterless:

    glob.glob("/lib/*.so")
    ==>
    Path("/lib/*.so").glob()


Possible confusion with the one parameter version:

Does glob matching happen on the first half too? That is, does 
Path('*').glob('*.so') match files in any directory, or only directories 
whose name is an asterisk.

What behavior can I expect from Path('/foo/').glob(bar), where bar is some 
arbitrary string? It could be reasonable to expect that it would only match 
filenames inside the foo directory. However it could also be reasonable to 
expect to use bar=='/etc/*'


-- 
Toby Dickenson
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic