lizard icon indicating copy to clipboard operation
lizard copied to clipboard

Object's printable representation (__repr__)

Open FrancescElies opened this issue 6 years ago • 3 comments

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 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

Would you be interested in this?

FrancescElies avatar Oct 22 '19 07:10 FrancescElies

Could please send a pull request?

On 22 Oct 2019, at 3:24 PM, Francesc Elies [email protected] 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.

terryyin avatar Oct 23 '19 08:10 terryyin

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?

FrancescElies avatar Oct 23 '19 08:10 FrancescElies

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 [email protected] 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.

terryyin avatar Oct 23 '19 08:10 terryyin