Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'debugging': 0.07; 'odd': 0.07; 'reject': 0.07; 'see.': 0.07; 'subject:code': 0.07; 'subject:help': 0.08; 'calls.': 0.09; 'compact': 0.09; 'expectation': 0.09; 'filter,': 0.09; 'pretend': 0.09; 'style.': 0.09; 'yeah,': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'bug': 0.12; 'did.': 0.16; 'finds': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'grep': 0.16; 'log.': 0.16; 'partly': 0.16; 'roy': 0.16; 'said.': 0.16; 'subject:when': 0.16; 'usage,': 0.16; 'weird.': 0.16; 'wording': 0.16; 'files.': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'bit': 0.19; 'slightly': 0.19; '(the': 0.22; 'cc:addr:python.org': 0.22; 'filtering': 0.24; 'tells': 0.24; 'tend': 0.24; 'fairly': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'post': 0.26; 'certain': 0.27; 'header:In-Reply- To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'scale': 0.29; "doesn't": 0.30; 'bigger': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'usually': 0.31; 'asks': 0.31; 'helpful.': 0.31; 'yes.': 0.31; 'yesterday': 0.31; 'anyone': 0.31; 'file': 0.32; 'quite': 0.32; 'linux': 0.33; 'running': 0.33; 'addresses': 0.33; 'problem': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'tight': 0.36; 'yours,': 0.36; 'too': 0.37; 'two': 0.37; 'being': 0.38; 'server': 0.38; 'problems': 0.38; 'tools,': 0.38; 'rather': 0.38; 'that,': 0.38; 'address.': 0.39; 'even': 0.60; 'most': 0.60; 'black': 0.61; 'full': 0.61; 'times': 0.62; 'reach': 0.63; 'today': 0.64; 'box,': 0.64; 'smith': 0.68; 'sunday': 0.68; 'us,': 0.73; 'felt': 0.74; 'jul': 0.74; 'day': 0.76; 'subject:your': 0.76; 'article': 0.77; '100': 0.79; '"real': 0.84; 'everywhere.': 0.84; 'subject:you': 0.87; 'bounce': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=heAF6/VvlaDs4Nms6JLEUq5uTcLdOOcdHO36dbBIS60=; b=CBAyJw2VmZoK7GPNbj8BB4Dz6sByDW1EZbVsrjNMf8oueAygeV9qWRx78wCuYsdn6P 3Q6hU8zgS2RvEkv9Ip2xupur/nYTkh4Pg5Ge9LGb7K2QIyklOn5wprL8+pJ5q6NW/gwJ CNh0d4VHAqlRGXc5iv5M1GBX5xl8dLdf+y/qsgDR5H4S9JizhoTaiY/EXmskrMUtzxmu +EiNeYgw315IGaeRdwFD47omNtlfNsnttXtpcqGi2g2/2CWT9O+xqiX/925PgExSnXwH y2/znyNqLikl8XWsHg+RfmtU+GK2zUD2uL7IusGOyfyxXvSKSBQHrpgntLZxRUZq1UIN FvHg== MIME-Version: 1.0 X-Received: by 10.52.7.163 with SMTP id k3mr52939vda.58.1404702367455; Sun, 06 Jul 2014 20:06:07 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Jul 2014 13:06:07 +1000 Subject: Re: How do you use `help` when write your code From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404702375 news.xs4all.nl 2838 [2001:888:2000:d::a6]:51188 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74071 On Mon, Jul 7, 2014 at 10:52 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> But the important thing is that you log. > > I 'spose. Let's see. Yesterday we generated 133 GB of log files. And > Sunday is a slow day :-) Heh, that's a bit bigger in scale than most of what I work with... but yes. I have a log file of the from and to addresses of every email that goes through my spam filter, and whether it was marked spam or ham; the expectation is that any mail that doesn't bounce (the server will reject prior to this log based on certain rules) will be in the log, so if anyone asks about something, I can grep the log for an address. It's a fairly compact log, and this is a fairly small site, so the growth is a lot slower than 133GB/day! But the principle's the same: log today so you can find a problem tomorrow. >> Have you ever had a bug where someone else finds it and then doesn't >> give you full repro steps? > > Are there people like that where you are? Weird. Yes, sadly, there are people just about everywhere. (Despite my post being in response to one of yours, Roy, I still partly felt that I was addressing Rick. Hence the slightly odd wording of something that, for most of us, is a "duh" matter.) >> There are times when you have to go for the "Real Programmer" >> debugging style. Pretend the program is a black box, no source code >> available, nothing. > > Yup; strace and tcpdump are two of my best friends. The source code > only tells you what the program is *supposed* to do. Strace tells you > what it did. And tcpdump tells you what it said. That's about it, yeah. I tend to find both strace and tcpdump rather too spammy for most usage, so any time I reach for those tools, it's usually with some tight filtering - and even that's not always helpful. The last thing I straced was a (closed-source) game that was having some problems (cross-platform, I'm one of a very small number of Linux testers), and it was running at well over 100 FPS... and each frame involved quite a few system calls. Yeah, that was spammy. ChrisA