Docs - beyond tabs, spaces, PEPs...
To make-up to those people who frowned at the earlier OT-Comic post... There are changes in-the-wind, in the way Python should/could be documented. Currently, there is a difficulty in 'scaling' the documentation to cope with the growing range of language user-types, as well as keeping-up with new developments in the language, and providing documentation for different purposes. Possibilities for wider community involvement? https://pyfound.blogspot.com/2020/04/cpython-documentation-next-5-years.html -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list
Tabs/spaces for indentation (was Re: re.search when used within an if/else fails)
On Thu, Nov 29, 2012 at 8:39 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Perhaps it would be nice if Python honoured a directive setting indent style to spaces or indents, as it honours source code encoding lines: # -*- indent: mode -*- Where mode could be one of: space[s]Only accept spaces in indentation tab[s] Only accept tabs in indentation mixed Accept mixed tabs and spaces, but only if consistent with mixed the default for backward compatibility. I don't know that it needs to be a declaration like that; character encodings are critical to parsing the file, but newline-followed-by-tab and newline-followed-by-space are unambiguous. But it would be of value to have something like that, as editors could then be configured to respect it - set the editor to turn tab-key into N spaces but only if indent tab is not set, for instance. The question is, is it worth it? The main value would be when you're editing someone else's code. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces
Am 30.03.2012 14:47, schrieb Dave Angel: But since it doesn't do it on all messages, have you also confirmed that it does it for a text message? My experience seems to be that only the html messages are messed up that way. I can't find any HTML in what I posted, so HTML is not the problem. A difference could be the content type. I had in my posting: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Another one titled Pipelining in Python, where TB doesn't mess up the formatting, has: Content-Type: text/plain; charset=ISO-8859-1 Searching the web turned up [1], the gist is that format=flowed means that your mailer is allowed to move linebreaks and quotation signs ( ) as it wants. Which is not what I meant. Some more search turned up [2], which tells us how to disable this. Go to the settings, advanced section and find the button that fires up the raw configuration editor. There, locate the key mailnews.send_plaintext_flowed and change the according value to false. # Checking... if this.worked: hurray(I didn't even have to close the message in writing) Uli [1] http://joeclark.org/ffaq.html [2] http://www.firstpr.com.au/web-mail/Mozilla-mail/ -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces
On 4/2/2012 3:12 AM, Ulrich Eckhardt wrote: I can't find any HTML in what I posted, so HTML is not the problem. A difference could be the content type. I had in my posting: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Another one titled Pipelining in Python, where TB doesn't mess up the formatting, has: Content-Type: text/plain; charset=ISO-8859-1 Searching the web turned up [1], the gist is that format=flowed means that your mailer is allowed to move linebreaks and quotation signs ( ) as it wants. Which is not what I meant. Some more search turned up [2], which tells us how to disable this. Go to the settings, advanced section and find the button that fires up the raw configuration editor. There, locate the key mailnews.send_plaintext_flowed and change the according value to false. # Checking... if this.worked: hurray(I didn't even have to close the message in writing) Looks great! I never knew about that setting. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces
Am 29.03.2012 17:25, schrieb Terry Reedy: I am using Thunderbird, win64, as news client for gmane. The post looked fine as originally received. The indents only disappeared when I hit reply and the s were added. I can confirm this misbehaviour of Thunderbird (version 11.0 here), it strips the leading spaces when you begin a reply. Uli -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces
On 03/30/2012 03:05 AM, Ulrich Eckhardt wrote: Am 29.03.2012 17:25, schrieb Terry Reedy: I am using Thunderbird, win64, as news client for gmane. The post looked fine as originally received. The indents only disappeared when I hit reply and the s were added. I can confirm this misbehaviour of Thunderbird (version 11.0 here), it strips the leading spaces when you begin a reply. Uli But since it doesn't do it on all messages, have you also confirmed that it does it for a text message? My experience seems to be that only the html messages are messed up that way. of course, it could be lots of other things, like which gateways did the message go through, was it originally sent via the google-mars bridge, etc. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list
tabs/spaces (was: Re: unittest: assertRaises() with an instance instead of a type)
Am 28.03.2012 20:26, schrieb Terry Reedy: On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote: [...] # call testee and verify results try: ...call function here... except exception_type as e: if not exception is None: self.assertEqual(e, exception) Did you use tabs? They do not get preserved indefinitely, so they are bad for posting. I didn't consciously use tabs, actually I would rather avoid them. That said, my posting looks correctly indented in my sent folder and also in the copy received from my newsserver. What could also have an influence is line endings. I'm using Thunderbird on win32 here, acting as news client to comp.lang.python. Or maybe it's your software (or maybe some software in between) that fails to preserve formatting. *shrug* Uli -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces (was: Re: unittest: assertRaises() with an instance instead of a type)
In article 0ved49-hie@satorlaser.homedns.org, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: I didn't consciously use tabs, actually I would rather avoid them. That said, my posting looks correctly indented in my sent folder and also in the copy received from my newsserver. What could also have an influence is line endings. I'm using Thunderbird on win32 here, acting as news client to comp.lang.python. Or maybe it's your software (or maybe some software in between) that fails to preserve formatting. *shrug* Oh noes! The line eater bug is back! -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces
On 03/29/2012 03:18 AM, Ulrich Eckhardt wrote: Am 28.03.2012 20:26, schrieb Terry Reedy: On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote: [...] # call testee and verify results try: ...call function here... except exception_type as e: if not exception is None: self.assertEqual(e, exception) Did you use tabs? They do not get preserved indefinitely, so they are bad for posting. I didn't consciously use tabs, actually I would rather avoid them. That said, my posting looks correctly indented in my sent folder and also in the copy received from my newsserver. What could also have an influence is line endings. I'm using Thunderbird on win32 here, acting as news client to comp.lang.python. Or maybe it's your software (or maybe some software in between) that fails to preserve formatting. *shrug* Uli More likely, you failed to tell Thunderbird to send it as text. Html messages will read differently on html aware readers than on the standard text readers. They also take maybe triple the space and bandwidth. In thunderbird 3.1.19 In Edit-Preferences, Composition-general Configure Text Format Behavior - SendOptions In that dialog, under Text Format, choose Convert the message to plain text. Then in the tab called Plain text domains, add python.org -- DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: tabs/spaces
On 3/29/2012 3:18 AM, Ulrich Eckhardt wrote: Am 28.03.2012 20:26, schrieb Terry Reedy: On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote: [...] # call testee and verify results try: ...call function here... except exception_type as e: if not exception is None: self.assertEqual(e, exception) Did you use tabs? They do not get preserved indefinitely, so they are bad for posting. I didn't consciously use tabs, actually I would rather avoid them. That said, my posting looks correctly indented in my sent folder and also in the copy received from my newsserver. What could also have an influence is line endings. I'm using Thunderbird on win32 here, acting as news client to comp.lang.python. I am using Thunderbird, win64, as news client for gmane. The post looked fine as originally received. The indents only disappeared when I hit reply and the s were added. That does not happen, in general, for other messages. Unfortunately I cannot go back and read that message as received because the new version of Tbird is misbehaving and deleting read messages on close even though I asked to keep them 6 months. I will look immediately when I next see indents disappearing. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list