News for hackers. Stuff that matters.
Re:PyPy gets funding from Mozilla for Python 3.5 support by StavrosK on Tuesday August 09, 2016 @03:24PM (#12257118)
Don't gain enough? Static type checking and asyncio? Sign me up!
Re:PyPy gets funding from Mozilla for Python 3.5 support by pinaraf on Tuesday August 09, 2016 @03:26PM (#12257134)
Static checking ? Python 3.5 Asyncio ? Python 3.4

If these had been available in Python 3.2 or even better 3.0, the switch would have been far easier for corporate users that need benefits before accepting the cost of change...

Re:PyPy gets funding from Mozilla for Python 3.5 support by raverbashing on Tuesday August 09, 2016 @04:10PM (#12257371)
3.4. gave a good virtualenv by default. That helps a lot
Re:PyPy gets funding from Mozilla for Python 3.5 support by brianwawok on Tuesday August 09, 2016 @04:39PM (#12257557)
I still use normal virtualenv, what am I missing by not using pyenv?
Re:PyPy gets funding from Mozilla for Python 3.5 support by raverbashing on Tuesday August 09, 2016 @04:43PM (#12257573)
3.4 gave us pip installed by default https://docs.python.org/3/library/venv.html

Before that it would give you an empty venv, not even setuptools

Yes, you can use the Python 2 virtualenv on Py 3 but I remember that there were some problems

Re:PyPy gets funding from Mozilla for Python 3.5 support by takeda on Tuesday August 09, 2016 @05:35PM (#12257871)
The usage is essentially the same, just a different command. Huge benefit though is that if you have Python 3.4+ installed you already have the virtual env and pip installed, so things are much simpler.
Re:PyPy gets funding from Mozilla for Python 3.5 support by StavrosK on Tuesday August 09, 2016 @04:38PM (#12257546)
Which one is that? I'm not aware of it.
Re:PyPy gets funding from Mozilla for Python 3.5 support by captainmuon on Tuesday August 09, 2016 @05:12PM (#12257732)

    python -m venv
I'm not sure what the differences are to old virtualenv, but the biggest feature is that it works out of the box as long as you have Python > 3.4. No more googling "how to install virtualenv" or "easy_install pip; pip install virtualenv" stuff.
Re:PyPy gets funding from Mozilla for Python 3.5 support by rspeer on Tuesday August 09, 2016 @11:30PM (#12259337)
Unless you're on Ubuntu, where they ship a non-functional version of venv and require you to "sudo apt install" python-venv to get the working version, defeating the entire point of a simple module in the stdlib that lets you manage your Python environment as a user.

The big improvement on 16.04 is at least the error message explains what's going on.

Re:PyPy gets funding from Mozilla for Python 3.5 support by brettcannon on Tuesday August 09, 2016 @05:19PM (#12257765)
Re:PyPy gets funding from Mozilla for Python 3.5 support by takeda on Tuesday August 09, 2016 @05:52PM (#12257969)
in addition to what other wrote you also have pyvenv command which is much convenient way of using it in cli (the usage is same as of virtualenv).
Re:PyPy gets funding from Mozilla for Python 3.5 support by 912312312 on Tuesday August 09, 2016 @03:39PM (#12257205)
I would say: Optional type checking outsourced to a third party tool (mypy) that catches perhaps 90% of the errors if you are lucky.
Re:PyPy gets funding from Mozilla for Python 3.5 support by eeZi on Tuesday August 09, 2016 @07:06PM (#12258321)
You still need something like MyPy to actually validate types. What happened is that there's now a standard for typing annotations - now, PyCharm, MyPy, Wing IDE and anyone else can share the same syntax.
Re:PyPy gets funding from Mozilla for Python 3.5 support by yeukhon on Tuesday August 09, 2016 @05:45PM (#12257918)
I am disappointed in Python core developers when they decided to accept static typing to Python 3. It bothers me more than the formatting PEP.
Re:PyPy gets funding from Mozilla for Python 3.5 support by twblalock on Tuesday August 09, 2016 @06:24PM (#12258142)
It's optional. How can that possibly bother you? Don't use it if you don't like it.
Re:PyPy gets funding from Mozilla for Python 3.5 support by catdog on Tuesday August 09, 2016 @07:10PM (#12258337)
It's not only optional, it does nothing by default. What was introduced into python is a standardized way to do type annotations. It consists mostly of a new standard library module and as far as i know it doesn't even introduce changes to the language as it uses comments, additional files and the rarely used function annotations. The interpreter happily ignores them anyways but external tools like mypy don't have to invent their own incompatible syntax.
Re:PyPy gets funding from Mozilla for Python 3.5 support by twblalock on Tuesday August 09, 2016 @08:36PM (#12258706)
I was more excited about them when I believed they were actually enforced. I guess they help with static analysis in IDEs, but you can still get type errors at runtime, so Python is still missing out on the main advantage of static typing.
Re:PyPy gets funding from Mozilla for Python 3.5 support by hendzen on Tuesday August 09, 2016 @09:04PM (#12258804)
there is a type checker available: http://mypy-lang.org/
Re:PyPy gets funding from Mozilla for Python 3.5 support by viraptor on Tuesday August 09, 2016 @09:10PM (#12258824)
> as far as i know it doesn't even introduce changes to the language as it uses comments

That's not the case. See for example https://www.python.org/dev/peps/pep-0484/#type-definition-sy...

Re:PyPy gets funding from Mozilla for Python 3.5 support by xapata on Tuesday August 09, 2016 @06:37PM (#12258197)
Because I'll need to support people that use it and explain it to newbies who read it. More work to do, without much benefit (to me; I understand it has much benefit to some people).
Re:PyPy gets funding from Mozilla for Python 3.5 support by StavrosK on Tuesday August 09, 2016 @07:44PM (#12258466)
It's only without benefit if you don't write Python. Otherwise, it's like having tests that take almost no effort to write. What's not to love about it?
Re:PyPy gets funding from Mozilla for Python 3.5 support by xapata on Tuesday August 09, 2016 @09:00PM (#12258793)
Edward Tufte might call it chart junk. It reduces the information to ink ratio. I generally get by just fine by choosing good names, so I don't need extra type checking beyond the standard duck typing.
Re:PyPy gets funding from Mozilla for Python 3.5 support by yeukhon on Tuesday August 09, 2016 @10:11PM (#12259065)
Why add static typing to a language long stood for duck typing? There should really be one way to write in Python.
Re:PyPy gets funding from Mozilla for Python 3.5 support by srean on Tuesday August 09, 2016 @11:25PM (#12259323)
A few things.

i) its not a type checker. It cannot actually ensure type correctness. So may be a more appropriate description would be "a very smart linter".

ii) Its optional

iii) even when switched on it does nothing unless you are explicitly using its features

iv) The "there is only one way to do things in Python" is just vapid marketing. It is not true and has never been true.

Re:PyPy gets funding from Mozilla for Python 3.5 support by dagw on Wednesday August 10, 2016 @03:38AM (#12260087)
"there is only one way to do things in Python" is just vapid marketing.

It's not even that, the actual quote is "There should be one, and preferably only one, obvious way to do things". The whole "there is only one way to do it" was a joke response to Perl's "There's more than one way to do it" motto.

Re:PyPy gets funding from Mozilla for Python 3.5 support by antod on Wednesday August 10, 2016 @06:42AM (#12260674)
The explicit version: "There should be an obvious way to do something. Ideally only one way will be obvious."

The original version was too implicit. Unless you are Dutch.

Re:PyPy gets funding from Mozilla for Python 3.5 support by coderzach on Tuesday August 09, 2016 @10:35PM (#12259153)
I've had great experiences with optional static typing from tools like flow[1] and mypy. I've found you can gain most of the bug catching and readability benefits of static typing, while having the power of dynamic typing when come across a truly dynamic problem.