-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Python 3 async functions and methods.
- Loading branch information
Showing
8 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
## @brief An asynchronous function and an asynchronous method. | ||
# | ||
#Here we're testing out some straightforward Python 3 async | ||
#examples. | ||
# | ||
# @namespace sample_async | ||
|
||
|
||
|
||
## @brief A sample non-asynchronous function. | ||
# | ||
# @namespace sample_async.non_asynchronous_function | ||
|
||
def non_asynchronous_function(): | ||
return "Not async." | ||
|
||
## @brief A sample asynchronous function. | ||
# | ||
# @namespace sample_async.asynchronous_function | ||
|
||
async def asynchronous_function(): | ||
return "Async" | ||
|
||
|
||
## @brief A sample class with an async method. | ||
# | ||
# Nothing special, just a basic Python 3 class that has an | ||
# async method in it. | ||
# | ||
# @namespace sample_async.ClassWithAsyncMethod | ||
|
||
class ClassWithAsyncMethod(): | ||
|
||
## @brief This is a regular, non-async method. | ||
# | ||
# @namespace sample_async.ClassWithAsyncMethod.non_asynchronous_method | ||
|
||
def non_asynchronous_method(self): | ||
return "Not async." | ||
|
||
## @brief This is an asynchronous method. | ||
# | ||
# @namespace sample_async.ClassWithAsyncMethod.asynchronous_method | ||
|
||
async def asynchronous_method(self): | ||
return "Async" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
## | ||
#An asynchronous function and an asynchronous method. | ||
# | ||
#Here we're testing out some straightforward Python 3 async | ||
#examples. | ||
# | ||
|
||
|
||
## | ||
# A sample non-asynchronous function. | ||
# | ||
def non_asynchronous_function(): | ||
return "Not async." | ||
|
||
## | ||
# A sample asynchronous function. | ||
# | ||
async def asynchronous_function(): | ||
return "Async" | ||
|
||
|
||
## | ||
# A sample class with an async method. | ||
# | ||
# Nothing special, just a basic Python 3 class that has an | ||
# async method in it. | ||
# | ||
class ClassWithAsyncMethod(): | ||
|
||
## | ||
# This is a regular, non-async method. | ||
# | ||
def non_asynchronous_method(self): | ||
return "Not async." | ||
|
||
## | ||
# This is an asynchronous method. | ||
# | ||
async def asynchronous_method(self): | ||
return "Async" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
## @brief An asynchronous function and an asynchronous method. | ||
# | ||
#Here we're testing out some straightforward Python 3 async | ||
#examples. | ||
# | ||
# @namespace sample_async | ||
|
||
|
||
|
||
## @brief A sample non-asynchronous function. | ||
# | ||
# @namespace sample_async.non_asynchronous_function | ||
|
||
def non_asynchronous_function(): | ||
return "Not async." | ||
|
||
## @brief A sample asynchronous function. | ||
# | ||
# @namespace sample_async.asynchronous_function | ||
|
||
async def asynchronous_function(): | ||
return "Async" | ||
|
||
|
||
## @brief A sample class with an async method. | ||
# | ||
# Nothing special, just a basic Python 3 class that has an | ||
# async method in it. | ||
# | ||
# @namespace sample_async.ClassWithAsyncMethod | ||
|
||
class ClassWithAsyncMethod(): | ||
|
||
## @brief This is a regular, non-async method. | ||
# | ||
# @namespace sample_async.ClassWithAsyncMethod.non_asynchronous_method | ||
|
||
def non_asynchronous_method(self): | ||
return "Not async." | ||
|
||
## @brief This is an asynchronous method. | ||
# | ||
# @namespace sample_async.ClassWithAsyncMethod.asynchronous_method | ||
|
||
async def asynchronous_method(self): | ||
return "Async" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
## @brief An asynchronous function and an asynchronous method. | ||
# | ||
#Here we're testing out some straightforward Python 3 async | ||
#examples. | ||
# | ||
|
||
|
||
|
||
## @brief A sample non-asynchronous function. | ||
# | ||
|
||
def non_asynchronous_function(): | ||
return "Not async." | ||
|
||
## @brief A sample asynchronous function. | ||
# | ||
|
||
async def asynchronous_function(): | ||
return "Async" | ||
|
||
|
||
## @brief A sample class with an async method. | ||
# | ||
# Nothing special, just a basic Python 3 class that has an | ||
# async method in it. | ||
# | ||
|
||
class ClassWithAsyncMethod(): | ||
|
||
## @brief This is a regular, non-async method. | ||
# | ||
|
||
def non_asynchronous_method(self): | ||
return "Not async." | ||
|
||
## @brief This is an asynchronous method. | ||
# | ||
|
||
async def asynchronous_method(self): | ||
return "Async" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
An asynchronous function and an asynchronous method. | ||
Here we're testing out some straightforward Python 3 async | ||
examples. | ||
""" | ||
|
||
|
||
def non_asynchronous_function(): | ||
""" | ||
A sample non-asynchronous function. | ||
""" | ||
return "Not async." | ||
|
||
async def asynchronous_function(): | ||
""" | ||
A sample asynchronous function. | ||
""" | ||
return "Async" | ||
|
||
|
||
class ClassWithAsyncMethod(): | ||
""" | ||
A sample class with an async method. | ||
Nothing special, just a basic Python 3 class that has an | ||
async method in it. | ||
""" | ||
|
||
def non_asynchronous_method(self): | ||
""" | ||
This is a regular, non-async method. | ||
""" | ||
return "Not async." | ||
|
||
async def asynchronous_method(self): | ||
""" | ||
This is an asynchronous method. | ||
""" | ||
return "Async" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters