diff options
author | Hernan Grecco <hernan.grecco@gmail.com> | 2013-01-25 00:05:11 +0100 |
---|---|---|
committer | Hernan Grecco <hernan.grecco@gmail.com> | 2013-01-25 00:05:11 +0100 |
commit | 6112916671f39a180018b75d9eae7898d9ddac0e (patch) | |
tree | 5eb53b6c4634b1c9e6c8fe955614a19518b1d2fd /.gitignore | |
parent | bc73dfda18ba1ac127d39db838c4d24a79b68647 (diff) | |
download | pint-6112916671f39a180018b75d9eae7898d9ddac0e.tar.gz |
Deduplicate units from candidates search
Previous to this commit, _parse_candidate was returning an iterable of
possible units, including prefixes and suffixes combinations.
If multiple values where returned, the calling functions were issuing
a warning to inform the user that there are multiple matches for a
given string. For example, if a user defines a new unit ms, it could
be mistaken with prefix=mili, unit=second. However, as the registry
stores also prefixed units many times a duplication is not a real
problem (eg. prefix=kilo, unit=gram and unit=kilogram).
To avoid issuing false warnings a deduplication step was added to
parse candidates. In the future, a more efficient alternative will be
to block adding colliding units to the registry.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions