Evaluating python - a question

Erno Kuusela erno-news at erno.iki.fi
Thu May 17 21:36:41 CEST 2001


In article <9e100t$8e1$1 at news.netmar.com>,
alan.prescott at nospam.jarrold.com writes:

| This class has an attibute of forename so

| me = person()
| me.forename = 'Alan' 

| is Ok but a simple typo (especially with my keyboard skills) of

| me.froname = 'Fred'

| will go undetected and I'll have to spend ages digging around to find a bug
| which languages like C/C++/Pascal would throw out at compile time.

using accessor methods instead of referencing the attributes directly
causes these to get caught immediately.

  -- erno



More information about the Python-list mailing list