File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ def isgenerator(obj):
2525 return isinstance (obj , type ((_g )()))
2626
2727
28+ # In MicroPython there's currently no way to distinguish between generators and coroutines.
29+ iscoroutinefunction = isgeneratorfunction
30+ iscoroutine = isgenerator
31+
32+
2833class _Class :
2934 def meth ():
3035 pass
Original file line number Diff line number Diff line change 1- metadata (version = "0.1.2 " )
1+ metadata (version = "0.1.3 " )
22
33module ("inspect.py" )
Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ def test_isgeneratorfunction(self):
4444 def test_isgenerator (self ):
4545 self ._test_is_helper (inspect .isgenerator , entities [2 ])
4646
47+ def test_iscoroutinefunction (self ):
48+ self ._test_is_helper (inspect .iscoroutinefunction , entities [1 ])
49+
50+ def test_iscoroutine (self ):
51+ self ._test_is_helper (inspect .iscoroutine , entities [2 ])
52+
4753 def test_ismethod (self ):
4854 self ._test_is_helper (inspect .ismethod , entities [5 ])
4955
You can’t perform that action at this time.
0 commit comments