[FRPythoneers] Some newbie observations

Rahul Kumar rahulk at bhartitelesoft.com
Wed Sep 24 03:33:53 MDT 2003

Dear all
I have some small points. perhaps a pointer or two cd help me.

1. if my program has "import string" first, later i replace that line
with "from string import split, join", then i need to remove the
"string." from my entire program, otherwise it gives an error.

Am i doing  something wrong or missing something? 

2. I am studying some source of other projects to improve my knowledge.
I have a problem figuring out argument types to methods and return
types. I understand this is how it is in a language that is not strongly
typed, but do you face this problem too ? How to you get around it ?

3. I wrote a file with many "def"s (functions). Then i wanted to convert
it into a class. In Python, that seems to require a lot more effort than
in other OOP languages. One reason was all the "self"'s that had to be
added. (I know that i cd have used "s.", but still they have to be added
all over the place, and you keep getting errors till its done. Any easy
way or script for that ?

The others are (i guess) just learning pains:

a) Built-in functions are great but can confuse the newbie in the sense
that you look for a length or cmp method in string. Now i have to
remember to keep looking through the builtin list.
For some objects, we say "del a[i]", for some its "a.del(i)". Shoudlnt
that latter be provided also ?

b) Another one that keeps getting me is having to say
string.split(mystring, ...) rather than mystring.split(..). i believe
both styles are correct but for different classes.

c) Am i right in saying that variables declared in an if block, are not
part of that scope ? 


More information about the FRPythoneers mailing list