for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
class PackageRequirement:
def __init__(self, manager: str, package: str, version):
"""
:param manager: A string with the name of the manager (pip, npm, etc).
:param package: A string with the name of the package to be installed.
:param version: A number that contains the version.
self.manager = manager
self.package = package
self.version = version
def __str__(self):
return "{.package} version {.version} (for {.manager})".format(self)
def check(self):
Check if the requirement is satisfied.
raise NotImplementedError
class PythonRequirement(PackageRequirement):
def __init__(self, package, version):
PackageRequirement.__init__(self, 'pip', package, version)
return "{.package} version {.version}".format(self)
def multiple(self, *args):
If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example
class Foo: def some_method(self, x, y): return x + y;
could be written as
class Foo: @classmethod def some_method(cls, x, y): return x + y;
return args
If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example
could be written as