<div class="gmail_quote">On 12 September 2012 02:14, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve+comp.lang.python@pearwood.info" target="_blank">steve+comp.lang.python@pearwood.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And again, Joshua's original post is not available from my provider.<br>
Joshua, I suspect that something about your post is being seen as spam<br>
and dropped by at least some providers.<br></blockquote><div><br></div><div>I am sorry to ask this, but in the meantime can someone who isn't spam-filtered repost my messages? I'll give them a cookie!</div><div>To repeat my previous post, I'm using GMail and posting to <a href="mailto:python-list@python.org">python-list@python.org</a>. If that is what I'm meant to be doing, I'll try another email address.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 12 Sep 2012 08:52:10 +1000, Chris Angelico wrote:<br>
<div class="im"><br>
> On Wed, Sep 12, 2012 at 8:48 AM, Joshua Landau<br>
> <<a href="mailto:joshua.landau.ws@gmail.com">joshua.landau.ws@gmail.com</a>> wrote:<br>
>><br>
>> Well, the problem is that a lot of collisions aren't predictable.<br>
>> "locals()['foo'] = 2", for example. If it weren't for Python's annoying<br>
>> flexibility*<br>
<br>
</div>I can't see your footnote there, so you may have already covered this,<br>
but for the record, what you call Python's "annoying flexibility" is<br>
fundamental to Python's programming model and done so for good reasons.<br>
The ability to shadow built-ins is, at times, incredibly useful rather<br>
than annoying.<br>
<br>
The world is full of bondage and domination languages that strongly<br>
restrict what you can do. Python doesn't need to be another one of them.<br>
Python's optimizing compiler, PyPy, is able to optimize code very well<br>
without such restrictions.</blockquote><div><br></div><div>I agree :P. The footnote should portray that I said that in jest.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
>> I would definitely do something very close to what you<br>
>> suggest. Remember that "locals()" isn't Python's only introspection<br>
>> tool. How about "from foo import *"?<br>
<br>
</div>I wouldn't call "import *" an introspection tool. At least, no more so<br>
than print.</blockquote><div><br></div><div>Yeah, I meant "things that can change the current scope without explicitly naming the changes". "print" doesn't do that, but you are correct in what you say.</div>
<div><br></div><div><snip></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> but I suppose globals() works the same way.<br>
><br>
> Inline functions? I like this idea. I tend to want them in pretty much<br>
> any language I write in.<br>
<br>
</div>What do you mean by in-line functions? If you mean what you literally<br>
say, I would answer that Python has that with lambda.<br>
<br>
But I guess you probably mean something more like macros.</blockquote></div><br><div>No, just multi-line lambda. Macros, if my knowledge of lower-level languages is valid, would be sorta' silly in Python.</div>