<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>On Wed, Jan 25, 2017, at 03:58 PM, Todd wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div><div defang_data-gmailquote="yes"><div>On Wed, Jan 25, 2017 at 10:45 AM, Thomas Kluyver <span dir="ltr"><<a href="mailto:thomas@kluyver.me.uk">thomas@kluyver.me.uk</a>></span> wrote:<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div><u></u><span></span>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.<br></div>
</blockquote><div><div><br></div>
</div>
<div>From my perspective at least, those arguments apply just as well to the existing "suffix" and "stem" properties.<br></div>
</div>
</div>
</div>
</blockquote><div><br></div>
<div>To some extent it does. But the convention of looking at a single extension is common enough that there's a stronger case for providing easy access to that.<br></div>
<div><br></div>
<blockquote type="cite"><div dir="ltr"><div><div defang_data-gmailquote="yes"><div> I thought about suggesting a 'hassuffix' method, but it doesn't pass the 'one way to do it' test when you can do:<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div><div><br></div>
<div>p.name.endswith('.tar.gz')<br></div>
</div>
</blockquote><div>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.<br></div>
</div>
</div>
</div>
</blockquote><div><br></div>
<div>Everything is trade-offs: if you can justify why a new thing is useful enough, that can override the 'one way to do it' consideration. That's why we now have four kinds of string formatting. But I don't think 'X got away with it so we should allow Y too' is a compelling argument.<br></div>
</body>
</html>