
summarizing: 1- the with statement should not be used for this 2- I overrated the code optimization of this change, optimization is not sufficiently large and nothing that can't be done without this syntax 3- picking a keyword would be non-trivial, 'using' has drawbacks, 'in' might be a candidate (frankly I like it) 4- the benefits of .dotted shorthand syntax are disputed, some think it's pythonic and readable, others don't think it is 5 - Pascal style has been discussed in the past and has its own faq explaining rejection. So anyway a dot would be needed, this would also take away possible ambiguity between locals and object properties About 4, the argument that full variable writing is more explicit, hence Pythonic: I think clinging to 20 same-indentation level references to 'obj.' is explicit to the point of sillyness. We also dont use locals.obj.x because the localness of a variable is also present without explicity so a bit of pragmatism could have a voice. People who think .dotted syntax is less readable could still use the familiar syntax. That would lead to two ways to do the same thing but on the same level as the type of decision as to whether to use a lambda or a full function. In the end implementation of this proposal would offer syntactical sugar without added functionality, especially given point 2 above. That would make the feature as desirable as the number of happy eyebrows when looking at code like this: in disussion: .arguments = [a, b, c] .argue() .summarize() x = .eastheticfactor .decision = .calculate(x) On 5/3/2016 4:50 AM, python-ideas-request@python.org wrote:

On Tue, May 3, 2016, at 12:21 AM, Robert van Geel wrote:
summarizing: 1- the with statement should not be used for this
with means something now. It shouldn't have two confusing meanings. All this discussion keeps using with when I hope that's a nonstarter. If people can get behind 'using' or 'in', I don't know, but 'with' should be absolutely out. With has a meaning in Python, a meaning which doesn't map readily into this space (where 'import x as y' and 'except Ex as y' do map readily, as its about renaming/aliasing)
4- the benefits of .dotted shorthand syntax are disputed, some think it's pythonic and readable, others don't think it is
To call it disputed undersells the claim. I'd call it horribly unreadable. A dot is just shy of invisible on its own, a leading dot evaporates besides the tabbed whitespace. No, no, no.
Again: no, no, no. Readability is more important then writability. "People who think .dotted syntax is less readable" need to be answered with a *serious* gain to override their objections. What does: using thing["this"]: .that = "okay" .other = "right" gain over t = thing["this"] t.that = "okay" t.other = "right" This feature is pure syntax sugar over local variables which are just fine as they are. -- Stephen Hansen m e @ i x o k a i . i o

Thanks Robert for a crisp summary of the most reasonable proposal and its ins and outs; I think the 'in' keyword and requiring leading dots are the best version of all versions considered. Thanks Stephen for concisely formulating the strongest argument against: it gains too little over the alternative using existing syntax, and in fact the alternative may be considered more readable (because more explicit). I would now like to close the discussion with a rejection. This email can be framed to celebrate that. --Guido On Tue, May 3, 2016 at 1:11 AM, Stephen Hansen <me+python@ixokai.io> wrote:
-- --Guido van Rossum (python.org/~guido)

On Tue, May 3, 2016, at 12:21 AM, Robert van Geel wrote:
summarizing: 1- the with statement should not be used for this
with means something now. It shouldn't have two confusing meanings. All this discussion keeps using with when I hope that's a nonstarter. If people can get behind 'using' or 'in', I don't know, but 'with' should be absolutely out. With has a meaning in Python, a meaning which doesn't map readily into this space (where 'import x as y' and 'except Ex as y' do map readily, as its about renaming/aliasing)
4- the benefits of .dotted shorthand syntax are disputed, some think it's pythonic and readable, others don't think it is
To call it disputed undersells the claim. I'd call it horribly unreadable. A dot is just shy of invisible on its own, a leading dot evaporates besides the tabbed whitespace. No, no, no.
Again: no, no, no. Readability is more important then writability. "People who think .dotted syntax is less readable" need to be answered with a *serious* gain to override their objections. What does: using thing["this"]: .that = "okay" .other = "right" gain over t = thing["this"] t.that = "okay" t.other = "right" This feature is pure syntax sugar over local variables which are just fine as they are. -- Stephen Hansen m e @ i x o k a i . i o

Thanks Robert for a crisp summary of the most reasonable proposal and its ins and outs; I think the 'in' keyword and requiring leading dots are the best version of all versions considered. Thanks Stephen for concisely formulating the strongest argument against: it gains too little over the alternative using existing syntax, and in fact the alternative may be considered more readable (because more explicit). I would now like to close the discussion with a rejection. This email can be framed to celebrate that. --Guido On Tue, May 3, 2016 at 1:11 AM, Stephen Hansen <me+python@ixokai.io> wrote:
-- --Guido van Rossum (python.org/~guido)
participants (3)
-
Guido van Rossum
-
Robert van Geel
-
Stephen Hansen