watson-developer-cloud / speech-to-text-websockets-python

Python client that interacts with the IBM Watson Speech To Text service through its WebSockets interface
http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/speech-to-text.html
86 stars 63 forks source link

Undefined name 'status' in sttClient.py #27

Closed cclauss closed 5 years ago

cclauss commented 6 years ago

Should this be value['status'] instead?

flake8 testing of https://github.com/watson-developer-cloud/speech-to-text-websockets-python on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./sttClient.py:401:37: F821 undefined name 'status'
            print(fmt.format(key, **status))
                                    ^
1     F821 undefined name 'status'
1
daniel-bolanos commented 6 years ago

hi @cclauss I'm not sure this tool is meant to work on python 3.7.1. When I originally wrote it I targeted python 2.7.

cclauss commented 6 years ago

flake8 returns the same result when run on Python 2.7. In a compiled language this issue would be caught by the compiler at compile time but more dynamic languages like Python have fewer checks so linting with tools like flake8 is more important. Look at the code and think like a compiler. Try to determine what is the value of status just before this line is run. I believe that you will discover that status was never defined.