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
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
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
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
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
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
*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
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
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
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
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
11 matches
Mail list logo