Alex Martelli wrote:
> Steve Holden <[EMAIL PROTECTED]> wrote:
>...
Get yourself a stuffed bear, and next time you have this kind of problem
spend a few minutes explaining to the bear exactly how your program
can't possibly be wrong. Works like a charm.
>>> A rubber ducky works m
"Alex Martelli" wrote
> Steve Holden wrote:
>...
> > >> Get yourself a stuffed bear, and next time you have this kind of
problem
> > >> spend a few minutes explaining to the bear exactly how your
program
> > >> can't possibly be wrong. Works like a charm.
> > >
> > > A rubber ducky works muc
Steve Holden <[EMAIL PROTECTED]> wrote:
...
> >> Get yourself a stuffed bear, and next time you have this kind of problem
> >> spend a few minutes explaining to the bear exactly how your program
> >> can't possibly be wrong. Works like a charm.
> >
> > A rubber ducky works much better for that,
On Mar 15, 5:31 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> The fact that a list comprehension "leaks" its variables into the
> containing scope is a bit weird.
> A generator expression doesn't:
>
> py> str
>
> py> w = (str for str in range(10))
> py> w
>
> py> str
>
> py> w.next()
>
Alex Martelli wrote:
> Steve Holden <[EMAIL PROTECTED]> wrote:
>
>> 7stud wrote:
>>> Sheesh! You would think that after looking at every inch of the code
>>> for way too many hours, at some point that would have poked me in the
>>> eye.
>>>
>>> Thanks all.
>>>
>> Get yourself a stuffed bear, and n
Steve Holden <[EMAIL PROTECTED]> wrote:
> 7stud wrote:
> > Sheesh! You would think that after looking at every inch of the code
> > for way too many hours, at some point that would have poked me in the
> > eye.
> >
> > Thanks all.
> >
> Get yourself a stuffed bear, and next time you have this ki
[EMAIL PROTECTED] writes:
> methodList = [str for str in names if callable(getattr(obj, str))]
>
> instead, do something like this:
>
> methodList = [i for i in names if callable(getattr(obj, i))]
or:
methodList = list(str for str in names if callable(getattr(obj, str)))
genexps, unlike lis
En Thu, 15 Mar 2007 17:32:24 -0300, <[EMAIL PROTECTED]> escribió:
> methodList = [str for str in names if callable(getattr(obj, str))]
>
> instead, do something like this:
>
> methodList = [i for i in names if callable(getattr(obj, i))]
The fact that a list comprehension "leaks" its variables int
7stud wrote:
> Sheesh! You would think that after looking at every inch of the code
> for way too many hours, at some point that would have poked me in the
> eye.
>
> Thanks all.
>
Get yourself a stuffed bear, and next time you have this kind of problem
spend a few minutes explaining to the bear
Sheesh! You would think that after looking at every inch of the code
for way too many hours, at some point that would have poked me in the
eye.
Thanks all.
--
http://mail.python.org/mailman/listinfo/python-list
"7stud" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
|I can't get the str() method to work in the following code(the last
| line produces an error):
If you 'print str' here
| methodList = [str for str in names if callable(getattr(obj, str))]
and again here, you will see the prob
On Mar 15, 2:49 pm, "7stud" <[EMAIL PROTECTED]> wrote:
> I can't get the str() method to work in the following code(the last
> line produces an error):
>
>
> class test:
> """class test"""
> def __init__(self):
> """I am init func!"""
> s
7stud wrote:
> I can't get the str() method to work in the following code(the last
> line produces an error):
>
>
> class test:
> """class test"""
> def __init__(self):
> """I am init func!"""
> self.num = 10
> self.num2
Don't use built-ins as variable names. Your code will work if you
change this:
> methodList = [str for str in names if callable(getattr(obj, str))]
to this:
> methodList = [s for s in names if callable(getattr(obj, s))]
--
http://mail.python.org/mailman/listinfo/python-list
14 matches
Mail list logo