faif / python-patterns

A collection of design patterns/idioms in Python
40.45k stars 6.94k forks source link

Update flyweight pattern #291

Closed gyermolenko closed 5 years ago

gyermolenko commented 5 years ago

Current example of Flyweight has actually two of them: with overriding __new__ and with metaclass. I found the one with metaclass especially hard to follow and decided to split-up the examples.

What this PR does:

codecov-io commented 5 years ago

Codecov Report

Merging #291 into master will increase coverage by 0.17%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #291      +/-   ##
==========================================
+ Coverage   45.51%   45.69%   +0.17%     
==========================================
  Files          41       42       +1     
  Lines        1584     1578       -6     
==========================================
  Hits          721      721              
+ Misses        863      857       -6
Impacted Files Coverage Δ
...tterns/structural/flyweight_with_metaclass__py3.py 0% <0%> (ø)
patterns/structural/flyweight__py3.py 0% <0%> (ø) :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 27395d8...76bc024. Read the comment docs.