In article <[EMAIL PROTECTED]>,
Christopher Subich <[EMAIL PROTECTED]> wrote:
.
.
.
>Out of curiosity, where would you classify interpreters for secondary
>app-specific programming languages? Specifically, mud-client stored
On Tue, 14 Jun 2005, Scott David Daniels wrote:
> Tom Anderson wrote:
>> ... If it's not, try:
>> x = "myVarName"
>> y = "myVarValue"
>> locals()[x] = y
>
> Sorry, this works with globals(), but not with locals().
Oh, weird. It works when i tried it.
Aaaah, i only tried it at the interactive pro
Steven D'Aprano wrote:
> On Mon, 13 Jun 2005 12:18:31 -0400, Ali Razavi wrote:
>
>
>>Is there any reflective facility in python
>>that I can use to define a variable with a
>>name stored in another variable ?
>>like I have :
>>x = "myVarName"
>>
>>what can I do to declare a new variable with the
Tom Anderson wrote:
> ... If it's not, try:
> x = "myVarName"
> y = "myVarValue"
> locals()[x] = y
Sorry, this works with globals(), but not with locals().
There isn't a simple way to fiddle the locals (the number
is determined when the function is built).
I do, however, agree with you about what
On Mon, 13 Jun 2005, Ali Razavi wrote:
> Tom Anderson wrote:
>> On Mon, 13 Jun 2005, Ali Razavi wrote:
>>
>>> Is there any reflective facility in python that I can use to define a
>>> variable with a name stored in another variable ?
>>>
>>> like I have :
>>> x = "myVarName"
>>>
>>> what can I
Cameron Laird wrote:
> cleaner algorithm somewhere in the neighborhood. In general,
> "application-level" programming doesn't need exec() and such.
>
> PyPy and debugger writers and you other "systems" programmers
> already know who you are.
Out of curiosity, where would you classify interprete
In article <[EMAIL PROTECTED]>,
Ali Razavi <[EMAIL PROTECTED]> wrote:
>Tom Anderson wrote:
>> On Mon, 13 Jun 2005, Ali Razavi wrote:
>>
>>> Is there any reflective facility in python that I can use to define a
>>> variable with a name stored in another variable ?
.
In article <[EMAIL PROTECTED]>,
Peter Dembinski <[EMAIL PROTECTED]> wrote:
>Benji York <[EMAIL PROTECTED]> writes:
>
>[snap]
>
>>> code = x + '= 0'
>>> exec(code)
>>
>> You should generally stay away from exec for lots of reasons.
>
>Code 'refactorizability' is one of them.
There's an affirmative
On Mon, 13 Jun 2005 12:18:31 -0400, Ali Razavi wrote:
> Is there any reflective facility in python
> that I can use to define a variable with a
> name stored in another variable ?
> like I have :
> x = "myVarName"
>
> what can I do to declare a new variable with the name of the string
> stored in
On Mon, 13 Jun 2005, Peter Dembinski wrote:
> Tom Anderson <[EMAIL PROTECTED]> writes:
>
> [snap]
>
>> The MAtrix had evarything in it: guns, a juimping off teh walls, flying
>> guns, a bullet tiem, evil computar machenes, numbers that flew, flying
>> gun bullets in slowar motian, juimping into
Tom Anderson wrote:
> On Mon, 13 Jun 2005, Ali Razavi wrote:
>
>> Is there any reflective facility in python that I can use to define a
>> variable with a name stored in another variable ?
>>
>> like I have :
>> x = "myVarName"
>>
>> what can I do to declare a new variable with the name of the st
Tom Anderson <[EMAIL PROTECTED]> writes:
[snap]
> The MAtrix had evarything in it: guns, a juimping off teh walls,
> flying guns, a bullet tiem, evil computar machenes, numbers that
> flew, flying gun bullets in slowar motian, juimping into a gun, dead
> police men, computar hackeing, Kevin Mitni
On Mon, 13 Jun 2005, Ali Razavi wrote:
> Is there any reflective facility in python that I can use to define a
> variable with a name stored in another variable ?
>
> like I have :
> x = "myVarName"
>
> what can I do to declare a new variable with the name of the string
> stored in x. And how ca
Benji York <[EMAIL PROTECTED]> writes:
[snap]
>> code = x + '= 0'
>> exec(code)
>
> You should generally stay away from exec for lots of reasons.
Code 'refactorizability' is one of them.
--
http://mail.python.org/mailman/listinfo/python-list
Ali Razavi wrote:
> Ali Razavi wrote:
>
>>Is there any reflective facility in python
>>that I can use to define a variable with a
>>name stored in another variable ?
> Got it! use higher order functions like Lisp!
No, you use higher order functions like Python. :)
> code = x + '= 0'
> exec(cod
Ali Razavi wrote:
> Is there any reflective facility in python
> that I can use to define a variable with a
> name stored in another variable ?
> like I have :
> x = "myVarName"
>
> what can I do to declare a new variable with the name of the string
> stored in x. And how can I access that implici
16 matches
Mail list logo