-
Notifications
You must be signed in to change notification settings - Fork 302
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
Data Structure: Queue [Python] #395
Conversation
class Queue: | ||
def __init__(self): | ||
self.queue=[] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code does not comply to PEP8.
Origin: PEP8Bear, Section: all.autopep8
.
The issue can be fixed by applying the following patch:
--- a/tmp/tmpkyj0v92m/queue/python/queue.py
+++ b/tmp/tmpkyj0v92m/queue/python/queue.py
@@ -1,6 +1,6 @@
class Queue:
def __init__(self):
- self.queue=[]
+ self.queue = []
def is_empty(self):
return self.queue==[]
def is_empty(self): | ||
return self.queue==[] | ||
|
||
def enqueue(self, item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code does not comply to PEP8.
Origin: PEP8Bear, Section: all.autopep8
.
The issue can be fixed by applying the following patch:
--- a/tmp/tmpkyj0v92m/queue/python/queue.py
+++ b/tmp/tmpkyj0v92m/queue/python/queue.py
@@ -3,7 +3,7 @@
self.queue=[]
def is_empty(self):
- return self.queue==[]
+ return self.queue == []
def enqueue(self, item):
self.queue.insert(0, item)
class Queue: | ||
def __init__(self): | ||
self.queue=[] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E225 missing whitespace around operator
Origin: PycodestyleBear (E225), Section: all.autopep8
.
def is_empty(self): | ||
return self.queue==[] | ||
|
||
def enqueue(self, item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E225 missing whitespace around operator
Origin: PycodestyleBear (E225), Section: all.autopep8
.
For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!
Fixes #55
By submitting this pull request I confirm I've read and complied with the
below declarations.
{Tag}: Add {Algorithm/DS name} [{Language}]
, notUpdate README.md
orAdded new code
.After you submit your pull request, DO NOT click the 'Update Branch' button.