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

Support test_code to add pyright-config comment #98

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

F-park
Copy link
Contributor

@F-park F-park commented Jan 19, 2024

New feature

support test_code to add pyright-config as below.

## End of test code ##
# pyright: analyzeUnannotatedFunctions=false

Bug fix

disable user to modify pyright-config.

@F-park
Copy link
Contributor Author

F-park commented Jan 19, 2024

How can I fix the test?

I should rewrite the test to make it pass

@laike9m
Copy link
Owner

laike9m commented Jan 19, 2024

Could you describe what problems you're trying to solve, and what other ways you have considered (if any)? Thanks.

@F-park
Copy link
Contributor Author

F-park commented Jan 19, 2024

Could you describe what problems you're trying to solve, and what other ways you have considered (if any)? Thanks.

class MyClass:
    def __init__(self, x: int) -> None:
        self.x = x

    # TODO: Fix the type hints of `copy` to make it type check
    def copy(self):
        copied_object = MyClass(x=self.x)
        return copied_object

It can pass the challenge unexpectedly without return_value annoating


and you said Enabling strict mode would break other challenges in #89, the PR can solve it.

@laike9m
Copy link
Owner

laike9m commented Jan 26, 2024

Thanks for the PR.

Surely there's value in enabling the configs, however it also brings more complexity. At this point, I don't think it's worth adding it just to fix a tiny problem.

With that said, in the future it might become more useful, so I'll keep this open and re-evaluate when the time comes. Hope you can understand.

@laike9m laike9m added the enhancement New feature or request label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants