29410Re: % matching for Python
- Aug 6, 2002On Tuesday, August 06, 2002 10:56 AM,
David Brown <vim@...> about the unbearable subtleness of being wrote:
>The conflict you point out is a consequence of making shiftwidth different
> That's why the PEP8 specifies to use spaces instead of tabs. However,
> Python was designed to accept tabs as equivalent to spaces, but
> _ALWAYS_ with a tabstop set to 8. It is the setting of the tabstop
> to a value of other than 8 (common for non *nix editors) that can
> bite. Even with the tabstop set wrong, often you get lucky and
> things just work, especially if indenting is only done with tabs.
> My main reaction was to the suggestion to set the tabstop to 4 for
> python code. This is going to bite someone someday. The default for
> python, according to PEP8 should be
to tabstop, now, that, is asking for real trouble. :)
because it works and is portable at the same time. That is, it works fine
with new files and with files that are properly indented, that is, where the
creator has either used spaces (and one can therefore figure out his/her
perverted idea of how many spaces is an indent and adjust accordingly) or
uses one tab per indention level *and* no space-tabs mixing for indention.
As well, if one chooses to forgo the expandtab setting and use tabs instead
of spaces, the file is still readable under a text editor that only manages
8 space tabstops (because most of those can't change shiftwidth neither);
and the python bytecode compiler will do the right thing as well.
- << Previous post in topic Next post in topic >>