On Fri, 29 Apr 2016 07:47 pm, San wrote:
> Dear Group,
>
> Please explain the following in details.
>
> "
> def __init__(self,cls):
> self.cls = cls
The answer is the same as the answer you were given when you asked this
question on the tutor mailing list. Di
> On 2016-04-29, at 11:47, San wrote:
>
> Dear Group, please explain the following in details. Thanks in Advance.
>
> def __init__(self,cls):
>self.cls = cls
Is this homework? Why don't you explain it first in your own words, then let us
comment on it?
Dear Group,
Please explain the following in details.
"
def __init__(self,cls):
self.cls = cls
"
Thanks in Advance.
San
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday 27 April 2016 02:59, Chris Kaynor wrote:
> On Tue, Apr 26, 2016 at 9:32 AM, Steven D'Aprano
> wrote:
>
>> Actually immutable, short of doing wicked things with ctypes.
>>
>
> By wicked things with ctypes, do you mean something like this? By no means
> do I suggest this actually be
On Wed, Apr 27, 2016 at 3:13 AM, Chris Kaynor wrote:
> Yah, if you really wanted to make it work properly, you'd need to incref
> the newValue, while decref the oldValue. The incref would not be that
> difficult, but the decref would be more challenging, as you may have to
> also destroy the old o
On Tue, Apr 26, 2016 at 11:13 AM, Chris Kaynor wrote:
> Yah, if you really wanted to make it work properly, you'd need to incref
> the newValue, while decref the oldValue. The incref would not be that
> difficult, but the decref would be more challenging, as you may have to
> also destroy the old
On Tue, Apr 26, 2016 at 10:04 AM, Chris Angelico wrote:
> On Wed, Apr 27, 2016 at 2:59 AM, Chris Kaynor
> wrote:
> > On Tue, Apr 26, 2016 at 9:32 AM, Steven D'Aprano
> > wrote:
> >
> >> Subclassing immutable built-ins is the most obvious and simple (and
> >> probably
> >> common) way to get an
On Wed, Apr 27, 2016 at 2:59 AM, Chris Kaynor wrote:
> On Tue, Apr 26, 2016 at 9:32 AM, Steven D'Aprano
> wrote:
>
>> Subclassing immutable built-ins is the most obvious and simple (and
>> probably
>> common) way to get an immutable class. Actually immutable, short of doing
>> wicked things with
On Tue, Apr 26, 2016 at 9:32 AM, Steven D'Aprano
wrote:
> Subclassing immutable built-ins is the most obvious and simple (and
> probably
> common) way to get an immutable class. Actually immutable, short of doing
> wicked things with ctypes.
>
By wicked things with ctypes, do you mean something
Steven D'Aprano :
> On Tue, 26 Apr 2016 06:25 pm, Marko Rauhamaa wrote:
>> Check out some of the stdlib source code for example:
>>
>>
>> class ThreadPoolExecutor(_base.Executor):
>&
On Wed, 27 Apr 2016 02:26 am, Random832 wrote:
> On Tue, Apr 26, 2016, at 12:12, Steven D'Aprano wrote:
>> The obvious reason for overriding __new__ is to construct an immutable
>> instance. You have to override __new__, because by the time it returns
>> the
>> instance is immutable and you can no
On Tue, Apr 26, 2016, at 12:12, Steven D'Aprano wrote:
> The obvious reason for overriding __new__ is to construct an immutable
> instance. You have to override __new__, because by the time it returns
> the
> instance is immutable and you can no longer initialise it.
Other than by subclassing an e
as been called.
No object can guarantee that any method is called. Python doesn't make an
exception for __new__ or __init__. I'm not sure why you would want it to.
> Check out some of the stdlib source code for example:
>
> ===
On 04/26/2016 06:49 AM, Random832 wrote:
On Tue, Apr 26, 2016, at 03:34, Ben Finney wrote:
That's needlessly confusing: ‘__init__’ is not a constructor because it
does not construct the instance. The ‘__new__’ method is the constructor
for a class (and returns the new instance).
the __new__ met
On Tue, Apr 26, 2016, at 03:34, Ben Finney wrote:
> That's needlessly confusing: ‘__init__’ is not a constructor because it
> does not construct the instance. The ‘__new__’ method is the constructor
> for a class (and returns the new instance).
the __new__ method is the *allocator*. "constructor"
=======
class ThreadPoolExecutor(_base.Executor):
def __init__(self, max_workers):
"""Initializes a new ThreadPoolExecutor instance.
Args:
max_workers: The maximum number of threads that can be used to
exec
Gary Herron writes:
>The __init__ method is the constructor for instances of a class. It
>is not required, but the situations in which a constructor is not
>needed are few and unusual.
That's needlessly confusing: ‘__init__’ is not a constructor because it
does not construct the ins
On 04/25/2016 11:21 PM, San wrote:
Hi All,
Pls let me why
"
def __init__(self):
"
declaration required, what's the use of this one.Pls explain me in details.
Thanks in advance.
If you understand object-oriented-programming, then this will make sense:
The __init_
San writes:
> Pls let me why […] declaration required, what's the use of this one.
Welcome to Python! Congratulations on beginning to learn this language.
> Pls explain me in details.
You should participate in our collaborative tutoring forum, ‘tutor’
https://mail.python.org/mailman/listinfo/
Hi All,
Pls let me why
"
def __init__(self):
"
declaration required, what's the use of this one.Pls explain me in details.
Thanks in advance.
--
https://mail.python.org/mailman/listinfo/python-list
Thanks a lot...
CIAO
Duncan Booth wrote:
> flogic wrote:
>
> > Hi
> > i m a newbie to python ..
> > jus started to learn ...am quite confused about variable arguments used
> > in python functions and in init.
> >
> > i dont where to use **keys , **kwds,*args ...etc...
> >
> > if anyone culd gi
flogic wrote:
> Hi
> i m a newbie to python ..
> jus started to learn ...am quite confused about variable arguments used
> in python functions and in init.
>
> i dont where to use **keys , **kwds,*args ...etc...
>
> if anyone culd give some explanation with examples or clear detailed
> web link,
thanks in advance
i have a python code like shown below
examples:
def __init__(self, link, *arg, **key):
blah blah
def setTransponderDefaultConfiguration(self, *arg, **kwds):
blah blah
--
http://mail.python.org/mailman/listinfo/python-list
23 matches
Mail list logo