<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/python-vvm/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 09 Jun 2016 12:09:53 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/python-vvm/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -21,7 +21,11 @@

     # define a const variable
     myVars.defineConstVariable('myconst', 13)
-    myVars['myconst'] = 14 # &amp;lt;- this raises an error, since 'myconst' must not be changed
+    try:
+        myVars['myconst'] = 14 # &amp;lt;- this raises an error, since 'myconst' must not be changed
+        print("not allowed")
+    except AttributeError as e:
+        pass

     # rename a variable
     myVars.renameVariable('myconst', 'myconstOther')
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 12:09:53 -0000</pubDate><guid>https://sourceforge.netca13b85e38e34c13dba6fd99832711090aafac7c</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -11,7 +11,7 @@
     * to raise an exception on overwriting for different types
     * etc.

-Some Exapmles
+Some Examples:

     from variableVariablesManager import VariableVariablesManager

@@ -44,6 +44,7 @@
     testGlobalVar()
     print("outside function myVars['globalVar']:", myVars['globalVar'])

+
 If you wish to allow overwriting of variables with the same type only:

     myVars = VariableVariablesManager(enforceSameTypeOnOverride = True)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:59:20 -0000</pubDate><guid>https://sourceforge.net88b76b906a6387a6ff85a484a617fb1b5ecb7099</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -13,7 +13,7 @@

 Some Exapmles

-   from variableVariablesManager import VariableVariablesManager
+    from variableVariablesManager import VariableVariablesManager

     myVars = VariableVariablesManager()
     myVars['test'] = 25
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:58:55 -0000</pubDate><guid>https://sourceforge.net5ce92249d12ab8a122052a104b2cacbc8ac187be</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -13,8 +13,7 @@

 Some Exapmles

- ~~~
-    from variableVariablesManager import VariableVariablesManager
+   from variableVariablesManager import VariableVariablesManager

     myVars = VariableVariablesManager()
     myVars['test'] = 25
@@ -44,8 +43,6 @@
         print("inside function myVars['globalVar'] (having been changed):", myVars['globalVar'])
     testGlobalVar()
     print("outside function myVars['globalVar']:", myVars['globalVar'])
-~~~
-

 If you wish to allow overwriting of variables with the same type only:

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:58:41 -0000</pubDate><guid>https://sourceforge.net6bd9db2805e41754ca26958bf8bd3e785548d191</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -14,7 +14,7 @@
 Some Exapmles

  ~~~
-   from variableVariablesManager import VariableVariablesManager
+    from variableVariablesManager import VariableVariablesManager

     myVars = VariableVariablesManager()
     myVars['test'] = 25
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:58:07 -0000</pubDate><guid>https://sourceforge.neta17ccc617e68d1bfc0b79b066fda98f9b7db41f2</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -11,8 +11,10 @@
     * to raise an exception on overwriting for different types
     * etc.

-    ~~~
-from variableVariablesManager import VariableVariablesManager
+Some Exapmles
+    
+ ~~~
+   from variableVariablesManager import VariableVariablesManager

     myVars = VariableVariablesManager()
     myVars['test'] = 25
@@ -44,6 +46,7 @@
     print("outside function myVars['globalVar']:", myVars['globalVar'])
 ~~~

+
 If you wish to allow overwriting of variables with the same type only:

     myVars = VariableVariablesManager(enforceSameTypeOnOverride = True)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:57:47 -0000</pubDate><guid>https://sourceforge.nete5306bf1ebede7aa63de7ec426f42a5cadb8fb5a</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,3 +1,5 @@
+Addressing the question for variable variables in python (i.e. variables with variable names), which has been posed on stackoverflow: http://stackoverflow.com/questions/1373164/how-do-i-do-variable-variables-in-python 
+
 The consensus is to use a dictionary for this. This is a good idea for most cases, however, there are many aspects arising from this:

  * you'll yourself be responsible for this dictionary, including garbage collection (of in-dict variables) etc.
@@ -9,9 +11,8 @@
     * to raise an exception on overwriting for different types
     * etc.

-
-
-    from variableVariablesManager import VariableVariablesManager
+    ~~~
+from variableVariablesManager import VariableVariablesManager

     myVars = VariableVariablesManager()
     myVars['test'] = 25
@@ -41,6 +42,7 @@
         print("inside function myVars['globalVar'] (having been changed):", myVars['globalVar'])
     testGlobalVar()
     print("outside function myVars['globalVar']:", myVars['globalVar'])
+~~~

 If you wish to allow overwriting of variables with the same type only:

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:57:14 -0000</pubDate><guid>https://sourceforge.net162fc0e286600834403cb5fb0004663751a5d894</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,52 @@
-Welcome to your wiki!
+The consensus is to use a dictionary for this. This is a good idea for most cases, however, there are many aspects arising from this:

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+ * you'll yourself be responsible for this dictionary, including garbage collection (of in-dict variables) etc.
+ * there's either no locality or globality for variable variables, it depends on the globality of the dictionary
+ * if you want to rename a variable name, you'll have to do it manually
+ * however, you are much more flexible, e.g.
+    * you can decide to overwrite existing variables or ...
+    * ... choose to implement const variables
+    * to raise an exception on overwriting for different types
+    * etc.

-The wiki uses [Markdown](/p/python-vvm/wiki/markdown_syntax/) syntax.
+
+
+    from variableVariablesManager import VariableVariablesManager
+
+    myVars = VariableVariablesManager()
+    myVars['test'] = 25
+    print(myVars['test'])
+
+    # define a const variable
+    myVars.defineConstVariable('myconst', 13)
+    myVars['myconst'] = 14 # &amp;lt;- this raises an error, since 'myconst' must not be changed
+
+    # rename a variable
+    myVars.renameVariable('myconst', 'myconstOther')
+
+    # preserve locality
+    def testLocalVar():
+        myVars = VariableVariablesManager()
+        myVars['test'] = 13
+        print("inside function myVars['test']:", myVars['test'])
+    testLocalVar()
+    print("outside function myVars['test']:", myVars['test'])
+
+    # define a global variable
+    myVars.defineGlobalVariable('globalVar', 12)
+    def testGlobalVar():
+        myVars = VariableVariablesManager()
+        print("inside function myVars['globalVar']:", myVars['globalVar'])
+        myVars['globalVar'] = 13
+        print("inside function myVars['globalVar'] (having been changed):", myVars['globalVar'])
+    testGlobalVar()
+    print("outside function myVars['globalVar']:", myVars['globalVar'])
+
+If you wish to allow overwriting of variables with the same type only:
+
+    myVars = VariableVariablesManager(enforceSameTypeOnOverride = True)
+    myVars['test'] = 25
+    myVars['test'] = "Cat" # &amp;lt;- raises Exception (different type on overwriting)

 [[members limit=20]]
 [[download_button]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Thu, 09 Jun 2016 11:56:19 -0000</pubDate><guid>https://sourceforge.net20a02badb48ba6604eda85b13881ecac9d63de17</guid></item><item><title>Home modified by Dominik R.</title><link>https://sourceforge.net/p/python-vvm/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/python-vvm/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
	&lt;ul class="md-users-list"&gt;
		&lt;li&gt;&lt;a href="/u/domsen/"&gt;Dominik R.&lt;/a&gt; (admin)&lt;/li&gt;
		
	&lt;/ul&gt;&lt;br/&gt;
&lt;p&gt;&lt;span class="download-button-5757f018f1fd8d54e7651db4" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dominik R.</dc:creator><pubDate>Wed, 08 Jun 2016 10:14:49 -0000</pubDate><guid>https://sourceforge.net95bb94c0894abdb9ea0e01c77a1f077d90bdbddc</guid></item></channel></rss>