<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 7, 2016 at 4:03 AM, Donald Stufft <span dir="ltr"><<a href="mailto:donald@stufft.io" target="_blank">donald@stufft.io</a>></span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It seems like it would be reasonable for pathlib.Path to call fspath on the<br>
path passed to pathlib.Path.__init__, which would mean that if other libraries<br>
implemented __fspath__ then you could pass their path objects to pathlib and<br>
it would just work</blockquote><div><br></div><div>and then any lib that needed a path, could simply wrap Path() around whatever was passed in.</div><div><br></div><div>This is much like using np.array() if you want numpy arrays -- it works great.</div><div><br></div><div>numpy is trickier because they are mutable and can be big, so you don't want to make a copy if you don't need to -- hence the np.asarray() function -- but Paths are immutable and far more lightweight.</div><div><br></div><div>-CHB</div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R (206) 526-6959 voice<br>7600 Sand Point Way NE (206) 526-6329 fax<br>Seattle, WA 98115 (206) 526-6317 main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>