ProcStack / pxlTextGenerator

Gather handwriting from a photo/scan into a character library; Export text as 'handwritten' images!
GNU General Public License v3.0
2 stars 2 forks source link

Python Memory Instancing; Investigate the break down between unique and shared #17

Open ProcStack opened 5 years ago

ProcStack commented 5 years ago

Python doesn't have pointers, but does seem that arrays can be shared as variables. Where setting variables to arrays will inherit changes from the former. I'm calling many MANY pixmap.toImage(pixmap) series.

ToDo-

ProcStack commented 5 years ago

Non instancing situations found-

a=5
b=a
a=9
print a
  - 9
print b
  - 5
a=4
b=[5,6,7]
b.append(a)
-OR-
b=[5,6,7,a]
a=10
print a
  - 10
print b
  - [5, 6, 7, 4]

Break case-

a=[6,5]
b=a
print b
  - [6, 5]
a[0]=9
print b
  - [9, 5]
 a=[6,7,8]
b=a
b[0]=2
print a
  - [2, 7, 8]
print b
  - [2, 7, 8]