Skip to content

Conversation

@wiseaidev
Copy link
Contributor

@wiseaidev wiseaidev commented Aug 6, 2022

The following steps were performed:

  • Removed unnecessary keys method call.
  • Replaced the filter method with a list comprehension to increase readability.
  • Replaced old python2 methods with their equivalent in python3 (e.g. xrange -> range, izip -> zip) didn't notice the use of six module.
  • Used f-strings whenever possible because it is the ultimate method for string formatting.
  • Removed unnecessary list syntax from the sorted method because it takes an iterable which is in this case a generator.
  • Removed unnecessary boolean literals.
  • Found and fixed a syntax error: typ is not str -> not isinstance(typ, str).
  • Replaced None not in with all.

Question: Why the cache size is set to None? This can become problematic as explained here.

Signed-off-by: wiseaidev <business@wiseai.dev>
@wiseaidev wiseaidev changed the title General codebase refactor. [WIP] codebase refactor. Aug 7, 2022
Signed-off-by: wiseaidev <business@wiseai.dev>
@wiseaidev wiseaidev force-pushed the cleanup branch 3 times, most recently from 3693e81 to 1238ced Compare August 10, 2022 07:43
Signed-off-by: wiseaidev <business@wiseai.dev>
Signed-off-by: wiseaidev <business@wiseai.dev>
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.

1 participant