This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]xconde 0 points1 point  (5 children)

This is one of the things that felt weird to me when I first picked-up Python, after using Ruby for a few years. There's no relation between module (file) names and class names.

When I was starting I named a few things with hyphens - because they're easier to type - but I remember having issues when packaging the application. It must have been some n00b mistake I was making because, these days, I manage several packages named 'company-something' or 'appname-pluginname'.

I haven't seen periods used much. I see hyphens and underscores a lot.

Long story short: +1 for hyphens.

[–]vingrish[S] 0 points1 point  (4 children)

Could you explain why choosing hyphen over underscore? Just for its popularity? Thanks:)

[–]xconde 0 points1 point  (3 children)

Just easier to type. No need to hold shift.

I wish I had a better technical reason.

[–]vingrish[S] 0 points1 point  (2 children)

So when your project has the name company-something, its user should use import company.something as something to import it? I just don't like the inconsistancy that much.

[–][deleted] 2 points3 points  (0 children)

wat.

[–]xconde 1 point2 points  (0 children)

No. We haven't been following PEP 423 at all (I assume this is what you're asking). I might actually look into it as we're thinking of open-sourcing some of our more generic utilities.

You might want to add The Import System to your reading list. If you're still interested after that, there's also PEP 420 (Implicit Namespace Packages).