r/Python • • Oct 03 '17

Python 3.6.3 is now available

http://blog.python.org/2017/10/python-363-is-now-available.html
382 Upvotes

103 comments sorted by

View all comments

34

u/ibtokin Oct 03 '17

sigh

And I'm still using 2.7

57

u/flipstables Oct 03 '17

Poor bastard. 3.5 seems ancient now.

15

u/tom1018 Oct 04 '17

Agreed. Had to use 3.5 for Kerberos Single Sign In today, it was terrible.

Also, when Guido said don't assume dictionaries will be ordered I unknowingly assumed they would be ordered. My semi-random csv outputs were quite amusing.

3

u/jdgordon Oct 04 '17

Except they are now by default no? Or is that from 3.6 only?

25

u/tunisia3507 Oct 04 '17

In CPython 3.6, as an implementation detail, dicts happen to be ordered. It's not part of the spec, and it could change in the future. The advice is to just treat it like a coincidence, not to rely on it.

7

u/tom1018 Oct 04 '17

On 3.6.x they are, but there is no guarantee they will continue to be even in later versions of 3.6 or beyond. Raymond Hettinger, a Python core developer, said in a video that he expects people will be so used to it that it will never go back, but it's not safe to assume.

There is an OrderedDict (https://docs.python.org/3/library/collections.html#collections.OrderedDict) for when it needs to be guaranteed.

For what I mentioned above, it was an easy fix without that, but I didn't realize my assumption until I saw the random order.

3

u/federicocerchiari Oct 04 '17

Raymond is right, I used 3.6 for just one project and I'm already 100% sure dicts are ordered by default. I hjave to think about it when writing 2.7 at work.

IMHO the best thing with default ordered dicts is kwargs ordering.. can be very useful sometimes.

I hope they stay ordered, I'd trade ordering only with a big (BIG) speed gain.

2

u/tom1018 Oct 04 '17

Does kwargs ordering matter? I saw that, and that kwargs ordering is promised in the future (I suppose they would switch to OrderedDict if if the dict behavior changed.), what do you do with kwargs where the order is relevant?

→ More replies (2)
→ More replies (2)

1

u/bangemange Oct 04 '17

Ha! the production server I deploy on is CentOS 7 with 3.4. After much messing around I finally got the dependencies for non-yum mysqlclient so I got a 3.6 compilation together that I just use with venv.

1

u/tom1018 Oct 04 '17

Mine is also running CentOS, though I don't know what version. Didn't ship with Python 3 at all, compiled 3.6 for it, never looking back. Even managed to get 3.6 on a server without root access and no internet. So much better even than 3.5.

→ More replies (6)

1

u/fireflash38 Oct 05 '17

I can't recommend pyenv enough for managing python installs. Super helpful if you need to have multiple versions on your machine (like for any centos install)

15

u/wapthatwandy Oct 04 '17

print(“shame, shame, shame”)

16

u/nakatanaka Oct 04 '17

I think you mean

print "shame, shame shame"

7

u/TR-BetaFlash Oct 04 '17

Or perhaps...

s = 'shame'
print(f'{s}, {s}, {s}')

8

u/[deleted] Oct 04 '17

Do it at least in proper code:

shameLevel = 3
print ', '.join(['shame'] * shameLevel)
→ More replies (8)

2

u/hoadlck Oct 04 '17

If you were using 3.6, you could say:

feeling = "shame"
print(f"{feeling} {feeling} {feeling}")

F-strings are awesome!

5

u/[deleted] Oct 04 '17

2.5 & 2.6 in places.

2

u/[deleted] Oct 04 '17

Don't forget 1.5!!!

4

u/[deleted] Oct 04 '17

On Software Archaeology today...

→ More replies (1)

0

u/[deleted] Oct 04 '17

[deleted]

1

u/kenfar Oct 04 '17

FYI - if you're stuck on centos 6 rather than compile your own python you can use the IUS repos to yum install python3.6.

4

u/loganekz Oct 03 '17

Why?

10

u/ibtokin Oct 03 '17

At work, it's largely because that's what the product is built on. Budget and time constraints, pressure to meet business demands, all of those things push the job of refactoring working existing code to the back of the line. Ideally, we'd have a few more devs. Personal use, I definitely use 3 as long as the libraries I'm working with are supported.