Are decorators really that different from metaclasses...
paolo.veronelli at yahoo.it
Thu Aug 26 18:24:02 CEST 2004
Anthony Baxter wrote:
> On Thu, 26 Aug 2004 10:28:14 +0200, Paolo Veronelli
> <paolo.veronelli at yahoo.it> wrote:
>>It's not the ideas complexity that fears,but the feeling we are trying
>>to bring down to earth the supposed magic of some language solutions.
>>There is nothing good in magic,specially when you have to build robust
>>things on it.
> I have no idea what you're trying to say here. Are you saying that the
> approach of double-under variables inside a function having some new
> meaning, getting put into a new scope that did not previously exist,
> is somehow _less_ magical that the syntactic sugar of decorators?
I would like to erase magic from code and have some kind of
specification for the double-under variables.
if __metaclass__ is not a keyword I suppose it's a reference
but.....this is not enough:assigning it is a meta-coding action.
So let's classify these actions and see what kind of meta-coding
decorators are .
This should be done before the creation of a new syntax,a good syntax
for all meta-coding.
> so, how do you intend to handle the backwards compatibility issue,
> where code that works on Python2.4 will do something entirely
> different on Python2.3 (the double-under variables will be silently
This is not a problem for me.If it's the case I don't really care of
zoombies,I'm a researcher not a politician,
I'm trying to develope a thought around a pragmatic good language,and
possibly evolve my knowledge of it.
Next generation will measure better our efforts.
> Do you intend that the double-under names would also be
> looked for in the same scopes? That is, what will this code do?
> def foo():
> __name__ = '%s_banana'%(__name__)
Has it anything to do with our talking?Sharp features are sharp.If
somebody want to obfuscate code he can do it,he is free of playing this
>>If this blows away clouds on the language future and bring back the
>>useful features in a wider theory where metaclasses and decorators are
>>members of,this shouldn't be considered a hack.If it becomes a hack the
>>problem is to be searched and solved above generalizing the scope system.
> Hand waving is all well and good, but this isn't a matter of
> "generalizing the scope system". This is a _radical_ change to the
> scoping rules of Python, and I think it's safe to say that there's
> *absolutely* *no* *way* something like this would be considered,
> without an excellent reason - and bolting some sort of strange
> decorator semantics doesn't cut it.
We can use decorators issue to see how python successors will kill it
in the long term or how the python will be
after changing skin.
In my enfant views knowledge is fractal and a the three scoping rules is
hiding patterns which will be seen with the right lens.
Possibly we can learn form other languages approches to the same
problems but no way I matter to be considered from the higher spheres,I
am a farmer taking some notes on how the plant is growing.
More information about the Python-list