PyFlask_2k18 icon indicating copy to clipboard operation
PyFlask_2k18 copied to clipboard

'str' is a builtin datatype so do not use it as a variable name

Open cclauss opened this issue 7 years ago • 3 comments

PyFlask_2k18/datatypes/examples/string.py contains lots of syntax errors.

cclauss avatar Oct 03 '18 12:10 cclauss

Thank you for your feedback @cclauss Will surely look into this.

akshitgrover avatar Oct 03 '18 12:10 akshitgrover

It is easy to run these tests on a local machine:

  1. python2 -c "import ast ; ast.parse(open('string.py').read())"
  2. python3 -c "import ast ; ast.parse(open('string.py').read())"

cclauss avatar Oct 03 '18 12:10 cclauss

flake8 testing of https://github.com/ACM-VIT/PyFlask_2k18 on Python 3.7.0

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

./datatypes/examples/string.py:5:27: E999 SyntaxError: invalid syntax
print "str.capitalize() : ", str.capitalize()
                          ^
./datatypes/examples/list.py:54:7: F821 undefined name 'odd'
print(odd) #this gives an error
      ^
./functions/examples/function_scope.py:6:7: F821 undefined name 'variable'
print(variable)
      ^
1     E999 SyntaxError: invalid syntax
2     F821 undefined name 'odd'
3

cclauss avatar Oct 03 '18 13:10 cclauss