[issue27070] Add ability to freeze (seal) mutable objects

2016-05-21 Thread Eric V. Smith
Eric V. Smith added the comment: There's a link in the PEP to the discussion on why it was rejected. There's a lot to read in the thread (I just spent 30 minutes re-reading it!). I'm going to close this. If you'd like to re-open the discussion with new insights, I'd suggest posting to

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread Марк Коренберг
Марк Коренберг added the comment: Great. Do you have information why this PEP was rejected? This was exactly what I want. -- ___ Python tracker ___

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread Eric V. Smith
Eric V. Smith added the comment: See the rejected PEP 351: https://www.python.org/dev/peps/pep-0351/ -- nosy: +eric.smith ___ Python tracker ___

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread ppperry
ppperry added the comment: Python is not the type of language in which one applies such memory micro-optimizations. In any case, if you really need to do this, use a custom class that subclasses `list` and overrides the modification methods to add a check. --

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread Марк Коренберг
Марк Коренберг added the comment: making tuples (from lists), fronzensets(from sets) and bytes (from bytearray) requires memory copying. Especially for bytearrays. -- ___ Python tracker

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread ppperry
ppperry added the comment: Use tuples, frozensets, and bytes for the first three cases instead. I don't quite see what the benefit of this is. It seems arbitrarily restrictive. -- nosy: +ppperry ___ Python tracker

[issue27070] Add ability to freeze (seal) mutable objects

2016-05-20 Thread Марк Коренберг
New submission from Марк Коренберг: I mean making mutable object immutable. I speak about List(), Set(), bytearray(), memoryview(), mmap() and so on. bytearray already have `hold`, to lock size only, but it still not represented in Python. -- components: Library (Lib) messages: