Re: Is this a good way to work with init and exception

2015-07-19 Thread Cecil Westerhof
On Monday 20 Jul 2015 00:40 CEST, Chris Angelico wrote: > On Mon, Jul 20, 2015 at 8:19 AM, Cecil Westerhof wrote: >>> If two modules import the same module, they get two references to >>> that same module, not two separate module instances. Since your >>> parameters appear only to affect the init

Re: Is this a good way to work with init and exception

2015-07-19 Thread Chris Angelico
On Mon, Jul 20, 2015 at 8:19 AM, Cecil Westerhof wrote: >> If two modules import the same module, they get two references to >> that same module, not two separate module instances. Since your >> parameters appear only to affect the initialization itself, this is >> not likely to be a problem (it's

Re: Is this a good way to work with init and exception

2015-07-19 Thread Cecil Westerhof
On Sunday 19 Jul 2015 23:08 CEST, Chris Angelico wrote: > On Mon, Jul 20, 2015 at 5:10 AM, Cecil Westerhof wrote: >>> I think it's fine, then. As long as it makes absolutely no sense >>> to have two separately-initialized twitter connections, and as >>> long as it's okay for two separate modules

Re: Is this a good way to work with init and exception

2015-07-19 Thread Chris Angelico
On Mon, Jul 20, 2015 at 5:10 AM, Cecil Westerhof wrote: >> I think it's fine, then. As long as it makes absolutely no sense to >> have two separately-initialized twitter connections, and as long as >> it's okay for two separate modules to both import this and to then >> share state, then what you

Re: Is this a good way to work with init and exception

2015-07-19 Thread Cecil Westerhof
On Sunday 19 Jul 2015 20:11 CEST, Chris Angelico wrote: >>> Parameterized imports aren't possible, correct. What I'd look at >>> here is a more explicit instantiation. Something like: >>> >>> import twitterDecebal >>> twitter = twitterDecebal.twitterDecebal(5, 60) >> >> I worked with default value

Re: Is this a good way to work with init and exception

2015-07-19 Thread Chris Angelico
On Mon, Jul 20, 2015 at 2:46 AM, Cecil Westerhof wrote: > On Sunday 19 Jul 2015 14:59 CEST, Chris Angelico wrote: > >> Reordering/interleaving your post to respond to different parts >> together. >> >> On Sun, Jul 19, 2015 at 8:35 PM, Cecil Westerhof wrote: >>> I am using libturpial to post thing

Re: Is this a good way to work with init and exception

2015-07-19 Thread Cecil Westerhof
On Sunday 19 Jul 2015 14:59 CEST, Chris Angelico wrote: > Reordering/interleaving your post to respond to different parts > together. > > On Sun, Jul 19, 2015 at 8:35 PM, Cecil Westerhof wrote: >> I am using libturpial to post things on Twitter. But sometimes I >> get a ServiceOverCapacity except

Re: Is this a good way to work with init and exception

2015-07-19 Thread Chris Angelico
Reordering/interleaving your post to respond to different parts together. On Sun, Jul 19, 2015 at 8:35 PM, Cecil Westerhof wrote: > I am using libturpial to post things on Twitter. But sometimes I get a > ServiceOverCapacity exception. So I wrote the following code. > > ==

Is this a good way to work with init and exception

2015-07-19 Thread Cecil Westerhof
I am using libturpial to post things on Twitter. But sometimes I get a ServiceOverCapacity exception. So I wrote the following code. == class InitAlreadyDoneError(Exception): pass # Functions def init(max_tries = 5, wait