<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 14, 2015 at 4:41 PM, Robert Collins <span dir="ltr"><<a href="mailto:robertc@robertcollins.net" target="_blank">robertc@robertcollins.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> anyway) you now have three copies of the same lib (but maybe different<br>
> versions) all linked into your executable. Maybe there is no downside to<br>
> that (I haven't had a problem yet), but it seems like a bad way to do it!<br>
<br>
</span>If they are exchanging data structures, it will break at some point.<br>
Consider libpng; say that you have a handle to the native C struct for<br>
it in PIL, and you pass the wrapping Python object for it to<br>
Matplotlib but the struct changed between the version embedded in PIL<br>
and that in Matplotlib. Boom.<br>
<br>
If you communicate purely via Python objects that get remarshalled<br>
within each lib its safe (perhaps heavy on the footprint, but safe).<br></blockquote><div><br></div><div>As far as I know -- no one tries to pass, say, libpng structure pointers around between different python packages. You are right, that would be pretty insane! the best you can do is pass python buffer objects around so you are not copying data where you don't need to. </div><div><br></div><div>But maybe there is a use-case for passing a native lib data structure around, in which case, yes, you'd really want the lib versions to match -- yes! I suppose if I were to do this, I'd do a run-time check on the lib version number... not sure how else you could be safe in Python-land.</div><div><br></div><div>So maybe the only real downside is some wasted disk space an memory, which are pretty cheap thee days -- but I stil l don't like it ;-)</div><div><br></div><div>But the linker/run time/whatever can keep track of which version of a given function is called where?</div><div><br></div><div>-CHB</div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Rob<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Robert Collins <<a href="mailto:rbtcollins@hp.com">rbtcollins@hp.com</a>><br>
Distinguished Technologist<br>
HP Converged Cloud<br>
</font></span></blockquote></div><br><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>