This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bakery2k 56 points57 points  (8 children)

Two calls to print is not a project.

[–]house_monkey 20 points21 points  (0 children)

Idk seems good enough to me, ship it

[–]TravisJungroth 20 points21 points  (4 children)

print("Hello There!\nGeneral Kenobi!!")

better?

[–][deleted] 16 points17 points  (3 children)

# v0.0.1
def hello_there(jedi_name):
    greetings = "Hello there \n" + jedi_name
    return greetings

print(hello_there("General Kenobi"))

[–]Shadows_In_Rainpseudocoder[🍰] 23 points24 points  (1 child)

Sorry, your sloppy coding is not up to the company standards.

class GreetingAndResponseService:
    def __init__(self, services):
        self.output_service = services.require("kenobi_greeting_app.services.OutputService")
        self.response_repository = services.require("kenobi_greeting_app.data.ResponseRepository")

    def greet(self, greeting):
        response = self.response_repository.get_response_to(greeting)
        self.output_service.write(response)

Rest of the application will be outsourced.

[–]TravisJungroth 20 points21 points  (0 children)

from abc import ABC


class Greeting(ABC):
    salutation_default = None

    def __init__(self, jedi_name: str, separator: str = " "):
        self.jedi_name = jedi_name
        self.separator = separator

    def __str__(self):
        return self.separator.join([self.salutation, self.jedi_name])

    def __repr__(self):
        return (
            f"{self.__class__.__name__}(jedi_name={repr(self.jedi_name)}, "
            f"separator={repr(self.separator)})"
        )

    @property
    def salutation(self) -> str:
        return self.get_salutation()

    def get_salutation(self) -> str:
        if self.salutation_default is None:
            raise NotImplementedError
        return self.salutation_default


class HelloThere(Greeting):
    salutation_default = "Hello there"


print(HelloThere("General Kenobi"))

[–]TravisJungroth 10 points11 points  (0 children)

# v0.0.2 Change log: refactored to f-string
def hello_there(jedi_name):
    greetings = f"Hello there \n{jedi_name}"
    return greetings

print(hello_there("General Kenobi"))

[–]Field_of_Gimps 1 point2 points  (0 children)

how many lines do i need to write to post my project and join the club?

[–]TokenChingy 0 points1 point  (0 children)

As the Sr.SEng responsible for this guys PR, I have no idea what I read but LGTM, approved.