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


Groups > comp.lang.python > #107471

Re: How much sanity checking is required for function inputs?

From Ethan Furman <ethan@stoneleaf.us>
Newsgroups comp.lang.python
Subject Re: How much sanity checking is required for function inputs?
Date 2016-04-21 19:10 -0700
Message-ID <mailman.1.1461290981.2861.python-list@python.org> (permalink)
References (2 earlier) <57171D23.40709@stoneleaf.us> <1461133057.4046578.584060569.2DD34821@webmail.messagingengine.com> <57185E88.30201@yahoo.com> <57197FC3.4030701@icloud.com> <57198827.1020608@stoneleaf.us>

Show all headers | View raw


On 04/21/2016 06:34 PM, Christopher Reimer wrote:

> class PieceFactory(object):
 > [...]

Better.

> I do plan to incorporate a sanity test in each Piece class to validate
> the initial position value. Pawns have 16 specific positions. Bishop,
> Knight and Rook each have four specific positions. King and Queen each
> have two specific positions. An invalid value will raise an exception.

This will make it so you cannot use your PieceFactory for custom setups.

--
~Ethan~

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


Thread

Re: How much sanity checking is required for function inputs? Ethan Furman <ethan@stoneleaf.us> - 2016-04-21 19:10 -0700

csiph-web