全 45 件のコメント

[–]badsectors 27ポイント28ポイント  (1子コメント)

[–]ExoticMandiblesCore Contributor[S] 17ポイント18ポイント  (0子コメント)

Coincidence! The release schedule for 3.5 is really just the release schedule for 3.4 shifted forward by 18 months.

[–]ilan 15ポイント16ポイント  (9子コメント)

And if you are on Linux or MacOSX, and use conda, you can:

conda create -n py35 python=3.5

[–]ExoticMandiblesCore Contributor[S] 9ポイント10ポイント  (1子コメント)

Do they already have Python 3.5.0 final up? If so... that was quick!

[–]ilan 4ポイント5ポイント  (0子コメント)

Yes, this is 3.5.0 final

[–]anonymousperson28 1ポイント2ポイント  (1子コメント)

Is it possible to upgrade the python version in an already existing environment?

[–]ilan 3ポイント4ポイント  (0子コメント)

Yes it is possible, although not recommended, because it will already installed Python packages won't work.

[–]roger_ 1ポイント2ポイント  (4子コメント)

So I could install miniconda and get a clean 3.5 install with NumPy, etc. right now?

[–]ilan 1ポイント2ポイント  (3子コメント)

Yes (on Linux and Mac)

[–]beaverteeth92 0ポイント1ポイント  (2子コメント)

I'm trying it, but it still has 3.4.3 as default. How can I set 3.5.0 as the default environment and remove 3.4.3?

[–]takluyverIPython, Py3, etc 0ポイント1ポイント  (1子コメント)

I think you'll need to wait for them to do a new release of miniconda before the default environment has 3.5. Until then, you'll have to explicitly create an environment for it.

[–]beaverteeth92 0ポイント1ポイント  (0子コメント)

Thanks! I just did that though and it broke Matplotlib.

[–]IronManMark20 24ポイント25ポイント  (0子コメント)

Hah! I studied!

EDIT: but seriously, excellent job to the Python devs!

[–]joelthelion 11ポイント12ポイント  (2子コメント)

Is there a good tutorial covering the async stuff (yield from, async, await)?

[–]RubyPinchducttape is my favorite tool | http://github.com/Socialery 3ポイント4ポイント  (0子コメント)

probably not

for now there is the official documentation https://docs.python.org/3.5/reference/compound_stmts.html#coroutines

and the pep

[–]adrian17 1ポイント2ポイント  (0子コメント)

I'd also love some tutorial with real life usage, like making multiple big HTTP requests / SQL queries / file reads.

For cases like HTTP requests, is it possible to use it with Requests or am I forced to use asyncio-aware library like aiohttp?

[–]lovestowritecode 8ポイント9ポイント  (6子コメント)

Did static type hinting make it in? I don't see it listed anywhere...

[–]A_for_Anonymous -1ポイント0ポイント  (3子コメント)

I wonder why people keep bothering with this sort of thing... Python is dynamically (yet strong) typed, which is a good thing from having to do the boilerplate of static typing. You want that back? For the only benefit of what, detecting logical errors in compile/startup time? Possible optimizations? Ever heard of type inference? It's years beyond this, happened in other languages years before this, and people are still oblivious to it.

[–]move_machine 2ポイント3ポイント  (2子コメント)

We are all aware of what dynamic typing brings to the table. Unfortunately, it makes it hard to glean semantics when reading code or doing static analysis. This is the attraction to function annotations and optional typing: we can cherrypick the advantages of static typing and blend them with a dynamic environment.

Notice it is OPTIONAL typing. People that want the clarity, enhanced IDE behavior and in the future a typechecker now have an enhanced option of more descriptive types from the typing module for their annotations.

Having written code without annotations and with: when given the opportunity I will write them with annotations. It saves me the time spent looking in the function body for the kind of object the function expects as a parameter. I don't have to scan the body to realize that parameter_a is an object that implements the iterator protocol and yields a series of 3-tuples. I can just look at the declaration or hints my IDE shows. Being able to quickly check that your parameters are "correct" or what return type to expect becomes valuable. I find it also makes it easier to read a foreign codebase and to understand how data moves and is transformed through it.

Right now there is no typechecker so I can write:

In [1]: def func(a: list) -> dict:
   ...:       return set("abc")
   ...: 

In [2]: func(10101)
Out[2]: {'a', 'b', 'c'}

Which is still completely valid. Annotations have no meaning to the interpreter and probably never will outside of an importable module.

[–]A_for_Anonymous -1ポイント0ポイント  (1子コメント)

Even so, if you have to read f(x)'s body to tell what's the type expected for x, you need:

  • A better name for x (I know, argument not valid for return and yield)
  • Function documentation, and yeah, I guess human language documentation will always be better than a type hint system unless you introduce a huge system of contracts that can be something like "even" or "tupleof(3)"... more boilerplate... more stuff to memorize... very annoying.

Function documentation being important in the case of code written for lists, dictionaries and sets as opposed to custom classes (would you have 5 types with 50 utility functions each or 50 types with 5, but that's a nice discussion for a different thread).

For everything else - IDE assistance, type checking, error detection - there's always this new old amazing technology called type inference, where by doing x = 'hello' you can be pretty fucking sure x is a string without having to go and tell the stupid compiler it's going to be a string. Because you know, actually writing that feels like this.

[–]takluyverIPython, Py3, etc 1ポイント2ポイント  (0子コメント)

Type inference is great, but it can't do everything, especially when you're using some of the more dynamic features of the language. Type hints let you give the IDE/type checker more information when it can't automatically work out what types are going in and out of functions.

[–]arkydon 0ポイント1ポイント  (0子コメント)

I don't remember demo programs being there before.. New?

[–]bucknuggets 1ポイント2ポイント  (0子コメント)

Anyone know if pylint already supports type hints, or is that something coming soon?

[–]scrollin_thru 1ポイント2ポイント  (2子コメント)

Anyone else having trouble with this in conjunction with mypy? I installed mypy with pip 7.1.2 against python 3.5 and I get from typing import Undefined, Dict, List, Tuple, cast, Set, Union

ImportError: cannot import name 'Undefined' every time I try to run mypy.

[–]ENOENT 1ポイント2ポイント  (1子コメント)

Maybe mypy release is not up to date with current 3.5 typing module? Does it work with current git master (pip3 install -U git+https://github.com/JukkaL/mypy#egg=mypy)?

[–]scrollin_thru 1ポイント2ポイント  (0子コメント)

Ah! That seems to have fixed it. Thanks!

[–]ctolsen 1ポイント2ポイント  (0子コメント)

Hooray! Now I just need the official Docker image and a new pytest release.

Edit: feel free to use this one for now – it's just the official Dockerfile with an upgrade. I'll push the slim one in a bit as well.