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: Adds management module #1

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

feat: Adds management module #1

wants to merge 1 commit into from

Conversation

StephaneBereux
Copy link
Owner

xxx

@StephaneBereux
Copy link
Owner Author

/review

1 similar comment
@StephaneBereux
Copy link
Owner Author

/review

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Review summary

Thanks for the PR 🙏

Critical PR sections

  • [function-naming] detected in my_lib/management.py:L9

PR overview

  • 1 comment about [function-naming]
  • 1 comment about [missing-all-definition]
  • 1 comment about [for-loop]

Add the following reactions to this comment to let us know if:

  • 😕 the review missed something important

from typing import List


def makeUpper(welcome_sentence: str) -> str:
Copy link

Choose a reason for hiding this comment

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

I'm not so sure about the naming convention for this function 🤔

Pattern explanation 👈 Check here for reference.

Replacement example

Here is an example of how you could handle this:

# def processData(variance: float) -> float:
def compute_standard_deviation(variance: float) -> float:
	return sqrt(variance)

This comment is about [function-naming]. Add the following reactions on this comment to let us know if:

  • 👀 that doesn't seem right
  • 👎 this isn't important for you right now
  • 😕 that explanation wasn't clear

# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0> for full license details.

from typing import List

Copy link

Choose a reason for hiding this comment

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

It might be useful to set the __all__ attribute

Pattern explanation 👈 If the `__all__` is not set for a given module, a star import will import all objects in memory` Check here for reference.

Replacement example

Here is an example of how you could handle this:

__all__ = ["my_function"]

This comment is about [missing-all-definition]. Add the following reactions on this comment to let us know if:

  • 👀 that doesn't seem right
  • 👎 this isn't important for you right now
  • 😕 that explanation wasn't clear

def add_prefix(sentence_sequence: List[str], prefix: str) -> List[str]:
out = []
for sentence in sentence_sequence:
out.append(f"{prefix} {sentence}")
Copy link

Choose a reason for hiding this comment

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

This for loop seems to be unnecessary, perhaps a list comprehension would do?

Pattern explanation 👈 In Python, for loops introduce a compilation bottleneck for the interpreter. When they can be replaced by comprehension syntax, avoiding them can save some serious latency ⚡ Check here for reference.

Replacement example

Here is an example of how you could handle this:

# out = []
# for val in range(10): out.append(val ** 2)
out = [val ** 2 for val in range(10)]

This comment is about [for-loop]. Add the following reactions on this comment to let us know if:

  • 👀 that doesn't seem right
  • 👎 this isn't important for you right now
  • 😕 that explanation wasn't clear

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