6 ms·
Python 3.7 released
- shakna 8y agoNice to see deterministic pycs made it in. Hurrah for reproducibility.
- WoodenChair 8y agoDoes anyone know how long new versions of Python take to get into Homebrew? Will current Python 3.6 installations on Homebrew autoupdate to Python 3.7 when brew update/brew upgrade is run and the new version is packaged?
- sashk 8y agoUsually, it should be within few days. I don't see any pull requests yet. 3.5->3.6 python was updated in the same package, so I guess python 3.7 will replace python 3.6 too. You will get it after you run brew upgrade.
- hprotagonist 8y agoi highly recommend pyenv. `brew install pyenv; pyenv install 3.7`
- ed_balls 8y agoTry using https://github.com/pypa/pipenv https://github.com/pypa/pipenv
- luhn 8y agoDid 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.
- zbentley 8y ago> 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.
- woodruffw 8y agoYou're welcome to create a PR. Homebrew's users are the primary contributors of package updates.
- beaugunderson 8y agoThe PR is open here: https://github.com/Homebrew/homebrew-core/pull/29490 https://github.com/Homebrew/homebrew-core/pull/29490 Looks like it's waiting for tests to pass at present.
- luhn 8y agoNotable parts of this release (IMO): * Data classes (https://docs.python.org/3.7/library/dataclasses.html https://docs.python.org/3.7/library/dataclasses.html) * New breakpoint() builtin (https://docs.python.org/3.7/library/functions.html#breakpoint 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.)
- welder 8y agoData 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/ https://www.python.org/dev/peps/pep-0560/
- johnramsden 8y agoI 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.
- kossae 8y ago> 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?
- kbd 8y agoFor 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/ https://www.python.org/dev/peps/pep-0560/
- lysp 8y agoNot a python coder, but from my understanding they are essentially auto-constructors?
- wyldfire 8y agoData classes seem pretty neat. I haven't used attrs yet. And I rarely extend namedtuples, but it's nice to have a mechanism to do that built in. breakpoint() is certainly more memorable than the current incantation.
- mrfusion 8y agoYes! I’ve never been able to convince anyone to use pdb.settrace. I think they see the pdb and assume there’s a whole new thing they’d have to learn. If I tell them you just call breakpoint() they might be willing to try it out.
- foxylad 8y agoI'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.
- j88439h84 8y agoWhy? attrs does it already.
- steve_adams_86 8y agoI'm not a python dev, but isn't less dependencies generally better? Or is attrs in Python natively already?
- j88439h84 8y agoAttrs isn't in python natively. Not sure why less dependencies would be better though.
- Spiritus 8y agoOne less thing to worry about. Adds to build time etc.
- steve_adams_86 8y agoEvery dependency is one more thing that can go wrong in my mind. I always drop them at every opportunity. There are some exceptions. Like I really don't want form building to be in the standard library, and I don't want to write it myself. It is nice when your package manager only takes a short manage to fetch and build though, and you can have more confidence that any mistakes will be your own (under your control) rather than someone else's.
- Retra 8y agoPython does a lot of things that libraries can do. "Batteries included" and whatnot.
- akubera 8y agoThe new importlib.resources[0] module is a nice solution for accessing static data-files within a package/module. It replaces pkg_resources (or perhaps, standardizes/guarantees-presence) and is supposed to be more efficient. There's also the new module-level "__getattr__(name):" function[1] which behaves as the class method does: catching undefined variable names and providing a way to easily, for example, generate objects dynamically, handle deprecated variables, and lazily load submodules. I have a feeling it's going to be (ab)used to do some really great meta-programming. [0] https://docs.python.org/3.7/library/importlib.html#module-importlib.resources https://docs.python.org/3.7/library/importlib.html#module-im... [1] https://www.python.org/dev/peps/pep-0562/ https://www.python.org/dev/peps/pep-0562/
- fwdpropaganda 8y agoHey, does anyone know where to find information about how python's releases are structured? For example, 3.6 exists and 3.7 is released. Without looking at the release details, should I be upgrading? Should I assume that it will break stuff, or assume that it won't, or should I make no assumptions? Etc...
- icebraining 8y ago3.6 to 3.7 is a minor release, only supposed to have new features, and not break existing code. Obviously, the probability of bugs is higher than in a micro release (e.g. 3.6.2 to 3.6.3), which only contains bugfixes. But I can't remember code from 2.6 breaking on 2.7, nor code from 3.5 breaking on 3.6.
- eesmith 8y agoOnly point releases are support to avoid breaking code (though they sometime do). Minor release may break code, though it should be rare. Python 3.7 reserves 'async' and 'await' as keywords so assignments like "async = 3", which worked in 3.6, will now fail. Python has a deprecation warning system which can detect cases like this, but it must be enabled: % python -Wall Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> async = 3 <stdin>:1: DeprecationWarning: 'async' and 'await' will become reserved keywords in Python 3.7
- kbumsik 8y agoI personally never encounter that. However, there is a breaking stuff in this release: await and async are now keywords. This means that although they were part syntax we could make variable variables with these name until 3.6 but now it is not allowed.
- michaelmcmillan 8y agoLove data classes! Would've been even cooler if they could've been made immutable. Oops, never mind: "It is not possible to create truly immutable Python objects. However, by passing frozen=True to the dataclass() decorator you can emulate immutability. In that case, dataclasses will add __setattr__() and __delattr__() methods to the class. These methods will raise a FrozenInstanceError when invoked."
- samuell 8y agoI found the post on RealPython easier to digest for a quick glance of the new features: https://realpython.com/python37-new-features https://realpython.com/python37-new-features
- uranusjr 8y agoEvery time I read about the module-level __getattr__ I’m reminded of the infamous Wat talk and how the speaker says Ruby is awesome. Python is equally awesome, finally :p https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat