Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Python Style Question

1 view
Skip to first unread message

Steve Holden

unread,
Jan 22, 2009, 11:11:35 AM1/22/09
to pytho...@python.org
K-Dawg wrote:
> I am trying to become more pythonic as I learn python and get my mind
> around it instead of other languages I have used.
>
> I have an app that has a series of classes for objects it uses. From a
> style perspective, which should be done:
>
> Different py file for each class
>
> or
>
> One py file with all the classes
>
> The classes are small with a constructor and a few methods, no more than
> a couple, some with just one other method.
>
> Which is more "pythonic"?
>
One .py file with all the classes. But it's also very pythonic that you
have the choice, and can select the option that suits you best ;-)

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Terry Reedy

unread,
Jan 22, 2009, 11:47:19 AM1/22/09
to pytho...@python.org
Steve Holden wrote:
> K-Dawg wrote:
>> I am trying to become more pythonic as I learn python and get my mind
>> around it instead of other languages I have used.
>>
>> I have an app that has a series of classes for objects it uses. From a
>> style perspective, which should be done:
>>
>> Different py file for each class

Python is not Java!

>>
>> or
>>
>> One py file with all the classes
>>
>> The classes are small with a constructor and a few methods, no more than
>> a couple, some with just one other method.

Or if that gets to be too much, a few files each with several related
classes.

>> Which is more "pythonic"?
>>
> One .py file with all the classes. But it's also very pythonic that you
> have the choice, and can select the option that suits you best ;-)

Nice put Steve.

tjr

0 new messages