microsoft / microsoft/pxt-microbit

python dictionary has no method clear()

Open
#3,850 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

apis P2 python
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Describe the bug
In python, dictionary objects have no method clear()

To Reproduce

d = {'x': 1}
d.clear() # offending line

Expected behavior
clear() method should work.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Mozilla Firefox 84.0.2

Additional context
Happens both on master and on makecode website

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with d = {'x': 1} and d.clear() in the MakeCode website or on master. Trace how Python dictionary methods are represented and implemented, then verify that clear() works in both reported environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.