Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75256

Re: Return class.

X-Received by 10.50.28.15 with SMTP id x15mr5813042igg.5.1406401472834; Sat, 26 Jul 2014 12:04:32 -0700 (PDT)
X-Received by 10.50.40.69 with SMTP id v5mr303595igk.6.1406401472750; Sat, 26 Jul 2014 12:04:32 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!h18no4808597igc.0!news-out.google.com!eg1ni5igc.0!nntp.google.com!h18no4808589igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Sat, 26 Jul 2014 12:04:32 -0700 (PDT)
In-Reply-To <mailman.12353.1406400496.18130.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=101.63.66.74; posting-account=mz2-UgoAAABhHsO0mzb5w7wo3Dt0FOo5
NNTP-Posting-Host 101.63.66.74
References <23517efd-6d71-4182-9f18-7aaae3b95afb@googlegroups.com> <mailman.12353.1406400496.18130.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <d2cf78fd-cc30-47ca-b6a4-4117bc843cf0@googlegroups.com> (permalink)
Subject Re: Return class.
From Satish ML <satishmlwizpro@gmail.com>
Injection-Date Sat, 26 Jul 2014 19:04:32 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:75256

Show key headers only | View raw


Which line of code is printing [4] and [4, 5, 6, 7] in the output?

from tracer import Tracer
@Tracer
class MyList(list):
    def __init__(self, *args):
        print("INSIDE MyList")
        print(*args)
x = MyList([1, 2, 3])
x.append(4)
print(x.wrapped)
WrapList = Tracer(list)
x = WrapList([4, 5, 6])
x.append(7)
print(x.wrapped)

OUTPUT:

CARST
Trace: display
1
Spam!Spam!Spam!Spam!Spam!Spam!Spam!Spam!
[1]
Trace: name
1
Bob
Trace: pay
2
2000

Trace: name
1
Sue
Trace: pay
2
6000
Trace: name
3
Bob
Trace: pay
4
2000
[4, 2]
INSIDE MyList
[1, 2, 3]
Trace: append
1
[4]
Trace: append
1
[4, 5, 6, 7]

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Return class. Satish ML <satishmlwizpro@gmail.com> - 2014-07-26 11:29 -0700
  Re: Return class. Chris Angelico <rosuav@gmail.com> - 2014-07-27 04:40 +1000
    Re: Return class. Satish ML <satishmlwizpro@gmail.com> - 2014-07-26 12:02 -0700
    Re: Return class. Satish ML <satishmlwizpro@gmail.com> - 2014-07-26 12:03 -0700
    Re: Return class. Satish ML <satishmlwizpro@gmail.com> - 2014-07-26 12:04 -0700
      Re: Return class. Chris Angelico <rosuav@gmail.com> - 2014-07-27 05:16 +1000
    Re: Return class. Satish ML <satishmlwizpro@gmail.com> - 2014-07-26 12:21 -0700
  Re: Return class. Satish ML <satishmlwizpro@gmail.com> - 2014-07-26 12:15 -0700

csiph-web