Installing mypyc from the mypy repo seems to actually fix the empty assertion errors, I get tracebacks now!
This is one of them:
Traceback (most recent call last):
File "build/setup.py", line 5, in <module>
ext_modules=mypycify(['hikari'], opt_level="3"),
File "/home/davfsa/coding/mypy/mypyc/build.py", line 485, in mypycify
groups, group_cfilenames = mypyc_build(
File "/home/davfsa/coding/mypy/mypyc/build.py", line 398, in mypyc_build
group_cfiles, ops_text = generate_c(all_sources, options, groups, fscache,
File "/home/davfsa/coding/mypy/mypyc/build.py", line 200, in generate_c
modules, ctext = emitmodule.compile_modules_to_c(
File "/home/davfsa/coding/mypy/mypyc/codegen/emitmodule.py", line 414, in compile_modules_to_c
modules = compile_modules_to_ir(result, mapper, compiler_options, errors)
File "/home/davfsa/coding/mypy/mypyc/codegen/emitmodule.py", line 258, in compile_modules_to_ir
scc_ir = compile_scc_to_ir(trees, result, mapper, compiler_options, errors)
File "/home/davfsa/coding/mypy/mypyc/codegen/emitmodule.py", line 209, in compile_scc_to_ir
modules = build_ir(
File "/usr/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/home/davfsa/coding/mypy/mypyc/irbuild/main.py", line 82, in build_ir
transform_mypy_file(builder, module)
File "/home/davfsa/coding/mypy/mypyc/irbuild/main.py", line 125, in transform_mypy_file
builder.accept(node)
File "/home/davfsa/coding/mypy/mypyc/irbuild/builder.py", line 175, in accept
node.accept(self.visitor)
File "/home/davfsa/coding/mypy/mypy/nodes.py", line 959, in accept
return visitor.visit_class_def(self)
File "/home/davfsa/coding/mypy/mypyc/irbuild/visitor.py", line 104, in visit_class_def
transform_class_def(self.builder, cdef)
File "/home/davfsa/coding/mypy/mypyc/irbuild/classdef.py", line 97, in transform_class_def
transform_method(builder, cdef, non_ext, get_func_def(stmt))
File "/home/davfsa/coding/mypy/mypyc/irbuild/function.py", line 121, in transform_method
handle_non_ext_method(builder, non_ext, cdef, fdef)
File "/home/davfsa/coding/mypy/mypyc/irbuild/function.py", line 440, in handle_non_ext_method
func_ir, func_reg = gen_func_item(builder, fdef, name, builder.mapper.fdef_to_sig(fdef), cdef)
File "/home/davfsa/coding/mypy/mypyc/irbuild/function.py", line 286, in gen_func_item
builder.add_var_to_env_class(var, rtype, env_for_func, reassign=False)
File "/home/davfsa/coding/mypy/mypyc/irbuild/builder.py", line 1099, in add_var_to_env_class
attr_target = AssignmentTargetAttr(base.curr_env_reg, var.name)
File "/home/davfsa/coding/mypy/mypyc/irbuild/context.py", line 129, in curr_env_reg
assert self._curr_env_reg is not None
hikari/messages.py:334: AssertionError:
The interesting thing is that _curr_env_reg
never gets set to anything else but None
. Is there something I'm missing?
hi, on pytest-dev/pluggy#326
i obbserve
Traceback (most recent call last):
File "mypyc/irbuild/builder.py", line 169, in accept
File "mypy/nodes.py", line 1245, in accept
File "mypyc/irbuild/visitor.py", line 160, in visit_try_stmt
File "mypyc/irbuild/statement.py", line 542, in transform_try_stmt
File "mypyc/irbuild/statement.py", line 522, in transform_try_finally_stmt
File "mypyc/irbuild/statement.py", line 466, in try_finally_resolve_control
File "mypyc/irbuild/builder.py", line 177, in add
File "mypyc/irbuild/ll_builder.py", line 101, in add
/home/ronny/Projects/RonnyPfannschmidt/pluggy/src/pluggy/_callers.py:59: AssertionError: Can't add to finished block
whats the suggested way to proceed
(Pdb) dist
<pluggy._entrypoints.DistFacade object at 0x7f95925220d0>
(Pdb) dist.__getattr__
<built-in method __getattr__ of DistFacade object at 0x7f95925220d0>
(Pdb) dist.__getattr__("version")
'3.4.1'
(Pdb) getattr(dist, "version")
*** AttributeError: 'DistFacade' object has no attribute 'version'
Hi, I just joined this platform, I am a beginner, and I want someone to guide me through process, I have read getting started but I am not getting to the link of how to register for this company.
Also, I wanna know that is it for those who are intermediate or for those who are beginners too.
Traceback (most recent call last):
File "mypyc/irbuild/classdef.py", line 99, in transform_class_def
File "mypyc/irbuild/function.py", line 110, in transform_method
File "mypyc/irbuild/function.py", line 412, in handle_non_ext_method
File "mypyc/irbuild/function.py", line 267, in gen_func_item
File "mypyc/irbuild/builder.py", line 1067, in add_var_to_env_class
File "mypyc/irbuild/context.py", line 125, in curr_env_reg
bla.py:49 AssertionError:
Reproduce the problem
import attr
@attr.s(auto_attribs=True)
class TestType:
thing: str
def foo(self) -> None:
lambda x: self.thing # problem with mypyc
Yet the following works
from dataclasses import dataclass
@dataclass
class TestType:
thing: str
def foo(self) -> None:
lambda x: self.thing
Hi, I'm Max Shvets. I'm investigating this issue: mypyc/mypyc#899
I have trouble creating a test case for usages of AnyStr
. I added the following to mypyc/test-data/run-misc.test
:
[case testAnyStr]
from typing import AnyStr
def f(x: AnyStr, y: AnyStr) -> AnyStr:
return x + y
[file driver.py]
from native import f
print(f("3", "4"))
[out]
34
However, when I try to run this test I get
run-misc.test:1160: error: Module "typing" has no attribute "AnyStr"
Does anyone know what might be the issue here?
typing
stub used for tests doesn't define AnyStr
. In fact, none of the extended stubs in fixtures define it either. I want to fix this by defining AnyStr
in mypyc/test-data/fixtures/typing-full.pyi
and using [typing fixtures/typing-full.pyi]
in the test. However, I noticed that adding [typing fixtures/typing-full.pyi]
to the test results in mypyc not seeing the definitions in the test. I'll continue to investigate this and would appreciate any support
However, I noticed that adding [typing fixtures/typing-full.pyi] to the test results in mypyc not seeing the definitions in the test
The reason was that I added [typing ...]
right after the [case ...]
, so the input
field of DataDrivenTestCase
was empty and nothing was written to native.py
How much python is required for gsoc?
Also, how much python machine learning is required for gsoc?
How can I contribute to gsoc like how can I find projects for contribution?