-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 24.09.2013 15:45, schrieb Barry Warsaw:
> On Sep 23, 2013, at 09:57 PM, Andreas Röhler wrote:
> 
>> The OP wanted the Editor intends the second "print" to column 0.  IMO
>> it's possibly establishing an edit rule saying: if an empty line follows
>> a block, consider this block closed.
> 
> As Diez mentioned, an option defaulting to off would be interesting to
> play with.  I generally discourage using vertical whitespace inside
> methods, and mostly use it for structural separation, so I think this might
> be reasonable. It could only apply to actual blank lines, i.e. comments
> wouldn't trigger it.

+1.

>> def find(seq, target): for i, value in enumerate(seq): if value == tgt: 
>> break else: return -1 return i
> 
> Actually, that else gets lined up under 'if' right now.
> 
>> If an empty line after "break" is inserted:
>> 
>> def find(seq, target): for i, value in enumerate(seq): if value == tgt: 
>> break
>> 
>> else: return -1 return i
> 
> So I guess you're saying the blank line would add an extra dedent level?
> I hate to have people start to rely on this behavior to add non-structural 
> vertical whitespace.  If this feature is more helpful for top-level 
> structures, then it might be useful, otherwise I'm skeptical.  But as I
> say, it might be interesting to play with.

Yep.  I'd never write the above; in this specific instance for-else is uncommon
enough that you don't want to separate them even more :)

But also for more common multi-clause constructs like if-else or try-except I
would not normally combine dedent with an empty line; the dedent itself has
enough effect on the visual structuring IMO.

cheers,
Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iEYEARECAAYFAlJCflsACgkQN9GcIYhpnLDc9ACfUst8SFgoZx81gLpBl3fyOVzC
CfIAn21Z3wDymkL623m8mBMLIwb8Uvas
=n8yp
-----END PGP SIGNATURE-----
_______________________________________________
Python-mode mailing list
Python-mode@python.org
https://mail.python.org/mailman/listinfo/python-mode

Reply via email to