[Tutor] python equivalent of perl readlink()?
Kent Johnson
kent37 at tds.net
Mon Oct 16 20:22:56 CEST 2006
wesley chun wrote:
>>From what I understand, Python 3000 is going to break backwards
>> compatibility. However, I think I read that someone is writing a utility
>> that will translate your pre-Python 3000 code to Python 3000 code.
>
>
> this will mainly be side effects or for features that are deprecated
> (sufficient notice is being given for those on the hit list). as with
> most Python releases, they will try as best they can to keep old
> programs running. in other words, they're not "starting from
> scratch." your simple Python scripts that don't involve exotic
> constructs and calls should still work for the most part.
Although it is true that Python 3000 is not starting from scratch, I
think you are overstating the degree of backward compatibility that is
striven for. For example PEP 3000 says,
"Python 3000 will break backwards compatibility. There is no requirement
that Python 2.9 code will run unmodified on Python 3.0.
"I'm not sure whether it is reasonable to require that Python 2.x code
can be mechanically translated to equivalent Python 3.0 code; Python's
dynamic typing combined with the plans to change the semantics of
certain methods of dictionaries, for example, would make this task
really hard."
Some changes contemplated or already in place that affect code that I
wouldn't call exotic - they certainly will break much of my code:
- Remove dict.setdefault(), dict.has_key(), input(), raw_input()
- Replace print by a function
See the list for yourself in PEP 3100:
http://www.python.org/dev/peps/pep-3100/
There is also a PEP for things that definitely will not change:
http://www.python.org/dev/peps/pep-3099/
More information about the Tutor
mailing list