-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Adress issue with intern
not working
#725
Conversation
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.
Looks like MyPy is saying we have some # type: ignore
comments which are no longer needed, but the change otherwise looks good to me.
Thanks, I've corrected all these side errors in #723. Would you like me to back port them in here for the PR to pass CI? I was hoping #723 would go first, but I guess it is much to go through :) |
Ah yeah, I haven't had a chance to go through that yet. If it's not too much, you could pull in at least the 2 changes that are causing MyPy to error here. I will try to take a look at the other one this week if I can. |
28c490e
to
c894265
Compare
Done, thanks |
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.
Sorry I merged your other PR and created a conflict on the changelog. I also think you can just simplify the # type: ignore
comments for most cases by just removing the comments.
@@ -3527,7 +3527,7 @@ def _const_type_to_py_ast(form: IType, ctx: GeneratorContext) -> GeneratedPyAST: | |||
|
|||
ctor_args = [] | |||
ctor_arg_deps: List[ast.AST] = [] | |||
for field in attr.fields(tp): # type: ignore[arg-type] | |||
for field in attr.fields(tp): # type: ignore[arg-type, misc, unused-ignore] |
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.
for field in attr.fields(tp): # type: ignore[arg-type, misc, unused-ignore] | |
for field in attr.fields(tp): |
I think you can just do this rather than adding unused-ignore
code.
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.
Unfortunately ignore
by itself does not suffice if there is an unused-ignore
error reported in some python versions (e.g. 3.8) but not others (3.11), it has to be added to the list:
please see below how type: ignore
reports an unused-ignore error for runtime.py in 3.8 but not in 3.11.
3.8:
py38-mypy: commands[0]> mypy --config-file=C:\src\basilisp/pyproject.toml -p basilisp
src\basilisp\lang\runtime.py:1958: error: Unused "type: ignore" comment [unused-ignore]
src\basilisp\lang\compiler\generator.py:3530: error: Unused "type: ignore[misc]" comment [unused-ignore]
src\basilisp\lang\compiler\analyzer.py:336: error: Unused "type: ignore" comment [unused-ignore]
Found 3 errors in 3 files (checked 47 source files)
3.11
py311-mypy: commands[0]> mypy --config-file=C:\src\basilisp/pyproject.toml -p basilisp
src\basilisp\lang\runtime.py:1958: error: Argument 1 to "intern" of "Var" has incompatible type "Namespace | None"; expected "Namespace | Symbol" [arg-type]
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.
Ah, that's frustrating for us. Thanks for the explanation.
c894265
to
7367783
Compare
I've rebased from |
Hi,
could you please review patch to fix
intern
. It addresses #724.It was using var methods such as
.set-root
that don't exist.Tests included.
Thanks