A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20141129/99f55919/attachment.html below:

<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">What if we'd have metaclass semantics on module creation?<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Eg, suppose the default:<br>  <br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">  __metaclass__ = ModuleType<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">What if Python would support __prepare__ for modules?<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><span style="font-family:trebuchet ms,sans-serif"><span style="color:rgb(51,51,51)"><br><font><span style="color:rgb(51,51,51)">Thanks,</span><br><span style="color:rgb(153,153,153)">-- Ionel</span></font></span><font><font style="color:rgb(153,153,153)"> M.</font></font><br></span></div></div></div>
<br><div class="gmail_quote">On Sat, Nov 29, 2014 at 11:36 PM, Greg Ewing <span dir="ltr"><<a href="mailto:greg.ewing@canterbury.ac.nz" target="_blank">greg.ewing@canterbury.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Guido van Rossum wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are these really all our options? All of them sound like hacks, none of them sound like anything the language (or even the CPython implementation) should sanction.<br>
</blockquote>
<br></span>
If assignment to the __class__ of a module were permitted<br>
(by whatever means) then you could put this in a module:<br>
<br>
  Â class __class__(types.ModuleType):<br>
  Â  Â  ...<br>
<br>
which makes it look almost like a deliberate language<br>
feature. :-)<br>
<br>
Seriously, of the options presented, I think that allowing<br>
__class__ assignment is the most elegant, since it solves<br>
a lot of problems in one go without introducing any new<br>
features -- just removing a restriction that prevents an<br>
existing language mechanism from working in this case.<br>
<br>
-- <br>
Greg<span class=""><br>
______________________________<u></u>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-dev</a><br></span>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/contact%40ionelmc.ro" target="_blank">https://mail.python.org/<u></u>mailman/options/python-dev/<u></u>contact%40ionelmc.ro</a><br>
</blockquote></div><br></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4