pythonは、self地獄とか聞いたけど、this地獄でもいいのか。(Python 2.5.1で下のが動いた)

#! /usr/bin/python
# -*- coding: cp932 -*-
class Tag:
def __init__(this): = 100
def __str__(this):
return 'this data is ' + str(
def printData(this):
print 'printData method prints ' + str(
tag = Tag()
print tag
# vim: set ts=4 sw=4 sts=4 expandtab :

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.