On Wed, Jan 25, 2017 at 10:45 AM, Thomas Kluyver <tho...@kluyver.me.uk>
wrote:

> On Wed, Jan 25, 2017, at 03:33 PM, Todd wrote:
>
> On Wed, Jan 25, 2017 at 10:18 AM, Petr Viktorin <encu...@gmail.com> wrote:
>
> But what if the .tar.gz file is called "spam-4.2.5-final.tar.gz"?
> Existing tools like glob and endswith() can deal with the ".tar.gz"
> extension reliably, but "fullsuffix" would, arguably, not give the answers
> you want.
>
>
>
> I wouldn't use it in that situation.
>
>
> You might not, but it seems like an attractive nuisance. You can't
> reliably use it as a test for .tar.gz files, but it would be easy to think
> that you can and write buggy code using it. And I can't currently think of
> a general example where it would be useful.
>


>From my perspective at least, those arguments apply just as well to the
existing "suffix" and "stem" properties.


>
> I thought about suggesting a 'hassuffix' method, but it doesn't pass the
> 'one way to do it' test when you can do:
>
> p.name.endswith('.tar.gz')
>

Then why is there a "match" method?  It doesn't seem like the "one way to
do it test" is being used for pathlib, nor do I think it really applies for
a module whose whole point is to provide convenience tools.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to