Python 2.6.5 (release26-maint, May 23 2010, 14:21:41) 
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'ыфвафыаып'
'\xd1\x8b\xd1\x84\xd0\xb2\xd0\xb0\xd1\x84\xd1\x8b\xd0\xb0\xd1\x8b\xd0\xbf'

Python 3.1.2 (release31-maint, Jun 29 2010, 17:54:11) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'ыфвафыаып'
'ыфвафыаып'

published on 2010-06-30 19:31:06
tags:  python

Python 2.6.5 (r265:79063, Apr 1 2010, 05:28:39)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: u'ыфвафыаып'
Out[1]: u'\xd1\x8b\xd1\x84\xd0\xb2\xd0\xb0\xd1\x84\xd1\x8b\xd0\xb0\xd1\x8b\xd0\xbf'

Лол
2010-07-01 19:09:48

Да, и почему - "б"?
Вот мы, например, сегодня пришли к решению, что пора переходить.

Шемсу
2010-07-01 19:16:08

Вернее, приняли вывод.

Шемсу
2010-07-01 21:35:24

Надо вначале понять, что при переходе отломается.... У меня с 2.4 на 2.5, а потом с 2.5 на 2.6 головняка хватало, а тут сразу тройка... Перейти я не против, очень даже за. Даже хотя бы из-за юникода. А то, глядишь, там и JIT подоспееет, совсем хорошо будет.

Elf
2010-07-01 21:37:53

А JIT разве в третью ветку только собираются мержить?
Кстати, с 2.6 вполне можно переходить, это специальная версия языка, которая предназначалась для того, чтобы подготовить к переходу на 3.
Запускаешь 2to3, потом подчищаешь всякие ньюансы, и вроде рабоатет. Но это, правда, только теоретически :)
В общем, если таки перейдем - может напишу, как было.

Shemsu
2010-07-01 22:25:08

Про JIT для 2.х не слышал вообще ничего.

Для перехода предназначалась 2.7, кажись. И то там специальный ключ был для совместимости с 3.х.

Elf
2010-07-01 22:27:14

Porting To Python 3.0

For porting existing Python 2.5 or 2.6 source code to Python 3.0, the best strategy is the following:

0. (Prerequisite:) Start with excellent test coverage.
1. Port to Python 2.6. This should be no more work than the average port from Python 2.x to Python 2.(x+1). Make sure all your tests pass.
2. (Still using 2.6:) Turn on the -3 command line switch. This enables warnings about features that will be removed (or change) in 3.0. Run your test suite again, and fix code that you get warnings about until there are no warnings left, and all your tests still pass.
3. Run the 2to3 source-to-source translator over your source code tree. (See 2to3 - Automated Python 2 to 3 code translation for more on this tool.) Run the result of the translation under Python 3.0. Manually fix up any remaining issues, fixing problems until all tests pass again.

Shemsu
2010-07-06 12:13:41

Ок, убедил. Как джангу спортируют, свисти :)

Elf
2010-07-06 12:14:39
Feel free to comment
*
*