Skip to content

Instantly share code, notes, and snippets.

@rsip22
Created February 28, 2019 23:24
Show Gist options
  • Save rsip22/0c7561dd3c9f932dbacd10127a2fb12a to your computer and use it in GitHub Desktop.
Save rsip22/0c7561dd3c9f932dbacd10127a2fb12a to your computer and use it in GitHub Desktop.
renata
"""
Classes defining the developer's attributes.
"""
class SelfTaught:
"""
Class for the self-taught attribute.
"""
def __init__(self, selftaught=True, *args, **kwargs):
super().__init__(*args, **kwargs)
self.selftaught = selftaught
def can_learn_new_technologies(self):
return self.selftaught
from person import Person
from attributes import SelfTaught
"""
Classes for the employees of the company.
"""
class Developer(SelfTaught, Person):
"""
Class for the Developers in the company.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def hire(self):
""" Hire the candidate if self-taught. """
return self.selftaught
from employees import Developer
if __name__ == '__main__':
renata = Developer(name='Renata',
github='rsip22',
linkedin="Renata D'Avila",
email="renatadavila@protonmail.com")
input('Is Renata self-taught?')
print(renata.selftaught)
input('Should you hire Renata?')
print(renata.hire())
print('Github:', renata.github)
print('LinkedIn:', renata.linkedin)
"""
Classes for the candidates
"""
class Person:
"""
Ideally, the candidates should be people with an online presence.
"""
def __init__(self, name, github=None, linkedin=None,
email=None, *args, **kwargs):
self.name = name
self.github = github
self.linkedin = linkedin
self.email = email
for key, value in kwargs.items():
setattr(self, key, value)
def __str__(self):
return '{}: {}'.format(self.__class__.__name__, self.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment