A little late, but the requirement to "Extract variable name from itself" is 
widely used in Django. Each field in a Django model, knows it's own variable 
name

user_name = models.CharField(...)

The instance of CharField knows that it's variable name is "user_name", so that 
it can name the row in the database the same.

On startup Django runs through the Model class searching for instances of Field 
and gets the name that way
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SJUKWXOJY6CLPAVTH4NZHDNFXND6USDM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to