Re: Python 3.1 support
От | Peter Eisentraut |
---|---|
Тема | Re: Python 3.1 support |
Дата | |
Msg-id | 1260487161.716.29.camel@vanquo.pezone.net обсуждение исходный текст |
Ответ на | Re: Python 3.1 support (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Python 3.1 support
Re: Python 3.1 support Re: Python 3.1 support Re: Python 3.1 support |
Список | pgsql-hackers |
On tor, 2009-11-12 at 16:06 -0500, Tom Lane wrote: > There was considerable debate earlier about whether we wanted to treat > Python 3 as a separate PL so it could be available in parallel with > plpython 2, because of the user-level coding incompatibilities. It > looks like this patch simply ignores that problem. What is going to > happen to plpython functions that depend on 2.x behavior? I have a proposal for how to handle this, and a prototype patch attached. This follows essentially what the CPython distribution itself does, which will make this tolerably easy to follow for users. We install plpython as plpython2.so or plpython3.so, depending on the version used to build it. Then, plpython.so is a symlink to plpython2.so. We then create three language definition templates: plpythonu -> plpython.so plpython2u -> plpython2.so plpython3u -> plpython3.so In the far future we flip the default symlink to plpython3.so, maybe in about 5 years when Python 2.x expires. This gives the users the following options and scenarios: - Existing users don't have to do anything, until maybe in five years they will notice that their OS doesn't ship Python 2 anymore and they will have to act anyway. In practice, by then they might have adjusted their coding style to Python 2.6/2.7 norms and their functions will migrate to 3.x without change. - Users who know that they have heavily Python 2.x dependent code and don't want to ever change it can make use of the plpython2u language name, just like they should probably change their scripts to use something like #!/usr/bin/python2. - Users who want to dive into Python 3 can use the plpython3u language name, which will basically keep working forever by today's standards. Those users would probably also use #!/usr/bin/python3 or the like in their scripts. In the far future they might like to remove the "3". - Daredevils can change symlink manually and make plpython3.so the default plpythonu implementation. Those people would probably also make /usr/bin/python be version 3. Comments?
Вложения
В списке pgsql-hackers по дате отправления: