Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
If you want to use thereprlib.Repr class, currently, you need to instantiate an object and then set the desired attributes, afterwards, before you can actually use it:
fromreprlibimportReprmyrepr=Repr()myrepr.maxlevel=10myrepr.maxlist=3myrepr.maxdict=1myrepr.repr(myobject)
It might be more comfortable and clearer sometimes, to be able to set the attributes during the initialization:
fromreprlibimportReprmyrepr=Repr(maxlevel=10,maxlist=3,maxdict=1)myrepr.repr(myobject)
Furthermore, this would make it possible to usereprlib.Repr without having to designate a permanent name:
fromreprlibimportReprRepr(maxlevel=10,maxlist=3,maxdict=1).repr(myobject)