<br><br><div><span class="gmail_quote">On 4/10/07, <b class="gmail_sendername">Greg Ewing</b> &lt;<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Phillip J. Eby wrote:<br><br>&gt; The __subclasses__ method is useful -- even more so in 3.x than in 2.x,<br>&gt; because in 3.x there are no classic classes.<br><br>For security purposes, I think it would be better to<br>
adopt a principle that it shouldn&#39;t be possible to<br>do anything dangerous merely by instantiating a<br>class (e.g. open() opens files, but file() doesn&#39;t).<br>Then __subclasses__ would be harmless.</blockquote><div>
<br><br>True.&nbsp; As long as you don&#39;t use class attributes or have dangerous default arguments (and that is the kicker usually) then that policy is doable.<br><br>And I should clarify that the method does not need to disappear as it can move to an extension module somewhere.&nbsp;&nbsp; I just don&#39;t want it exposed right off of object and thus in the built-in namespace.
<br></div><br></div>-Brett