-
-
Notifications
You must be signed in to change notification settings - Fork 178
Change import statements to import only what's needed #468
base: master
Are you sure you want to change the base?
Changes from 1 commit
3863b43
5e4efd7
a40fe76
b92866f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
"""Simplest possible HTTP client.""" | ||
|
||
import sys | ||
|
||
import asyncio | ||
import sys | ||
|
||
|
||
@asyncio.coroutine | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
"""Test client that connects and sends infinite data.""" | ||
|
||
import argparse | ||
import sys | ||
|
||
import asyncio | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also |
||
import asyncio.test_utils | ||
import sys | ||
|
||
|
||
ARGS = argparse.ArgumentParser(description="TCP data sink example.") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
"""Like source.py, but uses streams.""" | ||
|
||
import argparse | ||
import sys | ||
|
||
import asyncio | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. asyncio.test_utils There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder why we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brettcannon Thanks for pointing that out. I made the changes as suggested. Please let me know if I need to change anything else. |
||
import asyncio.test_utils | ||
import sys | ||
|
||
|
||
ARGS = argparse.ArgumentParser(description="TCP data sink example.") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,8 @@ | |
"""TCP echo server example.""" | ||
|
||
import argparse | ||
import sys | ||
|
||
import asyncio | ||
import sys | ||
|
||
|
||
try: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,8 @@ | |
"""UDP echo example.""" | ||
|
||
import argparse | ||
import sys | ||
|
||
import asyncio | ||
import sys | ||
|
||
|
||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports should be sorted alphabetically (that's what we try to do in asyncio and CPython code bases).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1st1 I wasn't aware of that, sorry. I was going by the PEP8 guidelines, where it tells us to import the standard library modules first. But I'll have that fix following your recommendations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denisra Asyncio is technically a stdlib module. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SethMichaelLarson I can't say that it isn't :) will send send in another commit in just a few min with that fixed