Skip to content

dict.get() does not take default argument correctly. #1684

Open
@faze-geek

Description

@faze-geek
def f():
    b:dict[i32,i32] = {1:2}
    print(b.get(3))
    print(b.get(3,100))
f()

(lp) C:\Users\kunni\lpython>python try.py
None                    # When default argument is not given.
100                     # When default argument is given the key 3 is expected to take value 100.

(lp) C:\Users\kunni\lpython>src\bin\lpython try.py
3670136                # Expected since Lpython assigns garbage value for i : i32 declarations. 
3670136                # Unexpected 100 should be assigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvmLLVM related changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions