<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">I think we've drifted into a new topic, but...</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> I was astonished to see them<br>
implemented using decorators, and I was not the only one.</blockquote><div><br></div><div>...</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Python is at a weird point here. At about every new release of Python,<br>
a new idea shows up that could be easily solved using metaclasses, yet<br>
every time we hesitate to use them, because of said necessary manual<br>
intervention for metaclass combination.<br>
<br>
So I think we have two options now: We could deprecate metaclasses,<br>
</blockquote><div><br></div><div>I was thinking about this last spring, when I tried to cram all sorts of python metaprogramming into one 3hr class...</div><div><br></div><div>Trying to come up with a an exam[ple for metclasses, I couldn't come up with anything that couldn't be done more claerly (to me) with a class decorator. </div><div><br></div><div>I also found some commentary on the web (sorry, no links :-( ) indicating that metacalsses were added before class decorators, and that they really don't have a compelling use case any more.</div><div><br></div><div>Now it seem that not only do they not have a compelling use case, in some (many) instances, there are compelling reasons to NOT use them, and rather use decorators.</div><div><br></div><div>So why deprecate them? or at least discourage their use?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The other option would be to simply make metaclasses work properly. We<br>
would just have to define a way to automatically combine metaclasses.<br></blockquote><div><br></div><div>"just"?</div><div><br></div><div>Anyway, let's say that is doable -- would you then be able to do something with metaclasses that you could not do with decorators? or it in a cleaner, easier to write or understand way?</div><div><br></div><div>There-should-be-one--and-preferably-only-one--obvious-way-to-do-it-ly yours,<br></div><div><br></div><div>-Chris</div></div><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>