redis-om-python icon indicating copy to clipboard operation
redis-om-python copied to clipboard

[WIP] codebase refactor.

Open wiseaidev opened this issue 1 year ago • 0 comments

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.

wiseaidev avatar Aug 06 '22 17:08 wiseaidev