[Python-ideas] Custom Code Folding: Standardized Rules and Syntax?

2017-07-16 Thread Connor Farrell
Background: I work in scientific computing and use Community Pycharm IDE. I'm a religious follower of the 'readability counts' mantra, and two things I find myself doing often are: - Writing custom code folds to segregate code, from groups of classes in a file, to groups of lines in an individual

Re: [Python-ideas] Custom Code Folding: Standardized Rules and Syntax?

2017-07-16 Thread Steven D'Aprano
Hi Connor, and welcome! On Sun, Jul 16, 2017 at 10:37:26AM -0400, Connor Farrell wrote: > Background: I work in scientific computing and use Community Pycharm IDE. > > I'm a religious follower of the 'readability counts' mantra, and two things > I find myself doing often are: > - Writing custom c

Re: [Python-ideas] Python-ideas Digest, Vol 128, Issue 41

2017-07-16 Thread Connor Farrell
Thanks for your feedback, I guess I was a little unclear. In short, I was thinking of a pair of comment tokens (something like #<<, #>>, idk) that would indicate a code fold, like what virtually all IDEs do for classes and methods, but with more granularity. It would allow devs to better organize t

Re: [Python-ideas] Python-ideas Digest, Vol 128, Issue 41

2017-07-16 Thread David Mertz
Many editors allow you to explicitly select blocks to fold rather than only basing it on explicit syntax in a code file. Obviously, the information on where those folds occurred is them generally stopped somewhere apart from the text of the code itself. It sounds like you should choose an editor th

Re: [Python-ideas] Arguments to exceptions

2017-07-16 Thread Ken Kundert
Nick, I see. The Python C interface provides a very simple way of raising an exception in the case where the exception is only passed one argument, the error message. It even makes it easy to interpolate arguments into that error message. If it is important to include other arguments, as

Re: [Python-ideas] Arguments to exceptions

2017-07-16 Thread Jeff Walker
15.07.2017, 18:33, "Chris Angelico" : > On Sun, Jul 16, 2017 at 10:12 AM, Jeff Walker > wrote: >>  The first problem is that there is no direct access to the components that >> make up the error in some of the standard Python exceptions. >> >>  >>> foo >>  Traceback (most recent call la

[Python-ideas] Is this PEP viable?

2017-07-16 Thread Evan Adler
I would like to submit the following proposal. In the logging module, I would like handlers (like file handlers and stream handlers) to have a field for exc_info printing. This way, a call to logger.exception() will write the stack trace to the handlers with this flag set, and only print the messag

Re: [Python-ideas] Arguments to exceptions

2017-07-16 Thread Nick Coghlan
On 17 July 2017 at 04:59, Ken Kundert wrote: > Nick, > I see. The Python C interface provides a very simple way of raising an > exception in the case where the exception is only passed one argument, the > error > message. It even makes it easy to interpolate arguments into that error > messa