Skip to content

Sourcery Starbot ⭐ refactored wklken/py-patterns #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/py-patterns master
git merge --ff-only FETCH_HEAD
git reset HEAD^

print("%s process %s" % (self.__class__.__name__, request))
print(f"{self.__class__.__name__} process {request}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConcreteHandlerA.handle_request refactored with the following changes:

print("%s process %s" % (self.__class__.__name__, request))
print(f"{self.__class__.__name__} process {request}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConcreteHandlerB.handle_request refactored with the following changes:

print("%s process %s" % (self.__class__.__name__, request))
print(f"{self.__class__.__name__} process {request}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConcreteHandlerC.handle_request refactored with the following changes:

l = []
l.append(TerminalExpression())
l = [TerminalExpression()]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 82-83 refactored with the following changes:

Comment on lines -83 to +87
if self.i < self.n:
i = self.i
self.i += 1
return i
else:
if self.i >= self.n:
raise StopIteration()
i = self.i
self.i += 1
return i
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function YRange.__next__ refactored with the following changes:

return "ProductA: %s" % self.name
return f"ProductA: {self.name}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function AbstractProductA.__str__ refactored with the following changes:

return "ProductB: %s" % self.name
return f"ProductB: {self.name}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function AbstractProductB.__str__ refactored with the following changes:

print('-'.join(item for item in self.__parts))
print('-'.join(self.__parts))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Product.show refactored with the following changes:

return self.__instance
else:
return self.__instance
return self.__instance
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Singleton.__call__ refactored with the following changes:

self.__flyweights = dict()
self.__flyweights = {}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FlyweightFactory.__init__ refactored with the following changes:

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