From python-dev Wed Jan 25 12:30:06 2006 From: Toby Dickenson Date: Wed, 25 Jan 2006 12:30:06 +0000 To: python-dev Subject: Re: [Python-Dev] The path module PEP Message-Id: <200601251230.06230.tdickenson () devmail ! geminidataloggers ! co ! uk> X-MARC-Message: https://marc.info/?l=python-dev&m=113819376421111 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