avrae / draconic

The Draconic language: a scripting language based off Python to run user scripts on the server safely.
MIT License
18 stars 9 forks source link

Add default arg to safe_dict.pop() #11

Closed Croebh closed 3 years ago

Croebh commented 3 years ago

Summary

Adds a default arg to safe_dict.pop() to match normal Python Dict.pop(). I gave the

Resolves https://github.com/avrae/avrae/issues/1575

The only part I was unsure of was not checking if the key was in the dict for changing the __approx_len__, but I figured it was approximate so I just didn't modify it.

Checklist

PR Type

codecov[bot] commented 3 years ago

Codecov Report

Merging #11 (ae9f714) into master (c63c3eb) will increase coverage by 0.18%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage   97.79%   97.97%   +0.18%     
==========================================
  Files          13       13              
  Lines        1860     1878      +18     
==========================================
+ Hits         1819     1840      +21     
+ Misses         41       38       -3     
Impacted Files Coverage Δ
draconic/types.py 89.20% <100.00%> (+1.58%) :arrow_up:
tests/test_limits.py 100.00% <100.00%> (ø)

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 c63c3eb...ae9f714. Read the comment docs.