Re: [BangPypers] problem with python classes

2013-05-09 Thread Noufal Ibrahim
hiharry danny writes: [...] > if this be the case , then without using inheritance property of OOP ,i,e, > without creating further new subclasses , how can I access other user > defined methods of ClassOne class via Class Two class. The ouput value will > be returned by a user defined method o

Re: [BangPypers] problem with python classes

2013-05-09 Thread steve
Hi, On Thursday 09 May 2013 09:11 PM, hiharry danny wrote: i have python 2.7.4..now suppose i have two new-style base classes , i.e. class ClassName(object): and the two base classes are related by __init__ constructor where the __init__ constructor of one base class is accessed by the __in

Re: [BangPypers] problem with python classes

2013-05-09 Thread Abdul Muneer
Hi, If it is necessary that the calculation has to be performed by ClassOne, use a classmethod. class ClassOne(object): def __init__(self, value): self.value = value @classmethod def calculate_value(cls, value): return new_value and in ClassTwo, change the r

Re: [BangPypers] BangPypers Digest, Vol 69, Issue 8

2013-05-09 Thread Jagadeesh N. Malakannavar
I tried to test the performance of list comprehension and map. I did not see much difference Here is my test localhost% python -mtimeit -s"sum(int(i) for i in '3245325')" 1000 loops, best of 3: 0.02 usec per loop localhost% python -mtimeit -s"sum(map(int, str(3245325)))" 1000 loops, best

[BangPypers] problem with python classes

2013-05-09 Thread hiharry danny
i have python 2.7.4..now suppose i have two new-style base classes , i.e. class ClassName(object): and the two base classes are related by __init__ constructor where the __init__ constructor of one base class is accessed by the __init property of the other base class , for example : class Clas

Re: [BangPypers] BangPypers Digest, Vol 69, Issue 7

2013-05-09 Thread Jagadeesh N. Malakannavar
Wonderful discussion. Thanks for all replies. To my eyes map() looked better so just used it. Yes list comprehension is better idea. Thanks On Thu, May 9, 2013 at 1:54 PM, wrote: > Send BangPypers mailing list submissions to > bangpypers@python.org > > To subscribe or unsubscribe via

[BangPypers] [JOBS] Python Developers needed in Gujarat (10)

2013-05-09 Thread Henil Patel
*Job Summary* Key Skills: Understanding of Object Oriented principles, SQL, hands-on experience writing software, Linux Experience: 1+ years of writing commercial level software *Job Description* We need hands-on, Python developers to deliver scalable, flexible, web-based data-management solut

[BangPypers] [Ticket #49] Another qn. THanks for the basic of basic qn\

2013-05-09 Thread Prashant R. Naik
On May 09, 2013 @ 01:51 pm, bangpypers-bounces+prashant=triconinfotech@python.org wrote: On 8 May 2013 23:00, Jagadeesh N. Malakannavar wrote: > I prefer to do it like this > a = list(str(3245325)) sum(map(int, a)) > 24 What does the map() gain you over basic list comprehension: s

[BangPypers] [Ticket #29] Another qn. THanks for the basic of basic qn\

2013-05-09 Thread Prashant R. Naik
On May 09, 2013 @ 01:50 pm, bangpypers-bounces+prashant=triconinfotech@python.org wrote: Gora Mohanty writes: > On 8 May 2013 23:00, Jagadeesh N. Malakannavar wrote: >> I prefer to do it like this >> > a = list(str(3245325)) > sum(map(int, a)) >> 24 > > What does the map() gain you

[BangPypers] [Ticket #27] A Comparison of Mocking Frameworks

2013-05-09 Thread Prashant R. Naik
On May 09, 2013 @ 01:50 pm, bangpypers-bounces+prashant=triconinfotech@python.org wrote: Hi everyone: A colleague pointed me to this comparison of mocking frameworks: http://garybernhardt.github.io/python-mock-comparison/ -- Sriram Belenix: www.belenix.o

[BangPypers] [Ticket #18] Another qn. THanks for the basic of basic qn\

2013-05-09 Thread Prashant R. Naik
On May 09, 2013 @ 01:50 pm, bangpypers-bounces+prashant=triconinfotech@python.org wrote: On 9 May 2013 07:32, Noufal Ibrahim wrote: > Gora Mohanty writes: > >> On 8 May 2013 23:00, Jagadeesh N. Malakannavar wrote: >>> I prefer to do it like this >>> >> a = list(str(3245325)) >> sum