readonly-collection

How to make dictionary read-only?

How to make dictionary read-only? Question: I have a class like: class A: def __init__(self): self.data = {} and at some moment I want to prohibit self.data fields modification. I’ve read in PEP-416 rejection notice that there are a lot of ways to do it. So I’d like to find what they are. I tried …

Total answers: 5