carlospalol / money

Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Providing datetime for currency conversion

cool-RR opened this issue · comments

I want to write an app which converts currencies according to the exchange rate on that day. I wish the exchange API would allow a datetime on the conversion call. Also, making it open for arbitrary arguments might be a good idea, because other people might have other needs. (e.g. if someone uses different exchange providers who have different rates, they might want to pass the exchange provider to get the correct rate for it.)

You mean Money.to(self, currency, _args, *_kwargs) and passing them to quotation() right? Agreed we need that for more flexibility.

Yes. Only caveat with that is that it precludes you from adding arguments
to that method in the future. It might be worth it though.

On Sun, Sep 7, 2014 at 12:25 AM, Carlos Palol notifications@github.com
wrote:

You mean Money.to(self, currency, _args, *_kwargs) and passing them to
quotation() right? Agreed we need that for more flexibility.


Reply to this email directly or view it on GitHub
#7 (comment).

Well, at least new "official" arguments could be added (as kwargs exclusively). In any other scenario, sending new positional arguments would break existing custom backends anyway.

Probably even better to close down positional args altogether, also for custom backends: Money.to(self, currency, **kwargs) and BackendBase.quotation(self, origin, target, **kwargs).

I agree that blocking positional arguments is better.

On Sun, Sep 7, 2014 at 2:53 AM, Carlos Palol notifications@github.com
wrote:

Well, at least new "official" arguments could be added (as kwargs
exclusively). In any other scenario, sending new positional arguments would
break existing custom backends anyway.

Probably even better to close down positional args altogether, also for
custom backends: Money.to(self, currency, *_kwargs) and BackendBase.quotation(self,
origin, target, *_kwargs).


Reply to this email directly or view it on GitHub
#7 (comment).