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


Groups > comp.lang.python > #48904

Re: n00b question on spacing

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: n00b question on spacing
Date 2013-06-21 21:57 -0400
Organization IISS Elusive Unicorn
References <CAJ=2b07ETuSuo2+3Xu6vMOJA+q1JwUFTezO3LaYLG8wXd+FLBQ@mail.gmail.com> <24094189.2779.1371851333304.JavaMail.rgacote@ip-225.appropriatesolutions.com> <CAJ=2b06j44KSS=sD-TC7yfiXFA739OSkvyYyLs4fD8SzGDjS4g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3682.1371866252.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, 21 Jun 2013 18:00:58 -0400, "Yves S. Garret"
<yoursurrogategod@gmail.com> declaimed the following:

>
>Thanks for your reply Ray.  My concern was that if I were to break with
>something like this:
>      log.msg("Item written to MongoDB database %s/%s"
>    %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']),
>    level = log.DEBUG, spider = spider)
>
>I would get some undefined behaviour (the % is a little before the log.msg).
>
>I'll read the links that you provided in order to learn more.

	The short knowledge is just that anything within unclosed ([{ can be
wrapped to a new line; it isn't indentation sensitive.

	log.msg("Item written to MongoDB database %s/%s"
			% (	settings["MONGODB_DB"],
				settings["MONGODB_COLLECTION"]	),
			level = log.DEBUG,
			spider = spider)

is perfectly valid.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Re: n00b question on spacing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-21 21:57 -0400

csiph-web