Re: parsing error in codebrowser komodo 4.4.1 due to decorators in python
Eric Promislow <[email protected]> Thu, 28 Jan 2010 13:56:58 -0800
| Newsgroups | gmane.comp.ide.komodo.general |
|---|---|
| Message-ID | <[email protected]> |
I'm pretty sure we added more handling for Python decorators
going in to Komodo 5. Maybe the code browser in v. 4 didn't
recognize them.
- Eric
On 1/28/2010 1:54 PM, Peter wrote:
> On 01/28/2010 09:02 PM, Todd Whiteman wrote:
>> On 10-01-28 11:17 AM, Peter wrote:
>>> I noticed that the codebrowser does not work ( shows a cross and a
>>> parsing error ) and the offending line is always the line after a python
>>> decorator. Syntax highlighting in the source works as expected .
>>> Is this a known bug ?
>>
>> Hi Peter,
>>
>> Could you provide a simple example of the decorator that breaks
>> Komodo's parsing?
>>
>> Thanks,
>> Todd
>
> Hi Todd
> Thanks, here is an example, outcommenting @enable_log restores parsing
> in the codebrowser.
>
> #!/usr/bin/env python
>
> def enable_log(aclass):
> """ a class decorator stolen from `Python decorate a class to change
> parent object type
> <http://stackoverflow.com/questions/1412210/python-decorate-a-class-to-change-parent-object-type>`_
> """
> classdict = {
> 'classname' : 'a',
> }
> log_enabled_class = type (aclass.__name__, (aclass,), classdict)
> return log_enabled_class
>
> @enable_log
> class A(object): pass
> _______________________________________________
> Komodo-discuss mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
_______________________________________________
Komodo-discuss mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss