<html><head/><body><html><head></head><body>It does feel like Perl, but, what if there was a keyword after the symbol? It'd be more readable and not Perl-ish, but, it wouldn't confuse the parser(or at least I wouldn't think it would).<br><br><div class="gmail_quote">Antoine Pitrou <solipsis@pitrou.net> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif; margin-top: 0px">Le Sat, 3 Aug 2013 01:46:37 +1000,<br />Nick Coghlan <ncoghlan@gmail.com> a<br />écrit :<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">In this context, you usually have one or<br />two callbacks (two in Twisted-style programming: one for success,<br />one for failure), passed positionally to a consuming function:<br /><br />loop.create_connection((host, port), @cb, @eb) where:<br />def cb(sock):<br /># Do something with socket<br />def eb(exc):<br />logging.exception(<br />"Failed connecting to %s:%s", host, port)</blockquote><br />We can't use 'where' because we know it conflicts with the SQL sense<br />of the term in too many APIs. We're reasonably sure we can get away<br />with
"given" without too much conflict, though.</blockquote><br />How about reusing "with"? There's no ambiguity with context managers<br />since the syntactic context is different.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Using "@" as the marker character is also problematic, since the<br />following degenerate case will probably confuse the parser (due to it<br />looking too much like a decorator clause):<br /><br />@something() given:<br />...</blockquote><br />No, that would simply be forbidden. In this proposal, "@" can only mark<br />names of parameters in function calls. We already reuse "*" and "**"<br />for a specific meaning in front of function call parameters, so there's<br />a precedent for such polysemy.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">I liked the notion of "?" as suggesting doubt and
uncertainty - an<br />element of "leave this undefined for now, we'll fill it in later".</blockquote><br />I don't really like it :-) "?" has other meanings traditionally: as part<br />of the ternary operator in C-like languages (many of them), as a<br />wildcard character in pattern matching languages, as a marker of<br />optional matchers in regular expressions.<br /><br />Also, I really don't like the idea that "?" represents a full-blown<br />object with attribute access capabilities and whatnot. It smells too<br />much like Perl-style (Ruby-style?) magic variables. My proposal is more<br />limited: it's a syntactic addition, but it doesn't create new runtime<br />objects or types.<br /><br />Regards<br /><br />Antoine.<br /><br /><br /><hr /><br />Python-ideas mailing list<br />Python-ideas@python.org<br /><a href="http://mail.python.org/mailman/listinfo/python-ideas">http://mail.python.org/mailman/listinfo/python-ideas</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html></body></html>