what does shutil (in Python) mean? [closed]
Asked Answered
I

1

24

I knew what this module is for, I just don't know why they choose this name - shutil. It is hard to remember this kind of "random" name if I don't know where it come from. Please give me some hints, thanks.

Interstate answered 10/3, 2011 at 18:4 Comment(0)
L
42

It means "shell utilities", sh standing for shell, util standing for utilities.

If you think about what shutil does, that makes sense (manipulate the filesystem, make archives, etc.).

Leighannleighland answered 10/3, 2011 at 18:6 Comment(4)
Maybe the module could have been named sh_utils to make it more clear. @Rafe Good and clear explanationPolaris
@KornP that wouldn't fit with typical naming conventions for modules.Leighannleighland
Well, yes and no. This is what I read in PEP8 regarding module names: "Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability." But it is not that important.Polaris
@KornP not so much based on PEP8 but based on the way that modules in the standard library are named. But yes, you are correct.Leighannleighland

© 2022 - 2024 — McMap. All rights reserved.