facebook / ThreatExchange

Trust & Safety tools for working together to fight digital harms.
https://developers.facebook.com/docs/threat-exchange
Other
1.16k stars 307 forks source link

[py-tx] Use typing.Self in more places #1616

Open Dcallies opened 2 weeks ago

Dcallies commented 2 weeks ago

Ref: https://realpython.com/python-type-self/

Since py-tx is a bit aged at this point, we've straddled a few quality of life improvements with typing.

We can replace a lot of forward-declared self references to Self instead.

Here's a command you could use to look for opportunities:

python-threatexchange# grep -r -n " -> [\"']" --include='*.py' .

Here's one file that comes up in that list: https://github.com/facebook/ThreatExchange/blob/main/python-threatexchange/threatexchange/signal_type/signal_base.py#L22

manojks1999 commented 2 weeks ago

Hi @Dcallies , can I work on this?

Dcallies commented 2 weeks ago

It's all yours! Let me know if you don't think you won't be able to get to it in the next week!