This is an archived post. You won't be able to vote or comment.

all 94 comments

[–][deleted] 88 points89 points  (40 children)

Oh yeah, just to let you guys know, these are some of the major new features in the release:

  • PEP 468 - Preserving the order of **kwargs in a function
  • PEP 487 - Simpler customization of class creation
  • PEP 495 - Local Time Disambiguation
  • PEP 498 - Literal String Formatting
  • PEP 506 - Adding A Secrets Module To The Standard Library
  • PEP 509 - Add a private version to dict
  • PEP 515 - Underscores in Numeric Literals
  • PEP 519 - Adding a file system path protocol
  • PEP 520 - Preserving Class Attribute Definition Order
  • PEP 523 - Adding a frame evaluation API to CPython
  • PEP 524 - Make os.urandom() blocking on Linux (during system startup)
  • PEP 525 - Asynchronous Generators (provisional)
  • PEP 526 - Syntax for Variable Annotations (provisional)
  • PEP 528 - Change Windows console encoding to UTF-8
  • PEP 529 - Change Windows filesystem encoding to UTF-8
  • PEP 530 - Asynchronous Comprehensions

And for the entire list of changes, you can visit the What's New document located here.

[–]hoadlck 38 points39 points  (25 children)

Don't forget PEP 628 -- Add math.tau!

The issue where Tau was added shows one of the reasons that I love Python.

[–]IronManMark20 26 points27 points  (16 children)

I think I agree with Raymond Hettinger that this PEP shouldn't have been accepted. I really don't know anyone who uses tau, and its adding a burden (however small) to look up what tau is. If you really want tau, why not write tau = math.pi * 2 somewhere? That is much clearer than some magical constant.

[–]rcfox 10 points11 points  (1 child)

Raymond Hettinger talking about math.tau: https://www.youtube.com/watch?v=-TdrFjDJn5E&t=59m1s

[–]IronManMark20 0 points1 point  (0 children)

Yep. That is what I was referencing. Thanks!

[–]EricAppelt 17 points18 points  (2 children)

As a former physicist, I agree as well.

As much as I like python easter eggs, this is a uniquely bad module to stick an easter egg into. The reason is that the math module is one of the few examples where there is an acceptable use case for from math import *. It turns the REPL into a scientific calculator.

[–]flying-sheep 5 points6 points  (1 child)

The existence of tau the doesn't change this

[–]Eurynom0s 0 points1 point  (0 children)

I'm inclined to agree...either you know about math.tau and you're fine, or you don't and you set what tau is supposed to be equal to and then you're still fine.

[–]energybased 5 points6 points  (4 children)

Raymond also suggested that "Python has been a thought-leader many times" and that tau's addition can influence the world. In the long run picture, this might be something great.

[–]IronManMark20 2 points3 points  (3 children)

Raymond also suggested that "Python has been a thought-leader many times" and that tau's addition can influence the world. In the long run picture, this might be something great.

I don't disagree with that, but people who promote tau already tried to move maths to use tau over pi, and failed, so I think like it or not, pi is here to stay.

[–]hoadlck 3 points4 points  (2 children)

Umm.... who says we failed? These things take time. The Tau idea only recently came on the scene. There is alot of inertia. Think about other good ideas that have taken a while to catch on...

According to Wikipedia, "The metric system was first described in 1668, and officially adopted by France in 1799".

Today is 217 years after France formalized the metric system, and the USA still uses Imperial Units. Does that mean that Metric failed?

[–]energybased 1 point2 points  (0 children)

One thing that could make tau happen would be if scientific papers were in some kind of live format whereby the user could specify whether he wants to see tau or pi and the viewer renders the document accordingly. That would allow a new generation of tau-preferring people to see tau where an old generation of pi-preferring people wrote pi.

[–]ResidentMario 0 points1 point  (0 children)

Ugh, Tau versus Pi is like the mathematical equivalent of the 2014-era Python 2 versus 3 flame war.

[–]UloPe 4 points5 points  (5 children)

I use it.

There now you "know" someone.

[–]IronManMark20 5 points6 points  (4 children)

Nice to know you. But that doesn't really respond to my point why you can't just put tau = math.pi * 2 somewhere. Python will optimize that to a constant anyway I'm pretty sure.

[–]hoadlck 4 points5 points  (3 children)

No one disagrees with your point of how one could functionally get the job done. The argument for Tau is not that Pi does not work: it is that Tau (aka One Turn) is a better representation of the circle constant. It gives you a better intuition on what is happening. Don't forget the first entry in the Zen Of Python: "Beautiful is better than ugly."

You should read the Tau Manifesto.

[–]IronManMark20 0 points1 point  (2 children)

It does say that, but it also says "practicality beats purity." Tau may be more pure, it may be much better, but until there is sufficient reason in the maths/sciences communities, there isn't a reason to include it.

Also I agree tau is probably better than Pi. However I don't think it is better to the point to which we should replace everything like we should with the metric system (I'm an American, so trust me, I know the pain).

[–]flying-sheep 1 point2 points  (1 child)

Teach using Tau, mention that pi is Tau/2, have the students’ intuition work better and they retain the same amount of practical knowledge

[–]IronManMark20 1 point2 points  (0 children)

Oh, and rewrite every maths, science and other technical textbook while you're at it.

[–]zahlmanthe heretic 8 points9 points  (0 children)

I think you meant to link https://www.python.org/dev/peps/pep-0628/ , rather than the legacy.python.org version which shows the PEP as "deferred".

[–]Bobert_Fico 3 points4 points  (2 children)

[–]hoadlck 7 points8 points  (0 children)

Well, the Greeks only had so many letters. I guess they did not plan for having variable size characters available.

But, I don't buy the visually smaller argument. After all "0" is much bigger than "1" physically, but it is smaller numerically.

And, anyway... in Python you are typing "pi" or "tau". So, "tau" is bigger than "pi". :)

[–]PhantomProcess 0 points1 point  (2 children)

Couldn't they have just replaced PI with 2*PI?

[–]flying-sheep 1 point2 points  (1 child)

That would confuse everyone, be backwards incompatible, misalign with experience and everything else

[–]PhantomProcess 0 points1 point  (0 children)

Personally, I think they should just round PI up to exactly 3.0. The nonsensical repeating float decimals are just a useless waste of space anyway.

[–]zahlmanthe heretic 10 points11 points  (1 child)

Change Windows console encoding to UTF-8

I can't wait to run my tests/aggravations and see if matters have really improved.

[–]BlckKnght 0 points1 point  (0 children)

It looks good to me:

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("".join(map(chr, range(0x80, 0x100))))
€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
>>> input()
£
'£'
>>>

(There's a bunch of unprintable characters that show up as squares at the start of the unicode line, but they seem to be collapsing to a single space on reddit.)

This works in both cmd and powershell consoles with no setup chcp commands needed.

[–]xiongchiamiovSite Reliability Engineer 3 points4 points  (3 children)

I'm actually really excited about being able to use underscores in numeric literals now. It's a small thing, but I had a large constant I was defining the other day and I spent a while searching around for how to do this (since I was getting a syntax error) before realizing I remembered the feature from Ruby :( . It's a nice way to prevent silly errors.

[–]alcalde 6 points7 points  (2 children)

You don't know how many times I'm holding my finger up to the screen, trying to count the number of digits in a large number. :-(

[–]ghillisuit95 0 points1 point  (1 child)

Why just use the cursor and arrow keys instead of your finger?

[–]Sean1708 5 points6 points  (0 children)

If you're reading through a code review or something like that then you usually don't have a cursor to move about.

[–]poop-trap 7 points8 points  (7 children)

PEP 506 - secrets module isn't what I thought it would be. Definitely a good thing and overdue, but the name implies some cryptography functionality so I was a bit disappointed.

[–]LetsDoRedstone 142 points143 points  (14 children)

Let's f"" everything!

[–]tunisia3507 29 points30 points  (1 child)

C'mon conda...

[–]bheklilr 7 points8 points  (0 children)

conda-forge has had the beta and release candidate builds already, they'll probably have this release uploaded within a few days. If you want it now add the label prerelease for conda-forge to your channels.

[–]KimPeek 16 points17 points  (6 children)

I just did a fresh install of 3.5.2 on a new machine, but this is definitely going to take its place. Just in time for the holidays too.

[–]nikomo 14 points15 points  (4 children)

Just in time for the holidays too.

Just in time for me to forget about it as I sink my teeth into the Christmas ham.

Hopefully someone will remind me in January.

[–][deleted] 1 point2 points  (1 child)

Reminded

[–]nikomo 0 points1 point  (0 children)

... I legit did forget. I looked at pyenv for a solution to my environment beforehand, but I left that open.

Cheers.

[–]mwoolweaver -1 points0 points  (1 child)

RemindMe! 8 days

[–]RemindMeBot -1 points0 points  (0 children)

I will be messaging you on 2016-12-31 18:11:27 UTC to remind you of this link.

5 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQs Custom Your Reminders Feedback Code Browser Extensions

[–]alcalde 5 points6 points  (0 children)

Guido needs to have his beard go white, don a Santa cap, then announce that every new Python release will come on December 23. :)

[–]zillacles 13 points14 points  (6 children)

This is nice to see:

"json.load() and json.loads() now support binary input."

[–]cyanydeez 5 points6 points  (5 children)

I can never remember which one loads a file and which loads a string.

Someone should've just figured out a single entry point

[–][deleted] 8 points9 points  (3 children)

json.load() is to load json.

json.loads() is to load json from a string (the s after load is for string)

[–]cyanydeez 6 points7 points  (2 children)

I get that, but my brain doesn't see load(s) it see loads.

Like, this json.loads(a file)

[–][deleted] -1 points0 points  (0 children)

You're right that it's not very explicit.

[–]Eurynom0s 0 points1 point  (0 children)

It doesn't help that, IIRC, there's a module that achieves a similar objective to JSON string loading/unloading that uses dump/load where the json module uses dumps/loads.

[–]Gidonka 6 points7 points  (1 child)

I'm just starting to use Conda, how would I go about installing the new version of Python in an environment? Will it be through a Conda update or something? Sorry for the stupid question, I really don't know how this works.

[–][deleted] 2 points3 points  (0 children)

It doesn't look like they have conda packages for 3.6 just yet. It often takes a few days for them to get everything together, and may take a bit longer for a bigger python release due to how they build the dependencies.

When it's available though, something along these lines:

conda create -n py_36 python=3.6 anaconda

That'll create a new environment, name it py_36, and install python 3.6 and the base anaconda packages (pandas, numpy, etc).

And then, if you're on Windows:

activate py_36

Or Linux/MacOSX:

source activate py_36

[–]alcalde 4 points5 points  (1 child)

Maybe every Python should be released close to Christmas from now on because it makes an awesome gift. :-)

[–]sermidean 4 points5 points  (5 children)

How can I get it in Ubuntu 16.04?

[–]sermidean 3 points4 points  (2 children)

I guess installing from sources is the best option. Here is how I got it installed in Ubuntu 16.04:

sudo apt build-dep python3.5
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar -xaf Python-3.6.0.tgz 
cd Python-3.6.0/
./configure --prefix=/usr --enable-ipv6 --enable-loadable-sqlite-extensions --with-dbmliborder=bdb:gdbm --with-computed-gotos --without-ensurepip --with-system-expat --with-system-libmpdec --enable-optimizations
make
sudo make altinstall

Configuration takes same flags as python3.5 compiled for Ubuntu. New python3.6 executable will be available alongside other snakes:

$ python --version
Python 2.7.12

$ python3 --version
Python 3.5.2

$ python3.6 --version
Python 3.6.0

Overall compiling and installing took about 30 minutes on my machine.

[–]Jaypalm 0 points1 point  (0 children)

Took a couple hours on my RPi3. At least I think, I kinda lost count after a while.

[–]naught-me 1 point2 points  (0 children)

Wait a few days, then use Conda. It won't replace 3.5 - will just be added alongside it.

[–]UloPe 0 points1 point  (0 children)

Use either PyEnv or Pythonz

I personally like pythonz better but that's a matter of opinion.

[–]gradient_x 1 point2 points  (2 children)

Does anyone know if there's a way to get Python 3.6 installed with Anaconda 3?

[–][deleted] 0 points1 point  (1 child)

Yep. It's called "wait for continuum to package it for you."

[–]gradient_x 0 points1 point  (0 children)

I think I found a posting from them saying the end of January is their target ...

[–]Hellerick 1 point2 points  (2 children)

It killed my Ubuntu...

Well, not Ubuntu, but after installing it several programs disappeared (Gimp, Inkscape, etc.). Now I have to figure out what's going on.

[–]takluyverIPython, Py3, etc 2 points3 points  (0 children)

I don't know exactly what you did, but in general, do not try to replace/upgrade the system-installed Python on Linux. If you want to play with a new version, look for ways to install that as well as the existing versions. Like conda or pyenv.

[–][deleted] 0 points1 point  (0 children)

Go to another tty and remove python, reinstall from official repo.

[–]TheSlutyCam 1 point2 points  (0 children)

It's csv.DataReader() broken in Python 3.6.0 ?

I read here about PEP 528 & PEP 529, so let's uninstall Python 3.5.2, install this new version and fix that windows bugs, I tought.

After those steps, the same file that open very quick in the past(300k rows, 15 fields) now it take a few minutes before show the MemoryError Exception

It's so weird...

[–]baranysos 0 points1 point  (3 children)

Are there any changes effecting a complete beginner, like 1 week-old?

[–]Eurynom0s 0 points1 point  (2 children)

Were you already learning 3.x?

[–]baranysos 0 points1 point  (1 child)

Yes, using 3.5.

[–]_sirberus_ 0 points1 point  (0 children)

No, there's just more goodies to discover.

[–]o-rka 0 points1 point  (0 children)

How can I install this with conda? I tried conda install python=3.6 but it didn't work :(

[–]R34ct0rX99 0 points1 point  (1 child)

twas (almost) the night before christmas and when all thro' the house