Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Reimer Newsgroups: comp.lang.python Subject: Re: How much sanity checking is required for function inputs? Date: Sat, 23 Apr 2016 19:32:12 -0700 Lines: 23 Message-ID: References: <5713E52D.3060407@icloud.com> <1461131475.4042173.584042297.03DAB00E@webmail.messagingengine.com> <57171D23.40709@stoneleaf.us> <1461133057.4046578.584060569.2DD34821@webmail.messagingengine.com> <57185E88.30201@yahoo.com> <57197FC3.4030701@icloud.com> <1461291613.433097.586174185.01BB7E37@webmail.messagingengine.com> <57199BA5.4000703@icloud.com> <1461302724.477236.586265777.181ACCA0@webmail.messagingengine.com> <571C21A3.5090507@icloud.com> <571C302C.2010800@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de RNGnLLKI1HwvwcuB47uhNQZTZyYKhz/Pxd0WtxFBfDkg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.064 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'subject:How': 0.09; 'python': 0.10; 'programs.': 0.11; 'appropriate': 0.14; 'constants': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'scratch': 0.16; 'subject:required': 0.16; 'wrote:': 0.16; 'merge': 0.18; 'java': 0.22; 'parser': 0.22; 'file.': 0.22; 'bigger': 0.23; 'finished': 0.23; 'xml': 0.24; 'module': 0.25; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'received:17': 0.27; 'convince': 0.29; 'program,': 0.29; "i'm": 0.30; 'classes': 0.30; 'code': 0.30; 'convention': 0.30; 'probably': 0.31; "can't": 0.32; 'received:10.0.0': 0.32; 'class': 0.33; 'problem': 0.33; 'michael': 0.33; "i'll": 0.33; 'editor': 0.34; 'file': 0.34; 'received:10.0': 0.34; 'running': 0.34; 'text': 0.35; 'community': 0.36; 'but': 0.36; 'lines': 0.36; 'projects.': 0.36; 'to:addr :python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'agree': 0.37; 'beyond': 0.37; 'seem': 0.37; 'things': 0.38; 'building': 0.38; 'thank': 0.38; 'files': 0.38; 'why': 0.39; 'goes': 0.39; "didn't": 0.39; 'easily': 0.39; 'build': 0.40; 'to:addr:python.org': 0.40; 'header:MIME- version:1': 0.60; 'engine': 0.62; 'back': 0.62; 'per': 0.62; 'information': 0.63; 'college': 0.67; 'teach': 0.70; 'header:In- reply-to:1': 0.84; 'subject:much': 0.91; 'round,': 0.93; 'taught': 0.97 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-24_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1604240040 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-reply-to: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1461465131; bh=CiuiJlj4KV5yZqC74ZyBiHzkBi6ElJK/6OMz0RUqmfw=; h=Subject:To:From:Message-id:Date:MIME-version:Content-type; b=D6jAElexjbo2KQh//S5oT1fFwRONDuj17HIuAjZm+ZWkc+W/RT7HJxYJeeIf/Gb9d lRGRFquIupUxIizt06HP+ZD5+V8Vz4Z9RAPAth+CQpEB7w8tssRrWQDkRhYw9lx8oN hw9Evg08q7odbNSAqTpJu+rOmLvCHY/ADf7c1oN0+BtAJDfLHP7Snw5RhO8oCnFpcd LGHzwRzSEhWFZSC7HVDXhmMk2ukoROLPh+UaE0DKgPOQsnkOHgPOuXgfQ99jAs7CVt Jt8AW0wxVGrXY8ANO92V13x7o/mIMl7UIIRxaYxTZUkJz0rqGsX02DLDzpLvTLqhJC oa4Of1jUIhgLw== X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <571C302C.2010800@icloud.com> X-Mailman-Original-References: <5713E52D.3060407@icloud.com> <1461131475.4042173.584042297.03DAB00E@webmail.messagingengine.com> <57171D23.40709@stoneleaf.us> <1461133057.4046578.584060569.2DD34821@webmail.messagingengine.com> <57185E88.30201@yahoo.com> <57197FC3.4030701@icloud.com> <1461291613.433097.586174185.01BB7E37@webmail.messagingengine.com> <57199BA5.4000703@icloud.com> <1461302724.477236.586265777.181ACCA0@webmail.messagingengine.com> <571C21A3.5090507@icloud.com> Xref: csiph.com comp.lang.python:107530 On 4/23/2016 6:38 PM, Michael Selik wrote: > Why so many files? Python can easily support thousands of lines in a > file. If it's just one file any text editor can do a quick find-replace. That goes back to the Java convention of having one class per file. It took a while to convince myself that mixing classes and functions in a single file was okay. Once I finished cleaning up the code for this round, I'll merge four files into one file (~500 lines) and have four files (main.py, display.py, engine.py and utility.py). > Or just use one file to keep things easier. But, yes, I agree a module > of constants is appropriate for bigger projects. That's the other problem I'm running into. Building a chess engine is a big project. This is probably bigger than the Java XML parser I built from scratch for a college project. I can't seem to find any information on how to build bigger programs. Community college taught me how to program, but it didn't teach me how to go beyond class inheritance. Thank you, Chris R.