Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Bob Gailer Newsgroups: comp.lang.python Subject: Re: Python best practices Date: Sat, 16 Jan 2016 14:41:33 -0500 Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de eh3j9HB03diLNiKjnp6nHw9EkynAMWlqqbXMoOubP9Gg== 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; 'subject:Python': 0.05; 'e.g.,': 0.07; 'override': 0.07; 'cc:addr:python-list': 0.09; '"if': 0.09; 'logic': 0.09; 'meaningful': 0.09; 'modules.': 0.09; 'received:209.85.218': 0.10; 'python': 0.10; 'jan': 0.11; 'languages.': 0.15; '2016': 0.16; 'cc:name:python list': 0.16; 'dictionaries': 0.16; 'manuals.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'traceback.': 0.16; 'wrote:': 0.16; '>': 0.18; 'email addr:gmail.com>': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'names.': 0.22; 'programming': 0.22; 'plain': 0.24; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'indentation': 0.29; "i'm": 0.30; 'code': 0.30; '15,': 0.30; 'mention': 0.30; 'received:google.com': 0.35; 'text': 0.35; 'clear': 0.35; 'lists.': 0.35; 'something': 0.35; 'asking': 0.35; 'comment': 0.35; 'problem.': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'things': 0.38; 'version': 0.38; 'received:209': 0.38; 'someone': 0.38; 'data': 0.39; 'resources': 0.39; 'your': 0.60; 'avoid': 0.61; 'here': 0.66; 'articles': 0.67; 'subject.': 0.72; 'useful.': 0.72; 'have?': 0.84; 'obvious.': 0.84 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:to :cc:content-type; bh=s75oi6I1RsMZlG8p+z2lJe7aAHHflQ5DF6jGD7sRB7s=; b=mhkT327h1Y+lKq/Gkm+h7B+6KAJuUxkL8QEEIl3nHQLzeRoT+DY5G0YupravnET+VU 5PjSDmifcIUgYep8n6uPBrgP3+nEp6aDITdLwWeZ8Y+H8GVFxft5MpebjnuRVGmjS/Fr KPUkGsK5NWxky3bcJ7pSYNVAzoF4aP01pkm8bUrVzYnkO1eieCvs0E8OkqseJ7qcA9n/ d6qFasDXuTglNe0RTPx5KhZWenluT9q87xhsvT0LHxYNzBc7OqIJSvYlKaILukxAGYNg Ajzykq3D2R/dKWn3OfQBD4RfWd0msr+sD00C0wPdTdbfkj68uUHPMXadNFaaEr7AZ3U7 KWWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=s75oi6I1RsMZlG8p+z2lJe7aAHHflQ5DF6jGD7sRB7s=; b=On0UxLU3Ya0KTiQBAfeUsOxwf+yAhdK7NPvTrWlNwKVpJuYu3gLC23mYy7ipfrxg+y 1iuu+Szcl0x04ZgSWE+y3AVXvWnmCZunnVrb2yj1l3IKoIq8MlC14GqCtWU00xTAG4EF xv4HRiJFh+MaggXO0zRp99tTT6AJOlKQqmHtvJPme0iM/v3+dnVQDB1Q6D2Bp2wrNfij nWiYc0CtcsS15KJvpClYWFiIGqueNg0c76T5fwgNT6GldhU8LCOcj54EM6bIalrKo729 aIQHCHXXxe+LqmmH/hgjQO572oGl9CI8tAcNhl35tZSbazu69VN2CrHwBwL4prTMH8f9 /NoQ== X-Gm-Message-State: ALoCoQkoiphSZBDVCFGTh8xdILuJr4tFr49NoqZcJeYLj2SjdOtf1h9N3abgPN3kNwKq87Kt6k/6+dFUzFa1lSkT5f57fUF7JQ== X-Received: by 10.202.94.67 with SMTP id s64mr12824182oib.65.1452973293063; Sat, 16 Jan 2016 11:41:33 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ 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: , Xref: csiph.com comp.lang.python:101816 On Jan 15, 2016 8:20 PM, wrote: > > Are there any good resources on python best practices? e.g., articles What programming experience do you have? I'm thinking of languages. Here are a few of my guidelines - most not Python specific: Keep logic and data separate. Comment early and often - but don't comment the obvious. Use meaningful names. Read the manuals. Get familiar with modules. Someone has likely already solved the problem. Do not override built-in names. Follow these email lists. Avoid things like "if valid == True:". "if valid:" is sufficient. Read the manuals. When asking for help: Use a problem-specific subject. Use plain text so code keeps indentation Mention your Python version and OS. Include any traceback. If something is not clear try it in the interactive window. Dictionaries are very useful. Get familiar with them. HTH.