asyncio icon indicating copy to clipboard operation
asyncio copied to clipboard

Change import statements to import only what's needed

Open denisra opened this issue 9 years ago • 10 comments

Changed all the import statements in all modules in the examples directory to import only what is needed.

This fixes issue #464

denisra avatar Nov 16 '16 21:11 denisra

How about we do simple

import asyncio

at the top of each example? get_event_loop() should become asyncio.get_event_loop().

That's the style we recommend in Python documentation and use in asyncio code itself.

1st1 avatar Nov 16 '16 21:11 1st1

That makes sense. Let me fix that.

denisra avatar Nov 16 '16 21:11 denisra

Hello, and thanks for your contribution!

Unfortunately we couldn't find an account corresponding to your GitHub username at bugs.python.org (b.p.o). If you don't already have an account at b.p.o, please create one and make sure to add your GitHub username. If you do already have an account at b.p.o then please go there and under "Your Details" add your GitHub username.

And in case you haven't already, please make sure to sign the PSF contributor agreement (CLA); we can't legally look at your contribution until you have signed the CLA.

Once you have done everything that's needed, please reply here and someone will verify everything is in order.

the-knights-who-say-ni avatar Nov 16 '16 23:11 the-knights-who-say-ni

@1st1 Please let me know if you need me to change anything else.

@the-knights-who-say-ni This is my first contribution. I've just created my account at bugs.python.org and added my Github username to it. Please let me know if I missed anything.

denisra avatar Nov 16 '16 23:11 denisra

Please ignore any label fiddling I do; you managed to find a bug with the @the-knights-who-say-ni bot.

@denisra do make sure to sign the CLA.

brettcannon avatar Nov 16 '16 23:11 brettcannon

OK, bot is fixed; sorry about that.

brettcannon avatar Nov 16 '16 23:11 brettcannon

@brettcannon I can also confirm that I've signed the CLA.

denisra avatar Nov 17 '16 10:11 denisra

@denisra I wonder if we could remove import asyncio.test_utils completely. This is an internal module, and has nothing to do with examples (which historically were just experiments with asyncio, while asyncio was in active development).

1st1 avatar Nov 17 '16 17:11 1st1

@1st1 is it ok if I create another issue and submit another PR for that, to keep things separated?

denisra avatar Nov 17 '16 20:11 denisra

@1st1 is it ok if I create another issue and submit another PR for that, to keep things separated?

OK, let's do that!

1st1 avatar Nov 17 '16 20:11 1st1