ACM-VIT / PyFlask_2k18

A workshop organised by ACM VIT every year, during Gravitas (VIT University, Tech Fest), Having sessions on python programming and website creation using flask.
MIT License
94 stars 29 forks source link

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

Open cclauss opened 6 years ago

cclauss commented 6 years ago

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

akshitgrover commented 6 years ago

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

cclauss commented 6 years ago

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 commented 6 years ago

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