Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107745 > unrolled thread

Re: Pythonic style (was: Differences between Class(Object) and Class(Dict) for dictionary usage?)

Started byChristopher Reimer <christopher_reimer@icloud.com>
First post2016-04-27 20:07 -0700
Last post2016-04-27 20:07 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Pythonic style (was: Differences between Class(Object) and Class(Dict) for dictionary usage?) Christopher Reimer <christopher_reimer@icloud.com> - 2016-04-27 20:07 -0700

#107745 — Re: Pythonic style (was: Differences between Class(Object) and Class(Dict) for dictionary usage?)

FromChristopher Reimer <christopher_reimer@icloud.com>
Date2016-04-27 20:07 -0700
SubjectRe: Pythonic style (was: Differences between Class(Object) and Class(Dict) for dictionary usage?)
Message-ID<mailman.163.1461812854.32212.python-list@python.org>
On 4/27/2016 7:07 PM, Ben Finney wrote:
> I would say the latter is more Pythonic, because it:
>
> * Better conveys the intention (“set the value of the ‘self.key’
>    attribute”).
>
> * Uses the built-in mechanisms of Python (don't invoke magic attributes,
>    instead use the system that makes use of them behind the scenes).
>
> * Expresses that intention more concisely (fewer terms).
>
> * Expresses that intention more clearly (less syntactic noise).

In short,  my original code before I turned it into a separate 
dictionary. *sigh*

Thank you,

Chris R.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web