← 输入框|github.com|刷新
Skip to content

Issues in dictionaries #2230

Closed
Closed

Description

@kabra1110
from lpython import i32

def test():
    d: dict[str, i32] = {'a': 1, 'a': 1}
    print(len(d))   # 2
    d.pop('a')
    print(len(d))   # 1
    d.pop('a')
    print(len(d))   # 0
    d.pop('a')
    print(len(d))   # -1

test()
from lpython import i32

def test():
    d: dict[i32, i32] = {2: 1, 2: 1}
    print(len(d))   # 1
    d.pop(2)
    print(len(d))   # 0
    d.pop(2)
    print(len(d))   # -1
    d.pop(2)
    print(len(d))   # -2

test()

Activity

  1. self-assigned this
    on Jul 30, 2023
  2. changed the title [-]Issues in separate chaining implementation of dictionaries[/-] [+]Issues in dictionaries[/+] on Jul 30, 2023
  3. rebcabin commented on Aug 11, 2023

    @rebcabin
    Contributor
  4. certik commented on Aug 11, 2023

    @certik
    Contributor

    Yes, I told Gagandeep to still put his latin letters name into his github as a "backup". :) I think it is a good thing to use the native alphabet for a name, I do the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions