Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'example:': 0.03; 'messages.': 0.05; 'convention.': 0.07; 'python3': 0.07; 'tries': 0.07; 'variables': 0.07; 'cest': 0.09; 'lawrence': 0.09; 'python': 0.11; 'bug': 0.12; 'mostly': 0.14; '"f"': 0.16; '11:59': 0.16; ':-(': 0.16; 'be:': 0.16; 'expected,': 0.16; 'picks': 0.16; 'rules.': 0.16; 'subject:Java': 0.16; 'used:': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'all,': 0.19; 'bit': 0.19; '>>>': 0.22; 'programming': 0.22; 'header:User-Agent:1': 0.23; 'mon,': 0.24; 'subject:/': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'correct': 0.29; 'am,': 0.29; 'code': 0.31; '>>>>': 0.31; 'probably': 0.32; 'up.': 0.33; "i'd": 0.34; 'could': 0.34; 'common': 0.35; 'problem.': 0.35; 'something': 0.35; 'monday': 0.35; 'test': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'keyword': 0.36; 'should': 0.36; 'error.': 0.37; 'reports': 0.37; 'configured': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'bad': 0.39; 'to:addr:python.org': 0.39; 'dangerous': 0.60; 'ian': 0.60; 'tell': 0.60; 'introduced': 0.61; 'name': 0.63; 'for:': 0.64; 'charset:windows-1252': 0.65; 'invalid': 0.68; 'received:74.208': 0.68; '2015': 0.84; 'received:74.208.4.194': 0.84; 'subject:experience': 0.84; 'avoided.': 0.91; 'careful': 0.91; 'on?': 0.91 Date: Mon, 04 May 2015 19:17:26 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Bitten by my C/Java experience References: <87r3qwid3u.fsf@Equus.decebal.nl> <87twvsgk9y.fsf@Equus.decebal.nl> In-Reply-To: <87twvsgk9y.fsf@Equus.decebal.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:dvUWTw2+kORNLIjdIGmv+TW4SUnQGFYomDwQ9B52q3auGz4yWrd U6r9oKGBIOZ7G1owHOFXH5OgSVLlLxqxtUdbERXzPMp49rodndmqJg0W3mSpyTiaU+yeqaW D1F5PZX7oRWSscZuENIVE6aEu10nkZbmLa2iwQgcDZvLmlPMqDcvYMw2T7wHd6ndNvcx2zZ /F7oUZtYnldw+cvZZL0QQ== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430781463 news.xs4all.nl 2838 [2001:888:2000:d::a6]:45686 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89941 On 05/04/2015 04:28 PM, Cecil Westerhof wrote: > 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 Sounds like it's configured for Python 2.x. There's probably a setting to tell it to use Python3 rules. > > And: > Invalid variable name "f" > for: > with open(real_file, 'r') as f: Sounds like a bad wording. Nothing invalid about it, though it is a bit short. There are certain one letter variables which are so common as to be expected, but others should be avoided. > > But still something to add to my toolbox. > -- DaveA