PEP 263状态检查 [英] PEP 263 status check

查看:192
本文介绍了PEP 263状态检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PEP 263在PEP索引中标记完成,但是

我没有在变更列表中看到指定的第2阶段

为2.4当时我期待它。


第2阶段被取消了,还是只是不在

更改文件中?


John Roth

解决方案

John Roth写道:

PEP 263标记在PEP索引中完成,但是
我没有在2.4的变化列表中看到指定的第2阶段,这是我预期的时间。

阶段2是否被取消,或者它是不是在
改变文件?




既不是,也不是。虽然这还没有被广泛讨论,但我个人认为现在还为时尚早,因为缺少

编码声明语法错误。我想

用Python 2.5重新考虑这个问题。


OTOH,没有多少人评论过:你愿意吗?如果一个脚本在一段时间内给你一个关于

缺少编码声明的警告会因为2.4中的

严格的SyntaxError而失败,那么b $ b会感到愤怒吗?大家已经纠正了他们的剧本吗?


问候,

马丁


" Martin v.L?wis"写道:

我个人认为现在还缺少
编码声明语法错误还为时尚早。我想




+1


让这个全面失败是非常残酷的,恕我直言。您可以更改

警告消息,以便更快地成为错误。但是如果因为其他好处而有人升级到2.4,并且他们依赖的某些大型第三方
代码(对于2.4而言完全没问题)会失败

我认为有必要推动人们进入正确的方向,但没有必要用一个10.000伏的棒来做b $ b。


Best,

f




" Martin v.L?wis" <毫安**** @ v.loewis.de>在消息中写道

news:41 ************** @ v.loewis.de ...

John Roth写道:< blockquote class =post_quotes> PEP 263在PEP索引中被标记为完成,但是我没有在2.4的变化列表中看到指定的第2阶段,这是我预期的时间。

阶段2是否被取消,或者是否只是在
变更文件中?
既不是,也不是。虽然这还没有得到广泛的讨论,但我个人认为现在还缺少
编码声明语法错误还为时尚早。我想用Python 2.5重新考虑这个问题。

OTOH,没有多少人评论过:如果给你的脚本,你会不会感到愤怒关于
缺少编码声明一段时间的警告因2.4中的严格SyntaxError而失败?每个人都已经纠正了他们的剧本吗?




好​​吧,我不是特别有这个问题,因为我没有

有大量的脚本,对于我做的那些将是

进行扫描和更新相对简单 - 或者只是运行它们

单元测试并看看它们是否破了!


实际上,我认为工具中的扫描和更新程序

目录可能是一个非常好的主意 - 只需走路通过一个
的Python库,扫描并更新所有没有b $ b bb声明的内容。


问题突然爆发进出我的意识一些

次,这次带来的是Hallvard的主题。


我的具体问题是如何代码处理UTF-8作为编码的

组合和8位字符串文字中的非ascii

字符。这是一个错误吗?

PEP并未这样说。如果不是,那么用什么编码将它从unicode转换回8位

编码?


另一个关心此项目的人的项目

主题:工具。在这些半数的编辑中,漂亮的打印机

等等,有多少检查编码

行并用它做正确的事情?需要更新哪些需要更新?


John Roth
问候,
Martin



PEP 263 is marked finished in the PEP index, however
I haven''t seen the specified Phase 2 in the list of changes
for 2.4 which is when I expected it.

Did phase 2 get cancelled, or is it just not in the
changes document?

John Roth

解决方案

John Roth wrote:

PEP 263 is marked finished in the PEP index, however
I haven''t seen the specified Phase 2 in the list of changes
for 2.4 which is when I expected it.

Did phase 2 get cancelled, or is it just not in the
changes document?



Neither, nor. Although this hasn''t been discussed widely,
I personally believe it is too early yet to make lack of
encoding declarations a syntax error. I''d like to
reconsider the issue with Python 2.5.

OTOH, not many people have commented either way: would you
be outraged if a script that has given you a warning about
missing encoding declarations for some time fails with a
strict SyntaxError in 2.4? Has everybody already corrected
their scripts?

Regards,
Martin


"Martin v. L?wis" wrote:

I personally believe it is too early yet to make lack of
encoding declarations a syntax error. I''d like to



+1

Making this an all-out failure is pretty brutal, IMHO. You could change the
warning message to be more stringent about it becoming soon an error. But if
someone upgrades to 2.4 because of other benefits, and some large third-party
code they rely on (and which is otherwise perfectly fine with 2.4) fails
catastrophically because of these warnings becoming errors, I suspect they
will be very unhappy.

I see the need to nudge people in the right direction, but there''s no need to
do it with a 10.000 Volt stick :)

Best,

f



"Martin v. L?wis" <ma****@v.loewis.de> wrote in message
news:41**************@v.loewis.de...

John Roth wrote:

PEP 263 is marked finished in the PEP index, however
I haven''t seen the specified Phase 2 in the list of changes
for 2.4 which is when I expected it.

Did phase 2 get cancelled, or is it just not in the
changes document?
Neither, nor. Although this hasn''t been discussed widely,
I personally believe it is too early yet to make lack of
encoding declarations a syntax error. I''d like to
reconsider the issue with Python 2.5.

OTOH, not many people have commented either way: would you
be outraged if a script that has given you a warning about
missing encoding declarations for some time fails with a
strict SyntaxError in 2.4? Has everybody already corrected
their scripts?



Well, I don''t particularly have that problem because I don''t
have a huge number of scripts and for the ones I do it would be
relatively simple to do a scan and update - or just run them
with the unit tests and see if they break!

In fact, I think that a scan and update program in the tools
directory might be a very good idea - just walk through a
Python library, scan and update everything that doesn''t
have a declaration.

The issue has popped in and out of my awareness a few
times, what brought it up this time was Hallvard''s thread.

My specific question there was how the code handles the
combination of UTF-8 as the encoding and a non-ascii
character in an 8-bit string literal. Is this an error? The
PEP does not say so. If it isn''t, what encoding will
it use to translate from unicode back to an 8-bit
encoding?

Another project for people who care about this
subject: tools. Of the half zillion editors, pretty printers
and so forth out there, how many check for the encoding
line and do the right thing with it? Which ones need to
be updated?

John Roth
Regards,
Martin



这篇关于PEP 263状态检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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