Timeline for Deduping files using hardlinks
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 25, 2019 at 20:58 | comment | added | Peilonrayz♦ | @martixy Post a new question. If you fully type your code mypy would find it. | |
Jun 25, 2019 at 19:26 | comment | added | martixy |
Point to any other example. You failed to elaborate and keep getting hung up on that single line. And how would mypy help with that bug? I did try it. It detected nothing. As much as I appreciate bringing mypy to my attention, I choose to use vanilla python here. Someone pointed out that I shouldn't be editing the code, so the question remains as is. I did however rewrite get_dir_contents as you suggested, and fixed a couple of bugs, append included. Still looking for performance tips. The largest bottleneck is remains in the file read and hashing phase.
|
|
Jun 25, 2019 at 10:51 | comment | added | Peilonrayz♦ |
@martixy Go over your comments and strings and remove any others that are just rude - like the example I gave. If you'd be embarrassed to say it to your mom, it's probably not a good idea to put it in your program. mypy would have found the .append() bug, this says to me that it's not useless. Yes it has a bit of a learning curve, but given that C, C# and Java all use static typing and beginners learn those I don't think mypy it not beginner friendly, you can even tell it to not type things if it's out of your depth.
|
|
Jun 25, 2019 at 5:45 | comment | added | martixy |
Thanks for pointing out os.walk . I remember I made get_dir_contents for a different script, just copied here, hence the unused root . build_tables -> valid bug, should be .append() . file_thing is named as such, because there are already enough identifiers named file , and I didn't want to overload the word any further. Renamed to file_meta , hopefully that makes it clearer. Finally, I have no idea what you mean by useless prints. I want some kind of feedback while the program is running. What else do you suggest?
|
|
Jun 25, 2019 at 5:45 | comment | added | martixy |
mypy is an interesting idea, but I don't think I have a use for it in this instance. It's a hassle to setup and it isn't worth it for these types of projects, where you're just prototying things. It's also additional syntax baggage who someone new at python doesn't need right now. Someone actually removed the beginner tag from the question, and I'm not sure why TBH. I really am a beginner on python. Onto code comments...
|
|
Jun 25, 2019 at 5:44 | comment | added | martixy |
First, thanks for taking the time. But you have me thoroughly confused. <"I'm better than you" demeanor>? You will have to elaborate because I have no idea what you are referring to. Can't remove it if I don't know what to remove. If you're referring to that version comment - that is a comment to myself and no one else. I've removed it now. pathlib is quite the neat library, and thanks for that. I think for the couple of lines of elementary path manipulation, os.path is enough for now. Cont'd...
|
|
Jun 21, 2019 at 15:05 | history | answered | Peilonrayz♦ | CC BY-SA 4.0 |