Python Forum
i am moving on to just python3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i am moving on to just python3
#1
the reason i have decided to go ahead and abandon Python2 before its EOL and move on to just Python3 is because Python2 does not support using * for arguments in a function def statement followed by named options spelled out explicitly. that is:
lt1/forums /home/forums 2> py2
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def myfunction(*myargs,myopt1=None):
  File "<stdin>", line 1
    def myfunction(*myargs,myopt1=None):
                                ^
SyntaxError: invalid syntax
>>> 
lt1/forums /home/forums 3> py3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def myfunction(*myargs,myopt1=None):
...     return
... 
>>> 
lt1/forums /home/forums 4>
that plus better handling (still not perfect) of bytes and Unicode.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
so.... many other reasons
Reply
#3
but no others have made it difficult to make code work in both versions. my original plan was to stop makings things for both versions until Python2's EOL. but i finally had cases where doing def the way shown in my example. i only had 2such cases. and i pondered over then last night and today. then i decided to my schedule up so i could stick with the cleaner form. i could have made things work for both, and even wrote some code for it. but i decided the code ugliness was not worth it.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
the rewrite of python 3 was extremely well planned, and the resulting product shines because of that.
The conversion from one to the other is not so painful, the rewards are great.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020