Skip to content

Cologler/attributes-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

attributes

GitHub Build Status PyPI

a python version attribute like attribute of csharp.

Usage

from attributes import Attribute

class Data(Attribute): # make your own attribute
    def __init__(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs

@Data(1, 2) # use your attribute
class SomeClass:
    pass

data, = Attribute.get_attrs(SomeClass) # than load on runtime and use it.

Parameter Attribute

@param_attr('a', Data(1, 2), Data(3, 4))
def func(a):
    pass

data, = Attribute.get_attrs(param_of(func, 'a'))
# or
data, = Data.get_from_param(func, 'a')

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages