microsoft / microsoft/pxt-microbit
Array isn't getting inferred in python
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
Describe the bug
This is a user reported bug from Twitter - https://twitter.com/JudianneTeach/status/1328887954333261825
The script is trying to remove an item from an array. After fixing an initial syntax error, we still can't pop an item out of the array.
To Reproduce
Steps to reproduce the behavior:
- Open this script: https://makecode.microbit.org/_7rgXkF8yD0Kj
- There's an error - can't find function "letter_bag.pop", even though pop is a supported array function


micro:bit version (please complete the following information):
not hardware related
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked MakeCode script first and reproduce the missing letter_bag.pop error in Python mode. Trace how the array is inferred and how supported array methods are resolved; done means the script recognizes pop without the reported function error and the regression is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100