Q:

In python SQLAlchemy model, Why are some attributes initialized twice?

In this piece of code:
class Page(Base):
  __tablename__ = 'page'
  id = Column(Integer, primary_key=True)
  name = Column(Text, unique=True)
  data = Column(Text)

  def __init__(self, name, data):
    self.name = name
    self.data = data

Which is a model in pyramid framework (the python framework), And will be later used by SQLAlchemy, name and data are initialized twice:
name = Column... # First assignments.
self.name = name # Second time assignments.

It's in pyramid's tutorial, And according to the fact that assignment operator can not be overloaded in python, Is "name = Column(...)" necessary?
Or am i totally wrong and name=Column(...) has some special meaning?

A:

The outer scope is declaring a field for the benefit of the class.  The inner scope is initializing the object's field to a particular value.
name = Column(...)

is describing one of the members of the Page class ("Page is composed of a field called 'name', ...), whereas
self.name = name

is initializing one particular instance of Page to one particular value.  ("this Page() has a name of "framistan").

