On Mon, Sep 7, 2009 at 9:02 PM, Jan Kaliszewski wrote:
> 08-09-2009 o 02:15:10 Steven D'Aprano wrote:
>> ... what's wrong with this?
> a['xyz'] = something['blablabla'] + somethingelse['foobar']
> b['ababababa'] += afun(bobo['dodo']['kookoo'] * pofopofo['gh'][0]['a'])
> cupu['abc'] = (kukumunu['
On Mon, Sep 7, 2009 at 6:02 PM, Jan Kaliszewski wrote:
...
>
> I think it depends how often people need to implement such boiler-plate
> code for themselves. Now I see that this thread is not very popular, so
> indeed maybe you are right... Though it'd be nice to have OOTB such
> a factory in `coll
08-09-2009 o 02:15:10 Steven D'Aprano wrote:
On Mon, 7 Sep 2009 09:37:35 am Jan Kaliszewski wrote:
06-09-2009 o 20:20:21 Ethan Furman wrote:
> ... I love being able to type
>
>current_record.full_name == last_record.full_name
>
> instead of
>
>current_record['full_name'] == last_re
06-09-2009 o 20:20:21 Ethan Furman wrote:
In the dbf module I wrote, I use both the attribute access and the key
lookup. The attribute access is great for interactive use, and for all
the routines that play with the tables we have at work, where all the
field names are indeed known at com
Steven D'Aprano wrote:
On Fri, 04 Sep 2009 22:51:39 -0700, Ken Newton wrote:
I would think this is much more than just copy from other language
styles or 'just' a syntax change -- the apparent widespread use would
hint at a deeper need.
"Apparent" is the key word there. There are lots of peo
05-09-2009 Steven D'Aprano wrote:
On Fri, 04 Sep 2009 22:37:15 +0200, Jan Kaliszewski wrote:
Named tuples (which indeed are really very nice) are read-only, but the
approach they represent could (and IMHO should) be extended to some kind
of mutable objects.
[snip]
What sort of extensions di
On Fri, 04 Sep 2009 22:51:39 -0700, Ken Newton wrote:
> On Fri, Sep 4, 2009 at 9:49 PM, Steven
> D'Aprano wrote: ...
>>
>>> The old discussion, the above link points to, shows that such a
>>> dot-accessible dict-like class is something that many people need and
>>> repeatedly implemet it (more or
On Fri, Sep 4, 2009 at 9:49 PM, Steven
D'Aprano wrote:
...
>
>> The old discussion, the above link points to, shows that such a
>> dot-accessible dict-like class is something that many people need and
>> repeatedly implemet it (more or less perfectly) for themselves.
>
> I think it's something whic
On Fri, 04 Sep 2009 22:37:15 +0200, Jan Kaliszewski wrote:
> Named tuples (which indeed are really very nice) are read-only, but the
> approach they represent could (and IMHO should) be extended to some kind
> of mutable objects.
What do you mean "read-only"? Do you mean immutable?
What sort of
On Fri, Sep 4, 2009 at 4:37 PM, Jan Kaliszewski wrote:
> 04-09-2009 Ken Newton wrote:
>
>> I like this version very much. I'm ready to put this into practice to see
>> how it works in practice.
>
> [snip]
>
> Not only you (Ken) and me. :-) It appears that the idea is quite old. Nick
> Coghlan repl
04-09-2009 Ken Newton wrote:
I like this version very much. I'm ready to put this into practice to see
how it works in practice.
[snip]
Not only you (Ken) and me. :-) It appears that the idea is quite old. Nick
Coghlan replied at python-id...@python.org:
Jan Kaliszewski wrote:
What do you
I like this version very much. I'm ready to put this into practice to see
how it
works in practice.
A minor point: I envision this to be used in a context where all key values
are
strings (legal attribute identifiers). But constructing an AttrClass from a
dict
or setting values directly with the
Ken Newton wrote: ...
I would appreciate comments on this code. First, is something like
this already done? Second, are there reasons for not doing this? ...
class AttrClass(object):
...
def __repr__(self):
return "%s(%s)" % (self.__class__.__name__, self.__dict__.__repr__()
Jan Kaliszewski wrote:
[originally from python-list@python.org,
crossposted to python-id...@python.org]
04-09-2009 o 00:46:01 Ken Newton wrote:
I have created the following class definition with the idea of making
a clean syntax for non-programmers to created structured data within a
python
[originally from python-list@python.org,
crossposted to python-id...@python.org]
04-09-2009 o 00:46:01 Ken Newton wrote:
I have created the following class definition with the idea of making
a clean syntax for non-programmers to created structured data within a
python environment.
I would ap
Ken Newton wrote:
> class AttrClass(object):
> """AttrClass lets you freely add attributes in nested manner"""
>
> def __init__(self):
> pass
> def __setitem__(self, key, value):
> return self.__dict__.__setitem__(key, value)
> def __repr__(self):
> return
On Thu, Sep 3, 2009 at 4:30 PM, Steven D'Aprano <
st...@remove-this-cybersource.com.au> wrote:
> On Thu, 03 Sep 2009 15:46:01 -0700, Ken Newton wrote:
>
> > I have created the following class definition with the idea of making a
> > clean syntax for non-programmers to created structured data withi
On Thu, 03 Sep 2009 15:46:01 -0700, Ken Newton wrote:
> I have created the following class definition with the idea of making a
> clean syntax for non-programmers to created structured data within a
> python environment.
What do you expect non-programmers to do with this class, without
programmi
I have created the following class definition with the idea of making
a clean syntax for non-programmers to created structured data within a
python environment.
I would appreciate comments on this code. First, is something like
this already done? Second, are there reasons for not doing this? If
t
19 matches
Mail list logo