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


Groups > comp.lang.python > #35501

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

Newsgroups comp.lang.python
Date 2012-12-25 15:42 -0800
References (4 earlier) <50d9adb5$0$29967$c3e8da3$5496439d@news.astraweb.com> <04786b93-4b0c-41fd-adfe-b89cb35c886c@googlegroups.com> <mailman.1269.1356455469.29569.python-list@python.org> <0d16cf90-88bc-4f0b-8775-c0fdbf05bc94@googlegroups.com> <mailman.1274.1356469797.29569.python-list@python.org>
Subject Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)
From Rick Johnson <rantingrickjohnson@gmail.com>
Message-ID <mailman.1275.1356479669.29569.python-list@python.org> (permalink)

Show all headers | View raw


On Tuesday, December 25, 2012 3:08:21 PM UTC-6, Dennis Lee Bieber wrote:
> Only that many of us don't believe Python has /variables/, the use
> of instance/class as a modifier is thereby moot.

What IS a variable Dennis?
#
############################################################
#                Variable (ComputerScience)                #
############################################################
# In computer programming, a variable is a storage         #
# location and an associated symbolic name (an identifier) #
# which contains some known or unknown quantity or         #
# information, a value. The variable name is the usual way #
# to reference the stored value; this separation of name   #
# and content allows the name to be used independently of  #
# the exact information it represents. [...] The           #
# identifier in computer source code can be bound to a     #
# value during run time, and the value of the variable may #
# thus change during the course of program execution.      #
############################################################
#
With that accurate definition in mind you can now understand how Python classes CAN and DO have variables, just as Python modules have variables; psst: they're called "global variables"!

Now, whilst i don't believe we should haphazardly re-define the definition of CS terms (or worse, re-invent the wheel by inventing new terms when perfectly good terms exist) I DO believe we should interpret these terms in their current context.

For instance, Python has no REAL "global variables", so we can happily refer to module level variables as global variables. However in many other languages (like Ruby for instance) we can declare REAL "global variables" that are known across all namespaces. And since Ruby also has modules which /themselves/ can contain variables, we would refer to "module level variables" as "module variables". 

> An instance method is a method that works on an instance of the
> class, whereas a class method is meant to work on the class as a
> whole

Allow me to use better terms:

  An instance method is a method that is known to an
  instance of the class only, whereas a class method is
  known to all instances and accessible from the class
  identifier

Now with that clear description in mind, apply it to variables:

  An instance method is a method that is known to an
  instance of the class only, whereas a class method is known
  to all instances and accessible from the class identifier.

This transformation is without flaw because it is based on logic and not emotion.

> ...I don't know of anyone arguing that Python does not have
> "methods".

Of course not because they would have to be insane. However, we should never adopt illogical terms just because a few folks cannot resolve the definition of the proper terms.

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


Thread

[Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 02:59 -0800
  Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Peter Otten <__peter__@web.de> - 2012-12-22 12:43 +0100
    Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:38 -0800
      Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Peter Otten <__peter__@web.de> - 2012-12-22 14:54 +0100
        Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 08:36 -0800
        Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 08:36 -0800
    Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:38 -0800
      Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:45 -0800
        Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Terry Reedy <tjreedy@udel.edu> - 2012-12-22 16:30 -0500
      Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:45 -0800
        Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-22 18:26 +0100
          Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 10:10 -0800
            Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-22 20:29 +0100
              Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 12:43 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-22 22:59 +0100
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 01:32 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Terry Reedy <tjreedy@udel.edu> - 2012-12-23 20:53 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-24 14:10 +0100
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-22 17:03 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Cameron Simpson <cs@zip.com.au> - 2012-12-23 21:55 +1100
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 12:59 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Peter Otten <__peter__@web.de> - 2012-12-23 22:14 +0100
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 12:59 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Roy Smith <roy@panix.com> - 2012-12-23 16:15 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 13:42 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2012-12-23 23:38 +0000
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-24 00:01 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Thomas Bach <thbach@students.uni-mainz.de> - 2012-12-24 06:18 +0100
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 00:19 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-24 00:23 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Cameron Simpson <cs@zip.com.au> - 2012-12-24 21:32 +1100
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 10:48 -0500
                Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Ranting Rick <rantingrickjohnson@gmail.com> - 2012-12-24 21:10 -0800
                Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 04:55 -0800
                Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-25 16:04 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 11:47 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 18:09 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-24 00:23 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-25 13:44 +0000
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 06:41 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-25 12:10 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 09:31 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 09:31 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 12:16 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-25 16:08 -0500
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 15:42 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Michael Torrie <torriem@gmail.com> - 2012-12-26 12:20 -0700
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Michael Torrie <torriem@gmail.com> - 2012-12-26 11:58 -0700
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 15:42 -0800
                Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) alex23 <wuwei23@gmail.com> - 2012-12-25 19:18 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 12:16 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-25 22:56 +0000
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 16:19 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-26 08:29 +0000
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-26 20:07 -0800
                Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-27 05:02 +0000
                Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Ranting Rick <rantingrickjohnson@gmail.com> - 2012-12-26 22:50 -0800
                Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Chris Angelico <rosuav@gmail.com> - 2012-12-27 23:58 +1100
                Re: Require help migrating from Perl to Python 2.7 (namespaces) alex23 <wuwei23@gmail.com> - 2012-12-27 05:25 -0800
  Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 01:36 -0800

csiph-web