Tabnanny真有用吗? [英] Tabnanny really useful?

查看:98
本文介绍了Tabnanny真有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了一下tabnanny来查看

a python源文件。


但是我没找到任何东西,tabnanny

能够通过编译命令找到无法找到的东西




或者我错过了什么?
< br $>
最好的问候,

-

Franz Steinhaeusler

解决方案



" Franz Steinhaeusler" < FR ***************** @ utanet.at>在消息中写道

news:en ******************************** @ 4ax.com ...

我看了一下tabnanny来检查一个python源文件。

但我没找到任何东西,tabnanny
能够通过编译命令找到无法找到的东西。

或者我错过了什么?


Tabnanny旨在检查缩进

是否有混合标签和空格。具有混合选项卡的文件

和空格_can_编译就好了如果编辑器生成它们的b $ b与编译器一致同意

那些空格的数量一个标签占据。


另一方面,这样的文件很可能会被搞砸几乎无法修复如果有人尝试

在编辑器中编辑它们以不同方式处理标签

来自生成它的那个。


坚持一个或另一个的文件总是

可以正确编辑和编译。 python

建议使用空格,但不是

每个人都同意这个。


大多数现代的Python感知编辑器处理

情况合理,虽然你可能有

来设置参数。


John Roth
最好的问候,
-
Franz Steinhaeusler




2004年12月20日星期一13:00:39 -0600," John Roth

< ne ******** @ jhrothjr.com>写道:

Tabnanny旨在检查缩进
是否混合了制表符和空格。带有混合标签的文件
和空格_can_编译就好了如果生成它们的编辑器同意编译器关于标签占用空间的数量。




感谢您的解释。


我试过找到:

def a():

- >打印

- > .print


其中point是空格。


tabnanny here抱怨和python编译得很好。

-

Franz Steinhaeusler


Franz Steinhaeusler写道:

感谢您的解释。

我尝试了一个找到的:
def a():
- > print
- > ; .print

其中point是一个空格。

tabnanny在这里抱怨并且python编译得很好。




真的吗?这是一个语法错误(你不能改变缩进nillywilly

在一个块内),而我正在使用的Python肯定会将此标记为错误:


Hi, I looked at tabnanny to check
a python source file.

But I didn''t find anything, tabnanny
is able to find, what couldn''t be found
by compile command.

Or have I missed something?

best regards,
--
Franz Steinhaeusler

解决方案


"Franz Steinhaeusler" <fr*****************@utanet.at> wrote in message
news:en********************************@4ax.com...

Hi, I looked at tabnanny to check
a python source file.

But I didn''t find anything, tabnanny
is able to find, what couldn''t be found
by compile command.

Or have I missed something?
Tabnanny is intended to check whether indentation
has mixed tabs and spaces. Files with mixed tabs
and spaces _can_ compile just fine if the editor
that produced them agrees with the compiler about
the number of spaces that a tab occupies.

On the other hand, such files are quite likely to
be messed up almost beyond repair if one tries
to edit them in an editor that treats tabs differently
from the one that produced it.

Files that stick to one or the other can always
be edited and compiled properly. The python
recommendation is to use spaces, but not
everyone agrees with this.

Most modern Python-aware editors handle
the situation reasonably, although you may have
to set parameters.

John Roth
best regards,
--
Franz Steinhaeusler




On Mon, 20 Dec 2004 13:00:39 -0600, "John Roth"
<ne********@jhrothjr.com> wrote:

Tabnanny is intended to check whether indentation
has mixed tabs and spaces. Files with mixed tabs
and spaces _can_ compile just fine if the editor
that produced them agrees with the compiler about
the number of spaces that a tab occupies.



Thanks for your explanation.

I tried an found:
def a():
->print
->.print

where point is a space.

tabnanny here complains and python compile it just fine.
--
Franz Steinhaeusler


Franz Steinhaeusler wrote:

Thanks for your explanation.

I tried an found:
def a():
->print
->.print

where point is a space.

tabnanny here complains and python compile it just fine.



really? that''s a syntax error (you cannot change indentation nillywilly
inside a block), and the Python I''m using surely flags this as an error:


这篇关于Tabnanny真有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆