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

[BUG]: Mojo fails to handle imported python functions with keyword arguments #964

Closed
oskgo opened this issue Sep 30, 2023 · 5 comments
Closed
Assignees
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-lang Tag for all issues related to language. mojo-python-interop mojo-repo Tag all issues with this label

Comments

@oskgo
Copy link

oskgo commented Sep 30, 2023

Bug description

Mojo behaves unexpectedly when calling python code with keyword arguments.

The code is seemingly never called, and if the result is stored in a variable code that interacts with this variable also starts acting unexpectedly.

In the example code below I would expect to either get an error, or have 0 and 200 printed, but instead nothing is printed.

Steps to reproduce

test.mojo:

from python import Python

def main():
    Python.add_to_path(".")
    let p = Python.import_module("test").foo(a=0)
    print(p)
    p = 200
    print(p)

test.py:

def foo(a):
    return a

System information

- Windows 11 with Ubuntu in WSL
- mojo 0.3.1 (a3eed7c8)
- modular 0.1.4 (6b54d308)
@oskgo oskgo added bug Something isn't working mojo Issues that are related to mojo labels Sep 30, 2023
@jackos
Copy link
Collaborator

jackos commented Sep 30, 2023

Thanks for raising @oskgo this is being worked on

@ematejska ematejska added mojo-stdlib Tag for issues related to standard library mojo-python-interop and removed mojo-stdlib Tag for issues related to standard library labels Oct 3, 2023
@jackos jackos added the mojo-lang Tag for all issues related to language. label Oct 3, 2023
@gryznar
Copy link
Contributor

gryznar commented Jan 24, 2024

@jackos is fix to that going to be introduced in 0.7?

@stumpOS stumpOS assigned stumpOS and unassigned stumpOS Feb 8, 2024
@karthikgk97
Copy link

Any update on this issue?

@XRTIDE
Copy link

XRTIDE commented Feb 24, 2024

0.7版本尚未修复!

@laszlokindrat
Copy link
Contributor

This should work as of version 24.2. Please open a new ticket if you run into any problems!

@ematejska ematejska added the mojo-repo Tag all issues with this label label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo Issues that are related to mojo mojo-lang Tag for all issues related to language. mojo-python-interop mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

8 participants