Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=4615050
By: pm13

I try to understand how @DynamicAttrs works. I create new pydev project and
three files in src folder - __init__.py, my_class.py and my_code.py.

File my_class.py:

class MyMetaclass(type):
    def __new__(cls, name, bases, attrs):
        attrs['something'] = 'text from attribute something'
        return type.__new__(cls, name, bases, attrs)

class MyClass(object):
    __metaclass__ = MyMetaclass
    test = 'text from attribute test'

print 'my_class.py, class:'
print MyClass.test
print MyClass.something

print 'my_class.py, object:'
my_object = MyClass()
print my_object.test
print my_object.something

File my_code.py:

from my_class import MyClass

print 'my_code.py, class:'
print MyClass.test
print MyClass.something # something is marked

print 'my_code.py, object:'
my_object = MyClass()
print my_object.test
print my_object.something

Only one word is marked - "something" in line "print MyClass.something" from
my_code.py.

I change definition of MyClass, but there is no change in error marking:

class MyClass(object):
    '''
    @DynamicAttrs
    '''
    __metaclass__ = MyMetaclass
    test = 'text from attribute test'
    
Is there any problem with my configuration or my code? Or how should 
@DynamicAttrs
work?

I use Pydev and Pydev Extensions 1.3.10.

Thank you for Pydev and now for support of symlinks!

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Pydev-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to