On Sat, Jun 7, 2014 at 2:43 PM, Ricordisamoa <[email protected]>
wrote:

> It seems to me that the current trend is to use the same attribute as both
> a getter and a setter, e.g. Page.text.
> Is this true? Should we convert Claim.getTarget() and .setTarget() to just
> "target" (which is already used internally)?
>

Using simple data attributes until more complexity is needed and then
switching to Python properties is definitely more Pythonic than using
Java-style getters and setters.

Consistency of style across the entire API will help consumers understand
it more easily.

On Sun, Jun 8, 2014 at 4:49 AM, Amir Ladsgroup <[email protected]> wrote:

>
> At the end I suggest to work on the standards (page.text instead of
> page.put() ) but keep compat compatibility. i.e. make a function like this
> in Page class:
> def put(*args):
>     page.text = args[0]
>     page.save(args[1:])
>

Unless you want to support this syntax forever, you might want to consider
either separating it into a compatibility layer or at least clearly marking
it in the documentation as something which is deprecated and won't be
supported forever.  Otherwise you're permanently incurring the cost of the
increased API surface area.

Tom
_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to