Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.python Subject: Re: Bitten by my C/Java experience Date: Mon, 04 May 2015 22:28:09 +0200 Organization: Decebal Computing Lines: 32 Message-ID: <87twvsgk9y.fsf@Equus.decebal.nl> References: <87r3qwid3u.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="1e75f8f7bcfe2945d0316cb03b0f6951"; logging-data="5075"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bdg1NU+Ea5WG4OFaRnYGOtceehM+fW9I=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Face: "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR,v+Pti8=Vi/Z"g^?b"E Cancel-Lock: sha1:0Pdedbj/nfNUeqo+Kx1Ma9lxLKY= sha1:pX6k70KaqyFxsvbG0uBPSmNIgbE= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.python:89932 Op Monday 4 May 2015 21:39 CEST schreef Ian Kelly: > On Mon, May 4, 2015 at 11:59 AM, Mark Lawrence wrote: >> On 04/05/2015 16:20, Cecil Westerhof wrote: >>> >>> Potential dangerous bug introduced by programming in Python as if >>> it was C/Java. :-( I used: ++tries that has to be: tries += 1 >>> >>> Are there other things I have to be careful on? That does not work >>> as in C/Java, but is correct syntax. >>> >> >> Not dangerous at all, your test code picks it up. I'd also guess, >> but don't actually know, that one of the various linter tools could >> be configured to find this problem. > > pylint reports it as an error. I installed it. Get a lot of messages. Mostly convention. For example: Unnecessary parens after 'print' keyword And: Invalid variable name "f" for: with open(real_file, 'r') as f: But still something to add to my toolbox. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof