Tabs for indentation & Spaces for alignment in Python 3?
Ned Batchelder
ned at nedbatchelder.com
Fri Dec 5 22:34:02 EST 2014
On 12/5/14 10:04 PM, Michael Torrie wrote:
> On 12/05/2014 07:31 PM, Ned Batchelder wrote:
>> This is a perfect example! The code (with tabs as >--- and leading
>> spaces as .) is:
>>
>> >-------if (!list_empty(pending))
>> >------->-------ret = list_first_entry(pending, struct async_entry,
>> >------->------->------->-------.......domain_list)->cookie;
>>
>> Now, display it in your editor with tabs set to four spaces:
>>
>> >---if (!list_empty(pending))
>> >--->---ret = list_first_entry(pending, struct async_entry,
>> >--->--->--->---.......domain_list)->cookie;
>
> However, a conscientious programmer knows that tabs could be arbitrarily
> sized, so he would never do that.
The Linux kernel style guide makes clear: tabs are not arbitrarily
sized. In the Linux kernel, they are eight spaces.
--
Ned Batchelder, http://nedbatchelder.com
More information about the Python-list
mailing list