Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.
/ gen-repr Public archive

Lightweigt python (2 & 3) library to generate the __repr__ method of a class.

License

Notifications You must be signed in to change notification settings

0xA537FD/gen-repr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gen-repr Build Status

Lightweight python library without any dependencies to automatically generate the __repr__ method for any class.

Getting started

Install this package throught pip

$ pip install gen-repr

After that you can import it in your program like this

from genrepr import gen_repr

Example

from genrepr import gen_repr

@gen_repr()
class Person(object):
    def __init__(self):
        self.first_name = u""
        self.age = 0
        self._hair = u"any color you like"
        self._location = u"localhost"
        
    @property
    def location(self):
        return self._location

peter = Person()
peter.first_name = u"Peter"
peter.age = -1

repr(peter) # result: "<Person (first_name='Peter', age=-1, location='localhost')>:

About

Lightweigt python (2 & 3) library to generate the __repr__ method of a class.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages