class_docstr: Persistent vector implementation. Meant as a replacement for the cases where you would normally
  use a Python list.
  
  Do not instantiate directly, instead use the factory functions :py:func:`v` and :py:func:`pvector` to
  create an instance.
  
  Heavily influenced by the persistent vector available in Clojure. Initially this was more or
  less just a port of the Java code for the Clojure vector. It has since been modified and to
  some extent optimized for usage in Python.
  
  The vector is organized as a trie, any mutating method will return a new vector that contains the changes. No
  updates are done to the original vector. Structural sharing between vectors are applied where possible to save
  space and to avoid making complete copies.
  
  This structure corresponds most closely to the built in list type and is intended as a replacement. Where the
  semantics are the same (more or less) the same function names have been used but for some cases it is not possible,
  for example assignments.
  
  The PVector implements the Sequence protocol and is Hashable.
  
  Inserts are amortized O(1). Random access is log32(n) where n is the size of the vector.
  
  The following are examples of some common operations on persistent vectors:
  
  >>> p = v(1, 2, 3)
  >>> p2 = p.append(4)
  >>> p3 = p2.extend([5, 6, 7])
  >>> p
  pvector([1, 2, 3])
  >>> p2
  pvector([1, 2, 3, 4])
  >>> p3
  pvector([1, 2, 3, 4, 5, 6, 7])
  >>> p3[5]
  6
  >>> p.set(1, 99)
  pvector([1, 99, 3])
  >>>
class_docstr_tok: ["Persistent","vector","implementation",".","Meant","as","a","replacement","for","the","cases","where","you","would","normally","use","a","Python","list",".","Do","not","instantiate","directly",",","instead","use","the","factory","functions",":","py",":","func",":","`","v","`","and",":","py",":","func",":","`","pvector","`","to","create","an","instance",".","Heavily","influenced","by","the","persistent","vector","available","in","Clojure",".","Initially","this","was","more","or","less","just","a","port","of","the","Java","code","for","the","Clojure","vector",".","It","has","since","been","modified","and","to","some","extent","optimized","for","usage","in","Python",".","The","vector","is","organized","as","a","trie",",","any","mutating","method","will","return","a","new","vector","that","contains","the","changes",".","No","updates","are","done","to","the","original","vector",".","Structural","sharing","between","vectors","are","applied","where","possible","to","save","space","and","to","avoid","making","complete","copies",".","This","structure","corresponds","most","closely","to","the","built","in","list","type","and","is","intended","as","a","replacement",".","Where","the","semantics","are","the","same","(","more","or","less",")","the","same","function","names","have","been","used","but","for","some","cases","it","is","not","possible",",","for","example","assignments",".","The","PVector","implements","the","Sequence","protocol","and","is","Hashable",".","Inserts","are","amortized","O","(","1",")",".","Random","access","is","log32","(","n",")","where","n","is","the","size","of","the","vector",".","The","following","are","examples","of","some","common","operations","on","persistent","vectors",":",">",">",">","p","=","v","(","1",",","2",",","3",")",">",">",">","p2","=","p.append","(","4",")",">",">",">","p3","=","p2.extend","(","[","5",",","6",",","7","]",")",">",">",">","p","pvector","(","[","1",",","2",",","3","]",")",">",">",">","p2","pvector","(","[","1",",","2",",","3",",","4","]",")",">",">",">","p3","pvector","(","[","1",",","2",",","3",",","4",",","5",",","6",",","7","]",")",">",">",">","p3","[","5","]","6",">",">",">","p.set","(","1",",","99",")","pvector","(","[","1",",","99",",","3","]",")",">",">",">"]
docstr: Create a new evolver for this pvector. The evolver acts as a mutable view of the vector
  with "transaction like" semantics. No part of the underlying vector i updated, it is still
  fully immutable. Furthermore multiple evolvers created from the same pvector do not
  interfere with each other.
  
  You may want to use an evolver instead of working directly with the pvector in the
  following cases:
  
  * Multiple updates are done to the same vector and the intermediate results are of no
    interest. In this case using an evolver may be a more efficient and easier to work with.
  * You need to pass a vector into a legacy function or a function that you have no control
    over which performs in place mutations of lists. In this case pass an evolver instance
    instead and then create a new pvector from the evolver once the function returns.
  
  The following example illustrates a typical workflow when working with evolvers. It also
  displays most of the API (which i kept small by design, you should not be tempted to
  use evolvers in excess ;-)).
  
  Create the evolver and perform various mutating updates to it:
  
  >>> v1 = v(1, 2, 3, 4, 5)
  >>> e = v1.evolver()
  >>> e[1] = 22
  >>> _ = e.append(6)
  >>> _ = e.extend([7, 8, 9])
  >>> e[8] += 1
  >>> len(e)
  9
  
  The underlying pvector remains the same:
  
  >>> v1
  pvector([1, 2, 3, 4, 5])
  
  The changes are kept in the evolver. An updated pvector can be created using the
  persistent() function on the evolver.
  
  >>> v2 = e.persistent()
  >>> v2
  pvector([1, 22, 3, 4, 5, 6, 7, 8, 10])
  
  The new pvector will share data with the original pvector in the same way that would have
  been done if only using operations on the pvector.
docstr_tok: ["Create","a","new","evolver","for","this","pvector",".","The","evolver","acts","as","a","mutable","view","of","the","vector","with","``","transaction","like","''","semantics",".","No","part","of","the","underlying","vector","i","updated",",","it","is","still","fully","immutable",".","Furthermore","multiple","evolvers","created","from","the","same","pvector","do","not","interfere","with","each","other",".","You","may","want","to","use","an","evolver","instead","of","working","directly","with","the","pvector","in","the","following","cases",":","*","Multiple","updates","are","done","to","the","same","vector","and","the","intermediate","results","are","of","no","interest",".","In","this","case","using","an","evolver","may","be","a","more","efficient","and","easier","to","work","with",".","*","You","need","to","pass","a","vector","into","a","legacy","function","or","a","function","that","you","have","no","control","over","which","performs","in","place","mutations","of","lists",".","In","this","case","pass","an","evolver","instance","instead","and","then","create","a","new","pvector","from","the","evolver","once","the","function","returns",".","The","following","example","illustrates","a","typical","workflow","when","working","with","evolvers",".","It","also","displays","most","of","the","API","(","which","i","kept","small","by","design",",","you","should","not","be","tempted","to","use","evolvers","in","excess",";","-",")",")",".","Create","the","evolver","and","perform","various","mutating","updates","to","it",":",">",">",">","v1","=","v","(","1",",","2",",","3",",","4",",","5",")",">",">",">","e","=","v1.evolver","(",")",">",">",">","e","[","1","]","=","22",">",">",">","_","=","e.append","(","6",")",">",">",">","_","=","e.extend","(","[","7",",","8",",","9","]",")",">",">",">","e","[","8","]","+=","1",">",">",">","len","(","e",")","9","The","underlying","pvector","remains","the","same",":",">",">",">","v1","pvector","(","[","1",",","2",",","3",",","4",",","5","]",")","The","changes","are","kept","in","the","evolver",".","An","updated","pvector","can","be","created","using","the","persistent","(",")","function","on","the","evolver",".",">",">",">","v2","=","e.persistent","(",")",">",">",">","v2","pvector","(","[","1",",","22",",","3",",","4",",","5",",","6",",","7",",","8",",","10","]",")","The","new","pvector","will","share","data","with","the","original","pvector","in","the","same","way","that","would","have","been","done","if","only","using","operations","on","the","pvector","."]
code: def evolver(self):
      """
      Create a new evolver for this pvector. The evolver acts as a mutable view of the vector
      with "transaction like" semantics. No part of the underlying vector i updated, it is still
      fully immutable. Furthermore multiple evolvers created from the same pvector do not
      interfere with each other.
  
      You may want to use an evolver instead of working directly with the pvector in the
      following cases:
  
      * Multiple updates are done to the same vector and the intermediate results are of no
        interest. In this case using an evolver may be a more efficient and easier to work with.
      * You need to pass a vector into a legacy function or a function that you have no control
        over which performs in place mutations of lists. In this case pass an evolver instance
        instead and then create a new pvector from the evolver once the function returns.
  
      The following example illustrates a typical workflow when working with evolvers. It also
      displays most of the API (which i kept small by design, you should not be tempted to
      use evolvers in excess ;-)).
  
      Create the evolver and perform various mutating updates to it:
  
      >>> v1 = v(1, 2, 3, 4, 5)
      >>> e = v1.evolver()
      >>> e[1] = 22
      >>> _ = e.append(6)
      >>> _ = e.extend([7, 8, 9])
      >>> e[8] += 1
      >>> len(e)
      9
  
      The underlying pvector remains the same:
  
      >>> v1
      pvector([1, 2, 3, 4, 5])
  
      The changes are kept in the evolver. An updated pvector can be created using the
      persistent() function on the evolver.
  
      >>> v2 = e.persistent()
      >>> v2
      pvector([1, 22, 3, 4, 5, 6, 7, 8, 10])
  
      The new pvector will share data with the original pvector in the same way that would have
      been done if only using operations on the pvector.
      """
  
imports: from abc import abstractmethod, ABCMeta
  from ._compat import Sequence, Hashable
  from numbers import Integral
  import operator
  import six
  from pyrsistent._transformations import transform
label_desc: Use image node_id 6 for calling the PVector obj's underlying member method code with example usage: obj.evolver() without return types