go-python / gpython

gpython is a python interpreter written in go "batteries not included"
BSD 3-Clause "New" or "Revised" License
869 stars 95 forks source link

Adding missing __len__ method to dict objects #171

Closed kellrott closed 2 years ago

kellrott commented 2 years ago

Old behavior:

len({"a" : 1, "b" : 2})

TypeError: "object of type 'dict' has no len()"

New behavior returns the number of elements in the dict

codecov[bot] commented 2 years ago

Codecov Report

Merging #171 (849af0e) into master (f712a5d) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #171   +/-   ##
=======================================
  Coverage   72.89%   72.90%           
=======================================
  Files          71       71           
  Lines       11682    11683    +1     
=======================================
+ Hits         8516     8517    +1     
  Misses       2595     2595           
  Partials      571      571           
Impacted Files Coverage Δ
py/dict.go 77.55% <100.00%> (+0.23%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f712a5d...849af0e. Read the comment docs.