<div dir="ltr"><span style="color:rgb(33,33,33);font-size:13px">The latter, the former isn't currently syntax (as in `with [a, b, c]"` will throw an error). This was, however, mainly if we were using a variant of the with syntax, since having </span><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px"> But take the following example:</div><div style="color:rgb(33,33,33);font-size:13px">    </div><div style="color:rgb(33,33,33);font-size:13px">    def func(ctx):</div><div style="color:rgb(33,33,33);font-size:13px">        with ns:  # namespace</div><div style="color:rgb(33,33,33);font-size:13px">            with ctx:  # only known at runtime</div><div style="color:rgb(33,33,33);font-size:13px">                 .attr</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">You can't have that be a compile time error. Which actually makes the specific syntax of a bare `with` a strong -1 now, since mixing it with normal context managers is incredibly ambiguous. This would either need to be `in` or `given` as mentioned elsewhere, or something like with `Magic_Namespace_Object(ns):`</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">--Josh</div><br><div class="gmail_quote"><div dir="ltr">On Mon, May 2, 2016 at 7:26 PM Erik <<a href="mailto:python@lucidity.plus.com">python@lucidity.plus.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 02/05/16 23:28, Joshua Morton wrote:<br>
>  > It is not reasonable to expect an error to be generated at runtime:<br>
>  > because each and every object would have to be queried as to whether<br>
>  > they have the attribute to know if there is ambiguity on each and every<br>
>  > reference to an attribute.<br>
><br>
> It absolutely is:<br>
<br>
It almost certainly is not ;)<br>
<br>
> if you're using an "inferred" syntax like<br>
><br>
> in object:<br>
>      .value<br>
><br>
> but there are multiple such objects to look at, Python immediately<br>
> throws an error,<br>
<br>
It is not clear what you mean by "multiple such objects". Do you mean<br>
that 'object' can be some sort of sequence, or do you mean that the<br>
syntax used for multiple objects is "in object0, object1:" or similar?<br>
<br>
If the latter, then given the choice between the two, I would agree with<br>
some sort of compile time error over a runtime exception. Why wait until<br>
runtime?<br>
<br>
If the former (which might mean a runtime error is appropriate), then<br>
you need to explain what you are suggesting in a lot more detail.<br>
<br>
Regards, E.<br>
</blockquote></div></div>