Skip to content

Modernize Python 2 code to get ready for Python 3 AGAIN #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2018
Merged

Modernize Python 2 code to get ready for Python 3 AGAIN #242

merged 1 commit into from
Jan 22, 2018

Conversation

cclauss
Copy link
Member

@cclauss cclauss commented Jan 21, 2018

This is #220 done again on new code that was not cleaned up in #220 The approach is the same.

This PR solves the following issues:

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

./data_structures/Trie/Trie.py:15:32: E999 SyntaxError: invalid syntax
    def insert_many(self, words: [str]):  # noqa: F821 This syntax is Python 3 only
                               ^
./dynamic_programming/fastfibonacci.py:10:16: E999 SyntaxError: invalid syntax
def fibonacci(n: int):  # noqa: F821 This syntax is Python 3 only
               ^
2     E999 SyntaxError: invalid syntax

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

./machine_learning/scoring_functions.py:73:13: E999 SyntaxError: invalid syntax
    print str(numerator)
            ^
./Project Euler/Problem 29/solution.py:30:28: E999 SyntaxError: invalid syntax
    print "Number of terms ", len(collectPowers)
                           ^
./dynamic_programming/abbreviation.py:29:14: E999 SyntaxError: invalid syntax
    print abbr("daBcd", "ABC") # expect True
             ^
./File_Transfer_Protocol/ftp_client_server.py:11:28: E999 SyntaxError: invalid syntax
print 'Server listening....'
                           ^
4     E999 SyntaxError: invalid syntax

@harshildarji harshildarji merged commit bc34f6e into TheAlgorithms:master Jan 22, 2018
@cclauss cclauss deleted the modernize-python2-code-again branch January 22, 2018 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants