Re: About one class/function per module

2009-11-12 Thread Hans-Peter Jansen
On Tuesday 03 November 2009, 12:52:20 Diez B. Roggisch wrote: > Peng Yu wrote: > > On Mon, Nov 2, 2009 at 9:39 PM, alex23 wrote: > >> Peng Yu wrote: > >>> I don't think that this is a problem that can not be overcome. A > >>> simple solution might be to associate a unique identifier to each > >>>

Re: About one class/function per module

2009-11-04 Thread Jean-Michel Pichavant
Peng Yu wrote: With some automated script, I don't think it is a nightmare to change function names. I can change function names and filenames and their reference with a simple command. I'd think that this is the limitation of current version control system. I don't aware of any version control

Re: About one class/function per module

2009-11-04 Thread Bruno Desthuilliers
Peng Yu a écrit : On Mon, Nov 2, 2009 at 3:03 AM, Bruno Desthuilliers wrote: Peng Yu a écrit : (snip) I prefer organized my code one class/function per file (i.e per module in python). I know the majority of programmers don't use this approach. Therefore, I'm wondering what its disadvantage is

Re: About one class/function per module

2009-11-04 Thread Bruno Desthuilliers
Ben Finney a écrit : "Diez B. Roggisch" writes: Don't get me wrong - innovation often comes from scratching ones personal itch. But you seem to be suffering from a rather bad case of neurodermatitis. +1 QOTW Make it +2 QOTW !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: About one class/function per module

2009-11-03 Thread Ben Finney
"Diez B. Roggisch" writes: > Don't get me wrong - innovation often comes from scratching ones > personal itch. But you seem to be suffering from a rather bad case of > neurodermatitis. +1 QOTW -- \ “For my birthday I got a humidifier and a de-humidifier. I put | `\ them in the same ro

Re: About one class/function per module

2009-11-03 Thread Diez B. Roggisch
Peng Yu wrote: > On Mon, Nov 2, 2009 at 9:39 PM, alex23 wrote: >> Peng Yu wrote: >>> I don't think that this is a problem that can not be overcome. A >>> simple solution might be to associate a unique identifier to each >>> file, so that even the filename has been changed, the new version and >>

Re: About one class/function per module

2009-11-03 Thread Ben Finney
Jean-Michel Pichavant writes: > Diez B. Roggisch wrote: > > Start learning a decent editor (emacs is mine) which allows you to > > deal with all of your perceived "problems" > > This is a declaration of war against the vi community. We won't give > up, prepare for vengeance ! Bah. Saying that Em

Re: About one class/function per module

2009-11-02 Thread Steven D'Aprano
On Mon, 02 Nov 2009 07:24:59 -0600, Peng Yu wrote: > Suppose I have class A and class B in a file, I can not easily figure > out which class depends on which class by a simple script. How about looking at the classes? >>> class A: ... pass ... >>> class B(A): ... pass ... >>> >>> B.__ba

Re: About one class/function per module

2009-11-02 Thread Gabriel Genellina
En Tue, 03 Nov 2009 00:50:56 -0300, Peng Yu escribió: On Mon, Nov 2, 2009 at 9:39 PM, alex23 wrote: Peng Yu wrote: A simple solution might be to associate a unique identifier to each file, so that even the filename has been changed, the new version and the old version can still be identifi

Re: About one class/function per module

2009-11-02 Thread Peng Yu
On Mon, Nov 2, 2009 at 9:39 PM, alex23 wrote: > Peng Yu wrote: >> I don't think that this is a problem that can not be overcome. A >> simple solution might be to associate a unique identifier to each >> file, so that even the filename has been changed, the new version and >> the old version can s

Re: About one class/function per module

2009-11-02 Thread alex23
Peng Yu wrote: > I don't think that this is a problem that can not be overcome. A > simple solution might be to associate a unique identifier to each > file, so that even the filename has been changed, the new version and > the old version can still be identified as actually the same file. Or, ag

Re: About one class/function per module

2009-11-02 Thread Peng Yu
On Mon, Nov 2, 2009 at 7:41 PM, Lee wrote: > On Nov 2, 7:06 pm, Peng Yu wrote: >> On Mon, Nov 2, 2009 at 9:02 AM, Jean-Michel Pichavant >> >> >> >> >> >> wrote: >> > Diez B. Roggisch wrote: >> >> >> Peng Yu wrote: >> >> >>>  I can navigate to the definition of >> >>> class and function by vim +

Re: About one class/function per module

2009-11-02 Thread Peng Yu
On Mon, Nov 2, 2009 at 9:02 AM, Jean-Michel Pichavant wrote: > Diez B. Roggisch wrote: >> >> Peng Yu wrote: >> >>> >>>  I can navigate to the definition of >>> class and function by vim + ctags, >>> >> >> Start learning a decent editor (emacs is mine) which allows you to deal >> with all of your p

Re: About one class/function per module

2009-11-02 Thread Rhodri James
On Mon, 02 Nov 2009 13:24:59 -, Peng Yu wrote: Another advantage one of class/function per file is that the syntax clearly tell the dependence relation between classes and functions. Um, no. Grepping for "import" now tells you that there is a dependency between the file contents, but it

Re: About one class/function per module

2009-11-02 Thread Jean-Michel Pichavant
Diez B. Roggisch wrote: Peng Yu wrote: I can navigate to the definition of class and function by vim + ctags, Start learning a decent editor (emacs is mine) which allows you to deal with all of your perceived "problems" Diez This is a declaration of war against the vi communit

Re: About one class/function per module

2009-11-02 Thread Diez B. Roggisch
Peng Yu wrote: > On Mon, Nov 2, 2009 at 3:03 AM, Bruno Desthuilliers > wrote: >> Peng Yu a écrit : >> (snip) >>> >>> I prefer organized my code one class/function per file (i.e per module >>> in python). I know the majority of programmers don't use this >>> approach. Therefore, I'm wondering what

Re: About one class/function per module

2009-11-02 Thread Peng Yu
On Mon, Nov 2, 2009 at 7:11 AM, Peng Yu wrote: > On Mon, Nov 2, 2009 at 3:03 AM, Bruno Desthuilliers > wrote: >> Peng Yu a écrit : >> (snip) >>> >>> I prefer organized my code one class/function per file (i.e per module >>> in python). I know the majority of programmers don't use this >>> approac

Re: About one class/function per module

2009-11-02 Thread Peng Yu
On Mon, Nov 2, 2009 at 3:03 AM, Bruno Desthuilliers wrote: > Peng Yu a écrit : > (snip) >> >> I prefer organized my code one class/function per file (i.e per module >> in python). I know the majority of programmers don't use this >> approach. Therefore, I'm wondering what its disadvantage is. > >

Re: About one class/function per module

2009-11-02 Thread Ben Finney
Bruno Desthuilliers writes: > Gabriel Genellina a écrit : > > You may put one class per file, nobody forbids that > > But anyone having to work on your code will hate you. And if you can find anyone to collaborate with who can stand your insistence on putting one *function* per file, you should

Re: About one class/function per module

2009-11-02 Thread Bruno Desthuilliers
Peng Yu a écrit : (snip) I prefer organized my code one class/function per file (i.e per module in python). I know the majority of programmers don't use this approach. Therefore, I'm wondering what its disadvantage is. Hmmm... As far as I'm concerned, you already answered your own question: "t

Re: About one class/function per module

2009-11-02 Thread Bruno Desthuilliers
Gabriel Genellina a écrit : On Nov 2, 8:11 am, Peng Yu wrote: I prefer organized my code one class/function per file (i.e per module in python). I know the majority of programmers don't use this approach. Therefore, I'm wondering what its disadvantage is. (snip) You may put one class per

Re: About one class/function per module

2009-11-01 Thread Gabriel Genellina
En Sun, 01 Nov 2009 22:27:32 -0300, Peng Yu escribió: On Sun, Nov 1, 2009 at 7:02 PM, alex23 wrote: On Nov 2, 8:11 am, Peng Yu wrote: I prefer organized my code one class/function per file (i.e per module in python). I know the majority of programmers don't use this approach. Therefore, I'

Re: About one class/function per module

2009-11-01 Thread Steven D'Aprano
On Sun, 01 Nov 2009 18:33:57 -0800, alex23 wrote: > Peng Yu wrote: >> So I am asking disadvantages besides python import mechanism is not >> friendly to it. > > Which part of "name collisions have to be resolved somehow" isn't > explicit enough for you? > > You can't keep saying "this works in

Re: About one class/function per module

2009-11-01 Thread rustom
On Nov 2, 3:11 am, Peng Yu wrote: > I recently asked how to support one class/function per module under > the title 'How to import only one module in a package when the package > __init__.py has already imports the modules?' I summarize my key > points below. In particular, I have to two questions

Re: About one class/function per module

2009-11-01 Thread Dave Angel
Peng Yu wrote: Some people mentioned an good IDE can do 1 and 4. But I'm not aware of an IDE that can allow me to change file name freely. I tried Visual Studio long time ago, I have to delete a file, change the file name and add the file back in order to change the file. I use Komodo IDE v

Re: About one class/function per module

2009-11-01 Thread alex23
Peng Yu wrote: > So I am asking disadvantages besides python import mechanism is not > friendly to it. Which part of "name collisions have to be resolved somehow" isn't explicit enough for you? You can't keep saying "this works in C++" while refusing to accept that this is an implementation deci

Re: About one class/function per module

2009-11-01 Thread metal
On 11月2日, 上午9时27分, Peng Yu wrote: > On Sun, Nov 1, 2009 at 7:02 PM, alex23 wrote: > > On Nov 2, 8:11 am, Peng Yu wrote: > >> I prefer organized my code one class/function per file (i.e per module > >> in python). I know the majority of programmers don't use this > >> approach. Therefore, I'm won

Re: About one class/function per module

2009-11-01 Thread Peng Yu
On Sun, Nov 1, 2009 at 7:02 PM, alex23 wrote: > On Nov 2, 8:11 am, Peng Yu wrote: >> I prefer organized my code one class/function per file (i.e per module >> in python). I know the majority of programmers don't use this >> approach. Therefore, I'm wondering what its disadvantage is. > > You mean

Re: About one class/function per module

2009-11-01 Thread alex23
On Nov 2, 8:11 am, Peng Yu wrote: > I prefer organized my code one class/function per file (i.e per module > in python). I know the majority of programmers don't use this > approach. Therefore, I'm wondering what its disadvantage is. You mean, what disadvantages it has _other_ than the ones you'v

Re: About one class/function per module

2009-11-01 Thread Robert Kern
Peng Yu wrote: So far, I haven't find one. It seems impossible in python, but I want to double check if there is one solution. We have already told you more than twice that the answer is "No." Please don't triple check. -- Robert Kern "I have come to believe that the whole world is an enig

Re: About one class/function per module

2009-11-01 Thread Diez B. Roggisch
Peng Yu schrieb: I recently asked how to support one class/function per module under the title 'How to import only one module in a package when the package __init__.py has already imports the modules?' I summarize my key points below. In particular, I have to two questions: 1. What disadvantages

About one class/function per module

2009-11-01 Thread Peng Yu
I recently asked how to support one class/function per module under the title 'How to import only one module in a package when the package __init__.py has already imports the modules?' I summarize my key points below. In particular, I have to two questions: 1. What disadvantages there are to enforc