Announcement

Collapse
No announcement yet.

Python 3 Is Close To Becoming The Default In Fedora 22

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by carewolf View Post
    Cool then. I assumed that is what "default" meant. AFAIK Arch did change /usr/bin/python to python3 recently, I have run into several issues with that reported by other developers.
    http://legacy.python.org/dev/peps/pep-0394/ was written in part to address that question because Arch did something no other distribution would really do. Fedora was involved in this PEP and follows it.

    Comment


    • #32
      RE: PEP-0394, Gentoo did this too. The python version that /usr/bin/python points to is user configurable, but defaults to python3 since early 2012.

      There was a small amount of fallout, but thanks to users' ability to select python 3 as the default, the most serious issues had already been reported and addressed at that point.

      Comment


      • #33
        Originally posted by Cyber Killer View Post
        The whole problem with python3 adoption is the libs. A very high amount of libs still have not moved to py3, and are keeping the world on py2, make dev write apps for py2, write more libs for py2 etc...
        And the fact that python3 got worse, especially when used interactively. In python2 you have a nice distinction for instance between "map" and "imap", in python3 you need to write "list(map(fn,lst))" to see the result on the prompt or get a list.

        I can see no reason to switch to Python3. Can you? (besides "it's new").

        If Python2 is no longer developed, maybe a fork is justified.
        Last edited by Togga; 22 January 2015, 07:35 PM.

        Comment


        • #34
          Originally posted by Togga View Post
          And the fact that python3 got worse, especially when used interactively. In python2 you have a nice distinction for instance between "map" and "imap", in python3 you need to write "list(map(fn,lst))" to see the result on the prompt or get a list.

          I can see no reason to switch to Python3. Can you? (besides "it's new").

          If Python2 is no longer developed, maybe a fork is justified.
          Python2 the language hasn't been developed for a very long time and standard library is in maintenance mode for CPython. I recommend looking at PyPy for the future of Python2

          Comment


          • #35
            Originally posted by Togga View Post
            I can see no reason to switch to Python3. Can you? (besides "it's new").
            Of course I do:
            - utf8 - finally, maybe in the English speaking world this isn't a big deal, but in every eastern European country, that has it's own special characters in the alphabet, this is a killer feature - getting py2 to correctly support non-western characters is a major headache
            - more functions instead of statements (with print being the biggest deal) make the syntax a lot more clear to anybody coming from other languages

            note: I generally write in whichever language gets me what I want in the easiest and fastest way, so I'm not a python fan any more than I'm a fan of bash, php, ruby, lua, etc... but I find py3 a lot more convenient than py2, for my use when I want to write something in python

            Comment


            • #36
              Originally posted by phoronix View Post
              Phoronix: Python 3 Is Close To Becoming The Default In Fedora 22

              For Python stakeholders using Fedora, the Fedora 22 release is preparing to ship Python 3 as the one and only Python implementation on the installation media...

              http://www.phoronix.com/scan.php?pag...ython-3-Status

              Thanks for writing a nice article. Please note that as I've written in the sum-up mail, we most likely won't achieve completely Python2-free LiveCD, just mostly. Might be worth mentioning in the article, since it seems to suggest otherwise

              Comment


              • #37
                Originally posted by Cyber Killer View Post
                Of course I do:
                - utf8 - finally, maybe in the English speaking world this isn't a big deal, but in every eastern European country, that has it's own special characters in the alphabet, this is a killer feature - getting py2 to correctly support non-western characters is a major headache
                - more functions instead of statements (with print being the biggest deal) make the syntax a lot more clear to anybody coming from other languages

                note: I generally write in whichever language gets me what I want in the easiest and fastest way, so I'm not a python fan any more than I'm a fan of bash, php, ruby, lua, etc... but I find py3 a lot more convenient than py2, for my use when I want to write something in python
                Python2 supports utf-8 just fine. Bigger issue is eg Windows still doesn't use it pretty much anywhere. Print function is available in Python2 with a future import.
                Last edited by nanonyme; 23 January 2015, 04:37 AM.

                Comment


                • #38
                  Originally posted by nanonyme View Post
                  Python2 supports utf-8 just fine.
                  I've been working as a software tester on a couple of py2 based projects, they were webapps using django, twisted, etc... a typical testcase was: input japanese characters into a textfield, submit the form, so it gets saved into the db... and watch as the whole thing falls apart, when the devs fix this particular form, repeat with the next one cause it's going to be broken in the same way.

                  Even in python shell scripts it's more or less ok with utf8 on Linux if you write the needed charset header in the file and you can use nonwestern chars, but as soon as you try it on windows, it breaks.

                  From my experience py2 and unicode don't mix. Period.

                  Comment


                  • #39
                    Originally posted by Cyber Killer View Post
                    I've been working as a software tester on a couple of py2 based projects, they were webapps using django, twisted, etc... a typical testcase was: input japanese characters into a textfield, submit the form, so it gets saved into the db... and watch as the whole thing falls apart, when the devs fix this particular form, repeat with the next one cause it's going to be broken in the same way.

                    Even in python shell scripts it's more or less ok with utf8 on Linux if you write the needed charset header in the file and you can use nonwestern chars, but as soon as you try it on windows, it breaks.

                    From my experience py2 and unicode don't mix. Period.
                    No, the problem is that Windows and utf-8 don't mix. The literally only options there are utf-16 (ish) and 8-bit locale-specific encodings. Python3 just tries to hide this reality from you slightly better

                    Comment


                    • #40
                      Originally posted by Togga View Post
                      And the fact that python3 got worse, especially when used interactively. In python2 you have a nice distinction for instance between "map" and "imap", in python3 you need to write "list(map(fn,lst))" to see the result on the prompt or get a list.
                      Or you could just use list comprehensions.

                      Originally posted by Togga View Post
                      I can see no reason to switch to Python3. Can you? (besides "it's new").
                      Just things I have encountered:
                      1. Division is handled sanely without having to import from __future__
                      2. No more long vs. int
                      3. keyword-only arguments
                      4. a, b, *c = (1, 2, 3, 4, 5) (this may be even more flexible in 3.5)
                      5. Ranges are lazy (but still indexable), saving memory
                      6. Dict methods use views, saving memory
                      7. super() works
                      8. __pycache__ and supporting multiple python version .pyc files and .so files
                      9. yield from
                      10. 0100 != 64
                      11. statistics module
                      12. Pool, popen, and assertRaises context managers
                      13. pool.startmap
                      14. unittest.assertWarns and unittest.assertCountEqual
                      15. high-performance decimals


                      Stuff coming in 3.5:
                      1. math.nan and math.inf
                      2. type annotations

                      Comment

                      Working...
                      X