iate hearing about them.
>
> Thank you,
> Malcolm
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
---
Paul Woolcock
--
http://mail.python.org/mailman/listinfo/python-list
gt;> add2 = partial(add, right=2)
Now, you have a new function, `add2`, that takes one parameter:
>>> add2(4)
6
---
Paul Woolcock
pwool...@gmail.com
On Mon, Jul 18, 2011 at 6:13 AM, Kurian Thayil
wrote:
>
> Hi,
>
> I am a newbie in python and would like to
(self):
>if self.tok:
>t = self.tok
>self.tok = None
>return t
># ...
>
>
> Is there a way to trim the 'if' block to reset self.tok upon return?
>
> --
> Bill
> --
> http://mail.python.org/**mailman/listinfo/python-list<http:
The gurus will have to correct me if this is not an accepted practice, but I
know some projects (Fabric is the one that comes to mind) will define a
submodule specifically for the 'from blah import *' situation. The submodule
would be called "api", or something like that, so you can do: 'from
mymod
On Aug 14, 2011 3:24 PM, "Seebs" wrote:
...
> > I'm not impressed by arguments based on "but if I do something stupid,
like
> > select text with my eyes closed and reindent it without looking, I
expect
> > the compiler to save my bacon". In my opinion, it's not the compiler's
job
> > to protect yo
If you really want __setitem__ and not __setattr__, you should change the
base class to 'dict'. Or 'import UserDict' and use that for the base class.
On Aug 18, 2011 9:45 PM, "luvspython" wrote:
> I'm using Python 2.7 and the code below fails at the 'super' statement
> in the __setitem__ function