Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-37759: Significant edits to Whatsnew 3.8 #15127

Merged
merged 13 commits into from Aug 5, 2019

Conversation

@rhettinger
Copy link
Contributor

commented Aug 5, 2019

Work in progress. Please add suggestions here as you find them.

https://bugs.python.org/issue37759

@rhettinger rhettinger changed the title Better whatsnew bpo-37759: Significant edits to Whatsnew 3.8 Aug 5, 2019

Show resolved Hide resolved Doc/whatsnew/3.8.rst Outdated
if (clean_name := normalize('NFC', name)) in allowed_names]

Try to limit use of the walrus operator to clean cases that reduce
complexity and improve readability. When combined with other features

This comment has been minimized.

Copy link
@gvanrossum

gvanrossum Aug 5, 2019

Member

I would stop at "readability." I don't think specific examples of what's not okay help the readers of this document.

This comment has been minimized.

Copy link
@rhettinger

rhettinger Aug 5, 2019

Author Contributor

Will do.

At some point, we should put in some PEP 8 guidance. I've been using the beta with customers and students for the last several weeks. These examples were typical.

@ericvsmith
Copy link
Member

left a comment

This looks great to me. Thanks for your work on this, Raymond!

inverse for other negative exponents. For example, to compute the
`modular multiplicative inverse
<https://en.wikipedia.org/wiki/Modular_multiplicative_inverse>`_ of 38
in modulo 137, write::

This comment has been minimized.

Copy link
@jdemeyer

jdemeyer Aug 5, 2019

Contributor

"in modulo 137" should be "modulo 37".

This comment has been minimized.

Copy link
@rhettinger

rhettinger Aug 5, 2019

Author Contributor

Dropped the "in". Kept the 137.

``pow(x=2, y=10)`` and ``pow(2, 10, z=17)`` are invalid.
len(obj='hello') # The "obj" keyword argument impairs readability

A further benefit of marking a parameter as positional-only is that it

This comment has been minimized.

Copy link
@pablogsal

pablogsal Aug 5, 2019

Member

I find this section very well structured and informative! This rewrite really makes a difference :) What do you think about adding to this paragraph also the case of going from one argument to *args without breaking client code. For example going from

def add_to_queue(item):
   ...

to

def add_to_queue(*items):
   ...
@tirkarthi

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

With respect to unittest module. It now has the ability to collect async functions where before 3.8 tests have to be a normal function that could have an async definition inside and uses asyncio.run or loop to run it. This was not mentioned in whatsnew. Maybe a good addition given it improves testing asyncio code. Relevant commit : 4dd3e3f

import asyncio
import unittest

from unittest.async_case import IsolatedAsyncioTestCase

class FooTest(IsolatedAsyncioTestCase):

    async def asyncSetUp(self):
        print("Async Setup")

    async def test_sleep(self):
        await asyncio.sleep(1)
        self.assertEqual(1, 1)

    async def asyncTearDown(self):
        print("Async Teardown")

if __name__ == "__main__":
    unittest.main()
./python.exe /tmp/foo.py
Async Setup
Async Teardown
.
----------------------------------------------------------------------
Ran 1 test in 1.028s

OK

Thanks for improving the changelog examples.

@rhettinger

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

tirkarthi , thanks for the suggestions. I'll add the unittest example to the next round of updates (I'm making multiple PRs to minimize merge conflicts).

@rhettinger rhettinger merged commit 4f9ffc9 into python:master Aug 5, 2019

5 checks passed

Azure Pipelines PR #20190805.28 succeeded
Details
bedevere/issue-number Issue number 37759 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

commented Aug 5, 2019

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this pull request Aug 5, 2019

bpo-37759: First round of major edits to Whatsnew 3.8 (pythonGH-15127)
(cherry picked from commit 4f9ffc9)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@bedevere-bot

This comment has been minimized.

Copy link

commented Aug 5, 2019

GH-15139 is a backport of this pull request to the 3.8 branch.

rhettinger added a commit that referenced this pull request Aug 5, 2019

bpo-37759: First round of major edits to Whatsnew 3.8 (GH-15127) (GH-…
…15139)

(cherry picked from commit 4f9ffc9)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

LorenzMende added a commit to LorenzMende/cpython that referenced this pull request Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.