terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.84k stars 249 forks source link

Object's printable representation (__repr__) #275

Open FrancescElies opened 4 years ago

FrancescElies commented 4 years ago

When debugging and printing objects of the type FileInformation and FunctionInfo you get <lizard.FileInformation object at 0x000002340BA81828> and <lizard.FunctionInfo object at 0x000001F846AB34E0> respectively.

To solve this we could:

Would you be interested in this?

terryyin commented 4 years ago

Could please send a pull request?

On 22 Oct 2019, at 3:24 PM, Francesc Elies notifications@github.com wrote:

When debugging and printing objects of the type FileInformation and FunctionInfo you get <lizard.FileInformation object at 0x000002340BA81828> and <lizard.FunctionInfo object at 0x000001F846AB34E0> respectively.

To solve this we could:

Implement repr methods Use dataclasses https://docs.python.org/3/library/dataclasses.html but this would require to drop support for older python versions than 3.7. If support for older python versions is required we could use attrs https://github.com/python-attrs/attrs Would you be interested in this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/275?email_source=notifications&email_token=AAGASYUQY5B7KL5VYBCSEALQP2TELA5CNFSM4JDLUCN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HTNHYKQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGASYTQOHJESDSO5WK2FS3QP2TELANCNFSM4JDLUCNQ.

FrancescElies commented 4 years ago

Before doing so, I would like to agree on the approach first.

  1. implement __repr__ on our own
  2. use dataclasses and dropping support for older python versions
  3. use attrs

Would you have any preferences?

terryyin commented 4 years ago

I think 1 or 3. I would choose 3 if it’s compatible with the current code.

On 23 Oct 2019, at 4:17 PM, Francesc Elies notifications@github.com wrote:

Before doing so, I would like to agree on the approach first.

implement repr on our own use dataclasses and dropping support for older python versions use attrs Would you have any preferences?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/275?email_source=notifications&email_token=AAGASYWOJBHGW7YQHV2FGG3QQACA5A5CNFSM4JDLUCN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECAQMJY#issuecomment-545326631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGASYWEFSRTYB4BQ4FEIMTQQACA5ANCNFSM4JDLUCNQ.