<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 7, 2016 at 11:48 AM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To me, the default proposal to expand the domain of open and other path functions is to call str on the path arg, either always or as needed. We should then ask "why isn't str() good enough"? Most bad args for open will immediately result in a file-not-found exception. But the os.path functions would not. Do the possible bugs and violation of python philosophy out-weigh the simplicity of the proposal?</blockquote><div><br></div><div>Thanks -- this is exactly the question at hand. it's gotten a bit caught up in all the discussion of what to call the magic method, should there be a top-level function, etc. but this is the only question on the table that isn't just bikeshedding.</div><div><br></div><div>personally, I think not -- but I"m very close to the fence.</div><div><br></div><div>Though no, most calls to open() would not fail -- most calls to open(path, 'r') would but most calls to open(path, 'w') would succeed and produce some really weird filenames -- but so what?</div><div><br></div><div><br></div><div>that's the question -- are these subtle and hard to find bugs we want to prevent?</div><div><br></div><div>-CHB</div><div><br></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>