DoubleSpring seeks passionate PYTHON / DJANGO developers with experience in
building or contributing to Open Source projects. We are constantly rolling
out new products so the right individual would be able to write clean code
and work in a fast pace environment.
We highly value native ability, pa
Ladies and Gentlemen,
The third Saturday of every month is like an amazing party that I look
forward to every month now. Almost 50 of us have been consistently coming
to the meetup since the past 5 months. One of the things that I love about
Bangalore. :)
This month's meetup had a special moment.
On Fri, May 23, 2014 at 5:26 PM, Navin Kabra wrote:
> "Mandar Vaze / मंदार वझे" writes:
>
> > Code 1:
> > ...
> > return dict(fname=fname, lname=lname, saluation=salutation,
> > gender=gender, addr1=addr1, addr2=addr2,
> > city=city, state=state, country=country)
>
> First of a
"Mandar Vaze / मंदार वझे" writes:
> Code 1:
> ...
> return dict(fname=fname, lname=lname, saluation=salutation,
> gender=gender, addr1=addr1, addr2=addr2,
> city=city, state=state, country=country)
First of all, both functions are returning a single value, a single
dict. So the
On Fri, May 23 2014, kracekumar ramaraju wrote:
> Rohit
>
> Probably ease of writing may be right here.
It's also more future proof. An attribute can be replaced by a property
which implements access controls and other things without breaking API
contracts. It's harder to do that while subscript
Rohit
Probably ease of writing may be right here.
On Fri, May 23, 2014 at 1:46 PM, Rohit Chormale wrote:
> R u sure @ 'ease of access' or is it 'ease of writing'?
>
>
> On Fri, May 23, 2014 at 1:43 PM, kracekumar ramaraju <
> kracethekingma...@gmail.com> wrote:
>
> > Yes. Attributes are fixed.
R u sure @ 'ease of access' or is it 'ease of writing'?
On Fri, May 23, 2014 at 1:43 PM, kracekumar ramaraju <
kracethekingma...@gmail.com> wrote:
> Yes. Attributes are fixed. The advantage over dictionary is ease of access
> like p.foo rather than p['foo'] or p.get('foo').
>
>
> On Fri, May 23,
Yes. Attributes are fixed. The advantage over dictionary is ease of access
like p.foo rather than p['foo'] or p.get('foo').
On Fri, May 23, 2014 at 1:34 PM, Noufal Ibrahim KV
wrote:
> On Fri, May 23 2014, kracekumar ramaraju wrote:
>
> > You can use namedtuple.
> >
> > from collections import na
On Fri, May 23 2014, kracekumar ramaraju wrote:
> You can use namedtuple.
>
> from collections import namedtuple
> Person = namedtuple('Person', ['foo', 'bar', 'baz'])
> p = Person(foo='foo', bar='bar', baz='baz')
[...]
Much better although with namedtuple, the attributes are fixed aren't
they?
You can use namedtuple.
from collections import namedtuple
Person = namedtuple('Person', ['foo', 'bar', 'baz'])
p = Person(foo='foo', bar='bar', baz='baz')
print p.foo
'foo'
On Fri, May 23, 2014 at 1:23 PM, Noufal Ibrahim KV
wrote:
> On Fri, May 23 2014, Rohit Chormale wrote:
>
> > How is it
On Fri, May 23 2014, Mandar Vaze / मंदार वझे wrote:
> Currently I came across the code that returned 9 values (return statement
> spanned 5 lines due to pep8 limitation of 79 characters per line)
>
> The function returns various values that are used by the template to render
> HTML
>
> To give you
On Fri, May 23 2014, Rohit Chormale wrote:
> How is it if you use DataContainer class & set attributes of that class.
> Something like,
>
> class Data(object):
>
> def __init__(self, **kwargs):
> object.__setattr__(self, 'attribs', kwargs)
>
> def __getattr__(self, item):
> if
How is it if you use DataContainer class & set attributes of that class.
Something like,
class Data(object):
def __init__(self, **kwargs):
object.__setattr__(self, 'attribs', kwargs)
def __getattr__(self, item):
if item in self.attribs:
return self.attribs[item]
13 matches
Mail list logo