Skip to content

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

Merged
harshildarji merged 1 commit into
TheAlgorithms:masterfrom
cclauss:modernize-python2-code-again
Jan 22, 2018
Merged

Modernize Python 2 code to get ready for Python 3 AGAIN#242
harshildarji merged 1 commit into
TheAlgorithms:masterfrom
cclauss:modernize-python2-code-again

Conversation

@cclauss

@cclauss cclauss commented Jan 21, 2018

Copy link
Copy Markdown
Member

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