rob-smallshire / eseries

Find value in the E-series (E6, E12, E24, etc) used for electronic components values.
MIT License
18 stars 2 forks source link

Class based implementation #9

Open semiversus opened 9 months ago

semiversus commented 9 months ago

I started experimenting with a class based implementation. This is not a proposal to change the API - just wanted do hear what you think. You find the implementation here: https://github.com/semiversus/eseries/tree/class_based

In case of going towards a class based implementation, it would be easy to keep the API backwards compatible by providing wrapper functions:

def find_greater_than_or_equal(series_key, value):
  return series_key.find_greater_than_or_equal(value)