Skip to content
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

feat: new ast-based helpers + fix has_args, has_decorators #203

Merged
merged 6 commits into from
May 13, 2024

Conversation

Dario-DC
Copy link
Contributor

@Dario-DC Dario-DC commented May 1, 2024

Checklist:

Closes #XXXXX

@@ -424,6 +436,20 @@ def _find_conditions(tree):

return [Node(test) for test in _find_conditions(self.tree)]

# Returs a Boolean indicating if node1 comes before node2
def is_ordered(self, node1, node2):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please, help me find a better name for this.

Copy link
Member

Choose a reason for hiding this comment

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

The name is fine as it is serving the intended purpose 👍️

@zairahira
Copy link
Member

Currently the is_ordered() method is checking for 2 statements. It would be better to allow variable number of statements to be checked.

TypeError: Node.is_ordered() takes 3 positional arguments but 5 were given

@zairahira
Copy link
Member

The method is also working perfect for non-consecutive statements. This could be mentioned in docs.

@zairahira
Copy link
Member

The updated changes are working now for a variable number of arguments in is_ordered()👍️

@Dario-DC Dario-DC marked this pull request as ready for review May 13, 2024 10:14
@Dario-DC Dario-DC requested a review from a team as a code owner May 13, 2024 10:14
@zairahira zairahira merged commit f2add99 into freeCodeCamp:main May 13, 2024
4 checks passed
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.

2 participants