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


Groups > comp.lang.python > #42292

Re: Python class and variable issue(newby question!)

Date 2013-03-29 18:56 -0400
From Dave Angel <davea@davea.name>
Subject Re: Python class and variable issue(newby question!)
References <78680654-5cf5-435c-9fce-19d6f5c23360@googlegroups.com> <6deb6120-e93d-429f-821f-437d25f0a761@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.3973.1364597787.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 03/29/2013 06:17 PM, Sam Berry wrote:
> Thanks for the responses! My issue was sorted with Benjamins post, just printing s worked.
>
> Cheers for the info though Chris, if i have any further issues il post them with some working code.
>
In that case, you probably should add a line like:


s = None

at the beginning of the code, along with a description of what s is 
supposed to represent (especially since the name doesn't reveal much).

And you should remove the class variable s.  It'll just confuse things.

I guess this isn't the place to rail about non-const globals.

-- 
DaveA

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


Thread

Python class and variable issue(newby question!) Sam Berry <sambez_14@hotmail.co.uk> - 2013-03-29 14:12 -0700
  Re: Python class and variable issue(newby question!) Chris Angelico <rosuav@gmail.com> - 2013-03-30 08:24 +1100
    Re: Python class and variable issue(newby question!) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-29 22:51 +0000
      Re: Python class and variable issue(newby question!) Chris Angelico <rosuav@gmail.com> - 2013-03-30 09:59 +1100
  Re: Python class and variable issue(newby question!) Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-03-29 14:23 -0700
  Re: Python class and variable issue(newby question!) Sam Berry <sambez_14@hotmail.co.uk> - 2013-03-29 15:17 -0700
    Re: Python class and variable issue(newby question!) Chris Angelico <rosuav@gmail.com> - 2013-03-30 09:45 +1100
    Re: Python class and variable issue(newby question!) Dave Angel <davea@davea.name> - 2013-03-29 18:56 -0400

csiph-web