Steve Holden wrote:
> Ritesh Raj Sarraf wrote:
>> On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
>>> On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>>>
> [...]
>> Oops!!! Looks like I completely missed this. It _did_ print the error
>> message.
>> Apologies to all
Ritesh Raj Sarraf wrote:
> On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
>> On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>>
[...]
> Oops!!! Looks like I completely missed this. It _did_ print the error
> message.
> Apologies to all for not keeping a close eye on
On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
> > On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> > > Or am I terribly missing something that you are trying to tell ?
>
> > I didn't see log = Log() in
On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> > Or am I terribly missing something that you are trying to tell ?
>
> I didn't see log = Log() in your example. Sorry for the
> excursion.
>
> Are you sure os.name is 'posix
On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>
>>>
>>> Doesn't __init__ get called automatically ?
>>
>> It gets called automatically when you construct an instance of
>> the class in which it's defined.
>
> I am a little confused by your statements now.
>
> In
Neil Cerutti wrote:
>>
>> Doesn't __init__ get called automatically ?
>
> It gets called automatically when you construct an instance of
> the class in which it's defined.
I am a little confused by your statements now.
In my earlier posts in the same thread, I gave some code example which was
s
On 2007-08-14, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>
>> If you want an import inside an __init__ to run, you must call
>> the __init__ function that contains it.
>
> Doesn't __init__ get called automatically ?
It gets called automatically when you construct an instan
Neil Cerutti wrote:
> If you want an import inside an __init__ to run, you must call
> the __init__ function that contains it.
Doesn't __init__ get called automatically ?
I thought __init__ was required to be called explicitly only when you were
doing inheritance and wanted to pass separate value
On 2007-08-14, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Bruno Desthuilliers wrote:
>
What's leading you to conclude the import isn't being executed? You
realise, I trust, that the module's code will only be executed on the
first call to __init__()?
>>>
>>> Well. Putting i
Bruno Desthuilliers wrote:
>>> What's leading you to conclude the import isn't being executed? You
>>> realise, I trust, that the module's code will only be executed on the
>>> first call to __init__()?
>>>
>>
>> Well. Putting it in a "try" inside __init__() doesn't do anything.
>
> This would b
Ritesh Raj Sarraf a écrit :
> Steve Holden wrote:
(snip)
>> What's leading you to conclude the import isn't being executed? You
>> realise, I trust, that the module's code will only be executed on the
>> first call to __init__()?
>>
>
> Well. Putting it in a "try" inside __init__() doesn't do an
Ritesh Raj Sarraf a écrit :
> Bruno Desthuilliers wrote:
>
>> Ritesh Raj Sarraf a écrit :
>>> if lock is None or lock != 1:
>>> self.DispLock = False
>>> else:
>>> self.DispLock = threading.Lock()
>>> self.lock = True
>>>
>>> if os.name =
Ritesh Raj Sarraf a écrit :
> Bruno Desthuilliers wrote:
>
>> Ritesh Raj Sarraf a écrit :
>>
>> The initializer will be called *each time* you instanciate the class.
>> And nothing prevents client code from calling it explicitelly as many
>> times as it wants - ok, this would be rather strange, b
Steve Holden wrote:
> Ritesh Raj Sarraf wrote:
>> class Log:
>>
>> def __init__(self, verbose, lock = None):
>>
>> if verbose is True:
>> self.VERBOSE = True
>> else: self.VERBOSE = False
>>
> Better:
>
> self.VERBOSE = verbose
>
> or, if you suspect verbose mi
Bruno Desthuilliers wrote:
> Ritesh Raj Sarraf a écrit :
>
> The initializer will be called *each time* you instanciate the class.
> And nothing prevents client code from calling it explicitelly as many
> times as it wants - ok, this would be rather strange, but this is still
> technically possi
Bruno Desthuilliers wrote:
> Ritesh Raj Sarraf a écrit :
>>
>> if lock is None or lock != 1:
>> self.DispLock = False
>> else:
>> self.DispLock = threading.Lock()
>> self.lock = True
>>
>> if os.name == 'posix':
>>self.platf
Ritesh Raj Sarraf wrote:
> Hi,
>
> I've been very confused about why this doesn't work. I mean I don't see any
> reason why this has been made not to work.
>
> class Log:
>
> def __init__(self, verbose, lock = None):
>
> if verbose is True:
> self.VERBOSE = True
>
Ritesh Raj Sarraf a écrit :
> On Aug 11, 3:17 am, James Stroud <[EMAIL PROTECTED]> wrote:
>> You do realize your import statement will only be called for nt and dos
>> systems don't you?
>>
>
> Yes. I would like to load a Windows Python Module (which is, say a
> specific implementation for Windows
Ritesh Raj Sarraf a écrit :
> Hi,
>
> I've been very confused about why this doesn't work. I mean I don't see any
> reason why this has been made not to work.
>
> class Log:
>
> def __init__(self, verbose, lock = None):
>
> if verbose is True:
Don't use an identity test here. There
On Aug 11, 3:17 am, James Stroud <[EMAIL PROTECTED]> wrote:
> You do realize your import statement will only be called for nt and dos
> systems don't you?
>
Yes. I would like to load a Windows Python Module (which is, say a
specific implementation for Windows only) in such a condition where I
find
Ritesh Raj Sarraf wrote:
> Hi,
>
> I've been very confused about why this doesn't work. I mean I don't see any
> reason why this has been made not to work.
>
> class Log:
>
> def __init__(self, verbose, lock = None):
>
> if verbose is True:
> self.VERBOSE = True
>
Hi,
I've been very confused about why this doesn't work. I mean I don't see any
reason why this has been made not to work.
class Log:
def __init__(self, verbose, lock = None):
if verbose is True:
self.VERBOSE = True
else: self.VERBOSE = False
if lock is
22 matches
Mail list logo