On May 6, 12:56 am, John O'Hagan wrote:
> On Tue, 5 May 2009, Sion Arrowsmith wrote:
> > John O'Hagan wrote:
> > >I can see that it's tantalizing, though, because _somebody_ must know
> > > about the assignment; after all, we just executed it!
>
> > Except we haven't, if we're talking about repo
> John O'Hagan (JO) wrote:
>JO> I guess what I meant was that if I type:
>JO> brian = Brian()
>JO> in the python shell and then hit return, it seems to me that
>JO> _somewhere_ (in the interpreter? I have no idea how it's done) it
>JO> must be written that the new Brian object will later be
John O'Hagan wrote:
>I guess what I meant was that if I type:
>
>brian = Brian()
>
>in the python shell and then hit return, it seems to me that _somewhere_ (in
>the interpreter? I have no idea how it's done) it must be written that the
>new Brian object will later be assigned the name "brian",
On Tue, 5 May 2009, Sion Arrowsmith wrote:
> John O'Hagan wrote:
> >I can see that it's tantalizing, though, because _somebody_ must know
> > about the assignment; after all, we just executed it!
>
> Except we haven't, if we're talking about reporting from the
>
> object's __init__:
> >>> class B
John O'Hagan wrote:
>I can see that it's tantalizing, though, because _somebody_ must know about
>the assignment; after all, we just executed it!
Except we haven't, if we're talking about reporting from the
object's __init__:
>>> class Brian:
... def __init__(self):
... print "I'm
On Sat, 2 May 2009, John O'Hagan wrote:
> On Fri, 1 May 2009, warpcat wrote:
[...]
> > Given an object:
> >
> > class Spam(object):
> > def __init__(self):
> > # stuff
> >
> > I'd like it to print, when instanced, something like this:
> > >>> s = Spam()
> >
> > I’m assigned to s!
On Fri, May 1, 2009 at 12:48 PM, Steven D'Aprano
wrote:
> On Fri, 01 May 2009 09:24:10 -0700, warpcat wrote:
>
>> I'd like it to print, when instanced, something like this:
>>
> s = Spam()
>> I’m assigned to s!
>>
>> But it seems prohibitively hard (based on my web and forum searches) for
>> a
On Fri, 1 May 2009, warpcat wrote:
> I've passed this around some other groups, and I'm being told
> "probably not possible". But I thought I'd try here as well :) I
> *did* search first, and found several similar threads, but they
> quickly tangented into other specifics of the language that we
warpcat wrote:
> I've passed this around some other groups, and I'm being told
> "probably not possible". But I thought I'd try here as well :) I
> *did* search first, and found several similar threads, but they
> quickly tangented into other specifics of the language that were a bit
> ove
On Fri, 01 May 2009 13:03:56 -0400, David Robinow wrote:
> Others have explained to you that this is not possible. I'll just point
> out that your method for learning the language is not optimal. If you
> had gotten a recipe to do what you asked, how would it help you write
> better programs?
Exa
On May 1, 10:03 am, David Robinow wrote:
> On Fri, May 1, 2009 at 12:24 PM, warpcat wrote:
> > I've passed this around some other groups, and I'm being told
> > "probably not possible". But I thought I'd try here as well :) I
> > *did* search first, and found several similar threads, but they
On May 1, 9:48 am, Steven D'Aprano wrote:
> On Fri, 01 May 2009 09:24:10 -0700, warpcat wrote:
> > I'd like it to print, when instanced, something like this:
>
> s = Spam()
> > I’m assigned to s!
>
> > But it seems prohibitively hard (based on my web and forum searches) for
> > an object to k
On Fri, May 1, 2009 at 12:24 PM, warpcat wrote:
> I've passed this around some other groups, and I'm being told
> "probably not possible". But I thought I'd try here as well :) I
> *did* search first, and found several similar threads, but they
> quickly tangented into other specifics of the la
On Fri, 01 May 2009 09:24:10 -0700, warpcat wrote:
> I'd like it to print, when instanced, something like this:
>
s = Spam()
> I’m assigned to s!
>
> But it seems prohibitively hard (based on my web and forum searches) for
> an object to know what variable name is has been assigned to when
warpcat wrote:
I've passed this around some other groups, and I'm being told
"probably not possible". But I thought I'd try here as well :) ...
Given an object:
class Spam(object):
def __init__(self):
# stuff
I'd like it to print, when instanced, something like this:
I've passed this around some other groups, and I'm being told
"probably not possible". But I thought I'd try here as well :) I
*did* search first, and found several similar threads, but they
quickly tangented into other specifics of the language that were a bit
over my head :) At any rate, here
16 matches
Mail list logo