This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: a new idea
Type: Stage: resolved
Components: Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, niacdoial, pitrou
Priority: normal Keywords:

Created on 2013-12-31 15:18 by niacdoial, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg207118 - (view) Author: Liam Marsh (niacdoial) Date: 2013-12-31 15:18
idea:
var():
input var name (str),
outputs var value
useful for(example in a chess program):

>>>count=1
>>>while count<=8:
...    var('a', count)='black queen'
...    count=count+1
msg207119 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-12-31 15:30
You should propose this to the python-ideas mailing list, but from your description is not clear to me what you want.
Can you try to explain it more in detail?
Are you asking for a new function that accepts the name of a variable as a string and prints its value?  Or for a function that creates dynamically a new "variable name"?

If you want to dynamically create variable names, it's better to just use a dictionary instead, e.g.:
d = {}
for count in range(1, 9):
    name = 'a' + str(count)
    d[name] = 'black queen'
msg207123 - (view) Author: Liam Marsh (niacdoial) Date: 2013-12-31 16:03
first, it was for the second idea, which can be replaced,
but maybe sameone needs it,
when you reed theese lines, this idea is sent.
meen while,
have a happy new year.
msg207129 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-01-01 01:56
This isn't a bug, please use https://mail.python.org/mailman/listinfo/python-ideas if you want to propose ideas.
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64298
2014-01-01 01:56:22pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg207129

resolution: not a bug
stage: resolved
2013-12-31 16:03:11niacdoialsetstatus: pending -> open

messages: + msg207123
2013-12-31 15:30:49ezio.melottisetstatus: open -> pending
versions: + Python 3.5, - Python 3.3
nosy: + ezio.melotti

messages: + msg207119
2013-12-31 15:18:51niacdoialcreate