Date: 2006-08-27 06:24 pm (UTC)
netch: (Default)
From: [personal profile] netch
Можно, хоть и грубо:


class A:
  pi = 3.14159265358979
  def __setattr__(self, name, value):
    if name == 'pi':
      raise RuntimeError, "Ruki proch' ot nashih konstant!"
    self.__dict__[name] = value

a = A()
print a.pi
a.pi = 5

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

netch: (Default)
netch

December 2023

S M T W T F S
     12
3456789
10111213141516
171819 20212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 22nd, 2026 03:15 pm
Powered by Dreamwidth Studios