Skip to content

More examples#40

Merged
pierrevalade merged 16 commits intomainfrom
more-examples
Feb 5, 2025
Merged

More examples#40
pierrevalade merged 16 commits intomainfrom
more-examples

Conversation

@pierrevalade
Copy link
Contributor

@guillaq I'm running into this error:


The linter (Ruff) is warning about a naming issue in your code. Specifically, it's showing error code A002 which means you're using input as a parameter name, but input is actually a built-in Python function.

In Python, input() is a built-in function used to get user input from the console. When you use input as a parameter name:

async def get_capital_info(input: CityInput) -> Run[CapitalOutput]:

You're "shadowing" (hiding) the built-in input() function within the scope of your function. This is generally considered bad practice because:

  1. It can lead to confusion
  2. It prevents access to the built-in input() function within your function's scope
  3. It makes the code less maintainable

To fix this, you should rename the parameter to something more specific, like:

  1. city_input
  2. request
  3. query

Screenshot 2025-02-05 at 11 03 25

what do you think?

@pierrevalade pierrevalade requested a review from guillaq February 5, 2025 10:06
Pierre added 2 commits February 5, 2025 14:11
- all the examples are now in examples/ folder, numbered
- all assets are in examples/assets
- update examples/README
@pierrevalade
Copy link
Contributor Author

@guillaq ready for a first review! lots of changes, trying to add more documentation to make our SDK easier to understand with real-life examples. thanks!

guillaq
guillaq previously approved these changes Feb 5, 2025
@pierrevalade
Copy link
Contributor Author

@guillaq thanks for the feedback, ready for another review!

@pierrevalade pierrevalade requested a review from guillaq February 5, 2025 17:25
Copy link
Collaborator

@guillaq guillaq left a comment

Choose a reason for hiding this comment

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

@pierrevalade pierrevalade merged commit ced63fe into main Feb 5, 2025
5 checks passed
@pierrevalade pierrevalade deleted the more-examples branch February 5, 2025 19:50
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