Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81433
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.007 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'affected': 0.07; 'debug': 0.07; 'string': 0.09; 'global,': 0.09; 'occasionally': 0.09; 'will,': 0.09; 'cc:addr:python-list': 0.11; 'assume': 0.14; '24,': 0.16; 'braces': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:class': 0.16; 'wider': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'second': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; '(usually': 0.31; 'quite': 0.32; 'comment': 0.34; 'maybe': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'c++': 0.36; 'list': 0.37; 'nov': 0.38; 'pm,': 0.38; 'extremely': 0.39; 'dave': 0.60; 'skip:* 10': 0.61; 'simple': 0.61; 'first': 0.61; 'line,': 0.68; 'useful.': 0.68; 'subject:have': 0.80; 'shadows': 0.84; 'angel': 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=zCChAQMc6fpYYA4emdQbLDYmI831KQBwjkSdyt/FGt0=; b=veDe+/+Tfx8ta/wwA2Wun+i1aF0Mdl0IaEXNHzkoakw0SRZarmUc+Xzume5smOLkXQ 90GU27HGcVbn7QPH0ccMDo/ccF702W2z/j/IHfa2NF+E7YMR8VH/9jKq6Y4nC+osiQKd ar0zStrV3uGOs95iY1DihFUAEwBv6PdWfqqp9Ya0SI+RTRSXBoAoerC/J5FFrjkNCmCU 3qV7k9xZYpGDp+qPG3O8Legwd3jh7mLOhHkhixeLMrWhWbEmNoiE6fl0BTMpK+MkdaGU KO5KVktZz69wkCJjnr2evZMR48m9C7mrMGVBKRah7g7kQM3bqAM9L3cwyzl4PrZNLeh6 3ErQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.42.110.195 with SMTP id r3mr22934208icp.12.1416806505164; Sun, 23 Nov 2014 21:21:45 -0800 (PST) |
| In-Reply-To | <5472BE0D.701@davea.name> |
| References | <mailman.16156.1416712474.18130.python-list@python.org> <l9l27alml8scm4dvf29m2vidcudhh6766o@4ax.com> <mailman.16157.1416714761.18130.python-list@python.org> <2qn27adjq412n9nff9kv5jh25d1ekkbncp@4ax.com> <mailman.16160.1416722412.18130.python-list@python.org> <kre37at1cg1m0k3vcav2ekgohfrs5rb465@4ax.com> <mailman.16185.1416755794.18130.python-list@python.org> <8d047ahkrb4uh4qpq1uk74tel4nfc4s8uv@4ax.com> <mailman.16192.1416759279.18130.python-list@python.org> <up347a14v7v65meph33k53kas3jkqgmoo5@4ax.com> <66b13454-3503-4111-bf8e-58ce79ef00aa@googlegroups.com> <5472b24c$0$12979$c3e8da3$5496439d@news.astraweb.com> <5472BE0D.701@davea.name> |
| Date | Mon, 24 Nov 2014 16:21:45 +1100 |
| Subject | Re: I have no class |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <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 <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16229.1416806507.18130.python-list@python.org> (permalink) |
| Lines | 28 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1416806507 news.xs4all.nl 2970 [2001:888:2000:d::a6]:47271 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:81433 |
Show key headers only | View raw
On Mon, Nov 24, 2014 at 4:11 PM, Dave Angel <davea@davea.name> wrote:
> The case I found astounding in C++ was in the initializer list where the
> line
>
> value:value
>
> would assume that the first one was this->value, and the second was a local
> named value (usually an argument to the constructor).
That's occasionally quite useful. You can create a variable which
shadows another, and reference the original in its initialization, as
a simple means of mocking for debug:
//Maybe a global, or at least at wider scope
string separator="whatever... maybe pulled from a MIME document";
...
{
string separator="** DEBUG **"+separator+"** DEBUG **";
...
code using separator
...
}
You can comment or uncomment the debug line, and everything inside the
braces will be affected by its alteration - but nothing outside them
will, because it's shadowed and not altered. Can be extremely handy.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-22 21:47 -0500
Re: I have no class random832@fastmail.us - 2014-11-22 22:08 -0500
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-22 22:16 -0500
Re: I have no class Rustom Mody <rustompmody@gmail.com> - 2014-11-22 19:09 -0800
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-22 22:18 -0500
Re: I have no class Ned Batchelder <ned@nedbatchelder.com> - 2014-11-22 22:14 -0500
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-22 22:35 -0500
Re: I have no class Joel Goldstick <joel.goldstick@gmail.com> - 2014-11-22 22:52 -0500
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-22 23:15 -0500
Re: I have no class Chris Angelico <rosuav@gmail.com> - 2014-11-23 17:00 +1100
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-23 05:52 -0500
Re: I have no class Dave Angel <davea@davea.name> - 2014-11-23 10:16 -0500
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-23 10:54 -0500
Re: I have no class Dave Angel <davea@davea.name> - 2014-11-23 11:14 -0500
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-23 11:49 -0500
Re: I have no class Chris Angelico <rosuav@gmail.com> - 2014-11-24 03:59 +1100
Re: I have no class Rustom Mody <rustompmody@gmail.com> - 2014-11-23 09:02 -0800
Re: I have no class Steven D'Aprano <steve@pearwood.info> - 2014-11-24 04:21 +0000
Re: I have no class Dave Angel <davea@davea.name> - 2014-11-24 00:11 -0500
Re: I have no class Chris Angelico <rosuav@gmail.com> - 2014-11-24 16:11 +1100
Re: I have no class Dan Sommers <dan@tombstonezero.net> - 2014-11-24 13:44 +0000
Re: I have no class Chris Angelico <rosuav@gmail.com> - 2014-11-25 00:48 +1100
Re: I have no class Dave Angel <davea@davea.name> - 2014-11-24 00:20 -0500
Re: I have no class Chris Angelico <rosuav@gmail.com> - 2014-11-24 16:21 +1100
Re: I have no class Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-24 13:47 -0500
Re: I have no class Rustom Mody <rustompmody@gmail.com> - 2014-11-22 19:55 -0800
Re: I have no class Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-11-22 23:19 -0500
Re: I have no class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-23 15:35 +0000
csiph-web