A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-January/060055.html below:

[Python-Dev] The path module PEP

[Python-Dev] The path module PEP [Python-Dev] The path module PEPToby Dickenson tdickenson at devmail.geminidataloggers.co.uk
Wed Jan 25 13:30:06 CET 2006
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4