On Mon, Jun 9, 2014 at 12:01 AM, Tom Morris <tfmor...@gmail.com> wrote:

> On Sat, Jun 7, 2014 at 2:43 PM, Ricordisamoa <ricordisa...@openmailbox.org
> > 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 <ladsgr...@gmail.com>
>  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.
>
Of course I'm in favor of writing down this in documentation (or
development guideline) and ask people not to use it.


>
> Tom
>
> _______________________________________________
> Pywikipedia-l mailing list
> Pywikipedia-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
>


-- 
Amir
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to