niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » python
function v. method
Post new topic   Reply to topic Page 2 of 2 [16 Posts] View previous topic :: View next topic
Goto page:  Previous  1, 2
Author Message
bruno modulix
*nix forums Guru


Joined: 21 Feb 2005
Posts: 819

PostPosted: Fri Jul 21, 2006 12:22 pm    Post subject: Re: function v. method Reply with quote

Antoon Pardon wrote:
Quote:
On 2006-07-21, fuzzylollipop <jarrod.roberson@gmail.com> wrote:

danielx wrote:

(snip)


if you prefix with a single underscore, that tells the user, DON'T MESS
WITH ME FROM OUTSIDE! I AM AN IMPLEMENTATION DETAIL!


Personnaly I don't like this convention.

To bad for you.

Quote:
It isn't clear enough.

Oh yes ?

Quote:
Suppose I am writing my own module, I use an underscore, to
mark variables which are an implementation detail for my
module.

Now I need to import an other module in my module and need access
to an implementation variable from that module.

So now I have
variables with an underscore which have two different meanings:

1) This is an implemantation detail of this module, It is the
users of my module who have to be extra carefull using it.

2) This is an implemantation detail of the other module,
I should be extra carefull using it.

Either you imported with the "from othermodule import *" form (which you
shouldn't do), and you *don't* have the implementation of othermodule,
or your used the "import othermodule" form, in which case it's pretty
obvious which names belongs to othermodule.

Have any other, possibly valid, reason ?

Quote:
And I find variable starting or ending with an underscore ugly. Smile

Too bad for you. Choose another language then... PHP, Perl, Ruby ?-)

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb@xiludom.gro'.split('@')])"
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 2 of 2 [16 Posts] Goto page:  Previous  1, 2
View previous topic :: View next topic
The time now is Sat Nov 22, 2008 9:08 pm | All times are GMT
navigation Forum index » Programming » python
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Best method to search kristy420 Oracle 0 Tue Nov 18, 2008 6:34 pm
No new posts Function Pointer Sikandar C 3 Fri Jul 21, 2006 1:23 pm
No new posts Arbitrary function with parameter darknails@gmail.com C++ 2 Fri Jul 21, 2006 9:58 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com apps 4 Fri Jul 21, 2006 3:22 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com C++ 1 Fri Jul 21, 2006 2:44 am

Synchronization fast and easy | Loans | Homes for Sale | Mortgage Calculator | Free Advertising
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3400s ][ Queries: 16 (0.2636s) ][ GZIP on - Debug on ]