¡@

Home 

python Programming Glossary: mutate

Why is `self` in Python objects immutable?

http://stackoverflow.com/questions/1015592/why-is-self-in-python-objects-immutable

Python hashable dicts

http://stackoverflow.com/questions/1151658/python-hashable-dicts

way to make a hashable dictionary. Just remember not to mutate them after embedding in another dictionary for obvious reasons...

Python - how does passing values work?

http://stackoverflow.com/questions/11585768/python-how-does-passing-values-work

is bound but to the same object. This means that you can mutate the passed in object but rebinding the name inside the function..

What limitations have closures in Python compared to language X closures?

http://stackoverflow.com/questions/141642/what-limitations-have-closures-in-python-compared-to-language-x-closures

0 ... def inner_writes y ... # Will look up outer's x then mutate it. ... x 0 y ... def inner_error y ... # Will now work because..

why does python's list.append evaluate to false?

http://stackoverflow.com/questions/1682567/why-does-pythons-list-append-evaluate-to-false

share improve this question Most Python methods that mutate a container in place return None an application of the principle..

Is there a way of checking for membership from the values of a dictionary? Once confirmed, can we do other things?

http://stackoverflow.com/questions/2304749/is-there-a-way-of-checking-for-membership-from-the-values-of-a-dictionary-once

What are your (concrete) use-cases for metaclasses in Python?

http://stackoverflow.com/questions/392160/what-are-your-concrete-use-cases-for-metaclasses-in-python

using a third party library it is useful to be able to mutate the class in a certain way. this is the only case I can think..

Object as a dictionary key

http://stackoverflow.com/questions/4901815/object-as-a-dictionary-key

provide an equals and hashcode method and promise not to mutate anything the hashcode depends on. What must I do in Python to..

Reading e-mails from Outlook with Python through MAPI

http://stackoverflow.com/questions/5077625/reading-e-mails-from-outlook-with-python-through-mapi

recommended approach from Microsoft since the # Inbox can mutate while you're iterating. # message messages.GetFirst while message..

Are urllib2 and httplib thread safe?

http://stackoverflow.com/questions/5825151/are-urllib2-and-httplib-thread-safe

urlopen with a Request object as the url parameter may mutate the Request object see the source for OpenerDirector.open so..

Increment a python floating point value by the smallest possible amount

http://stackoverflow.com/questions/6063755/increment-a-python-floating-point-value-by-the-smallest-possible-amount

How to optimally turn a multidimentional list into a single list of items in Python? [duplicate]

http://stackoverflow.com/questions/6679228/how-to-optimally-turn-a-multidimentional-list-into-a-single-list-of-items-in-pyt

list tuple items items # we will return a copy remove to mutate original for i _ in enumerate items while isinstance items i.. a flatten method. Like the sort and reverse methods this mutates the list and returns None . class listy list def flatten self..

python: Dictionaries of dictionaries merge

http://stackoverflow.com/questions/7204805/python-dictionaries-of-dictionaries-merge

has conflict merge 1 a A 2 b B 1 a A 2 b C note that this mutates a the contents of b are added to a which is also returned ... will be added to dict1. note i edited my initial answer to mutate the first argument that makes the reduce easier to explain ps..

Is there a way to overload += in python?

http://stackoverflow.com/questions/728361/is-there-a-way-to-overload-in-python

to override I end up with one of two problems 1 if __add__ mutates self then z x y will mutate x when I don't really want x to.. of two problems 1 if __add__ mutates self then z x y will mutate x when I don't really want x to be mutated there. 2 if __add__.. then z x y will mutate x when I don't really want x to be mutated there. 2 if __add__ returns a new object then tmp z z x z y..

Is it possible to modify variable in python that is in outer, but not global, scope?

http://stackoverflow.com/questions/8447947/is-it-possible-to-modify-variable-in-python-that-is-in-outer-but-not-global-sc

usually just use a mutable object like a list or dict and mutate the value instead of reassign. example def foo a def bar a.append..

Rectangular bounding box around blobs in a monochrome image using python

http://stackoverflow.com/questions/9525313/rectangular-bounding-box-around-blobs-in-a-monochrome-image-using-python

bbox.overlaps near_bbox # Expand both bboxes. # Since we mutate the bbox all references to this bbox in # bbox_map are updated..

Python: How do I pass a variable by reference?

http://stackoverflow.com/questions/986006/python-how-do-i-pass-a-variable-by-reference

method gets a reference to that same object and you can mutate it to your heart's delight but if you rebind the reference in.. still can't rebind the outer reference and you can't even mutate the object. Okay this is a little confusing. Let's have some..