Live data from Hacker News

Python 3.7 released

python.org

11–20 of 56 posts

Re: Python 3.7 released

#11
post #8

Notable parts of this release (IMO): * Data classes ( https://docs.python.org/3.7/library/dataclasses.html ) * New breakpoint() builtin ( https://docs.python.org/3.7/library/functions.html#breakpoin... ) * Dictionaries preserve insertion order. (Implemented in 3.6, but now is part of the official spec.)

Is the breakpoint builtin analogous to binding.pry in Ruby? If so...that is amazing!

Re: Python 3.7 released

#12
post #10
post #8

Notable parts of this release (IMO): * Data classes ( https://docs.python.org/3.7/library/dataclasses.html ) * New breakpoint() builtin ( https://docs.python.org/3.7/library/functions.html#breakpoin... ) * Dictionaries preserve insertion order. (Implemented in 3.6, but now is part of the official spec.)

Data classes are awesome! No more boilerplate __init__(self) methods needed. Another notable part of this release is type annotations: https://www.python.org/dev/peps/pep-0560/

I love python typing, and have been using it extensively in 3.6. Great to see it in the CPython core!

I've been looking forward to trying data classes, should be nice to avoid unnecessary code.

Re: Python 3.7 released

#14
post #8

Notable parts of this release (IMO): * Data classes ( https://docs.python.org/3.7/library/dataclasses.html ) * New breakpoint() builtin ( https://docs.python.org/3.7/library/functions.html#breakpoin... ) * Dictionaries preserve insertion order. (Implemented in 3.6, but now is part of the official spec.)

Is the breakpoint builtin analogous to binding.pry in Ruby? If so...that is amazing!

Yes, it's quite similar. It's not THAT amazing though since it's just a convenience function over pdb.set_trace() which has been in the Python standard library for a very long time (2 decades or more).

Re: Python 3.7 released

#15
post #10

Earlier quoted context omitted.

Data classes are awesome! No more boilerplate __init__(self) methods needed. Another notable part of this release is type annotations: https://www.python.org/dev/peps/pep-0560/

I love python typing, and have been using it extensively in 3.6. Great to see it in the CPython core! I've been looking forward to trying data classes, should be nice to avoid unnecessary code.

> The typing module is one of the heaviest and slowest modules in the standard library even with all the optimizations made.

Have you noticed any decreases in performance using core typing?

Re: Python 3.7 released

#16
post #6
post #5

Earlier quoted context omitted.

Try using https://github.com/pypa/pipenv

Did you mean pyenv? pipenv is a package manager. You can specify in pipenv which version of Python your project needs, but to utilize it requires that that the version is already installed on your system.

> to utilize it requires that that the version is already installed on your system.

Almost correct. It requires either that the version is already on your system, or it can find an installation of pyenv configured in the standard way (and, on some quirky situations with OSX, configured but pristine--without any pre-existing Python builds). In the latter case, it'll ask you if you want it to automatically build and cache/install a Python of the specified version.

And yes, the names all suck.

Re: Python 3.7 released

#17
post #8

Notable parts of this release (IMO): * Data classes ( https://docs.python.org/3.7/library/dataclasses.html ) * New breakpoint() builtin ( https://docs.python.org/3.7/library/functions.html#breakpoin... ) * Dictionaries preserve insertion order. (Implemented in 3.6, but now is part of the official spec.)

Wow, I'm tempted to make the switch tomorrow but I literally just wrote tons of boilerplate today....

Re: Python 3.7 released

#18
post #15

Earlier quoted context omitted.

I love python typing, and have been using it extensively in 3.6. Great to see it in the CPython core! I've been looking forward to trying data classes, should be nice to avoid unnecessary code.

> The typing module is one of the heaviest and slowest modules in the standard library even with all the optimizations made. Have you noticed any decreases in performance using core typing?

For those wondering, like I was, where that quote comes from, it's from PEP 560 "Core support for typing module and generic types" - https://www.python.org/dev/peps/pep-0560/

Re: Python 3.7 released

#19
I've become a heavy user of attrs, a small library that makes it easy to replace named tuples with a class that automatically includes initialisation and string representation functions.

So I'm very glad to see data classes bringing this to the core language.

Re: Python 3.7 released

#20
post #10
post #8

Notable parts of this release (IMO): * Data classes ( https://docs.python.org/3.7/library/dataclasses.html ) * New breakpoint() builtin ( https://docs.python.org/3.7/library/functions.html#breakpoin... ) * Dictionaries preserve insertion order. (Implemented in 3.6, but now is part of the official spec.)

Data classes are awesome! No more boilerplate __init__(self) methods needed. Another notable part of this release is type annotations: https://www.python.org/dev/peps/pep-0560/

Not a python coder, but from my understanding they are essentially auto-constructors?
Post reply on HN