srounet / Pymem

A python library for windows, providing the needed functions to start working on your own with memory editing.
MIT License
303 stars 45 forks source link

Suggestion: Change return types to list[int] of pattern_scan_all() #132

Open Harding-Stardust opened 3 months ago

Harding-Stardust commented 3 months ago

Right now, it's an int or list[int] or None https://github.com/srounet/Pymem/blob/8cf1323f89ce0e8d963d6ada358c435cf9a3bc3b/pymem/pattern.py#L153

I suggest to always return a list[int], if no hits then it's an empty list otherwise it's filled with the results. Makes the code much cleaner to work with.

StarrFox commented 3 months ago

this is something we could look at for 2.0 since people could be relying on current behavior