New submission from Ian <ifreeca...@gmail.com>:

Concerning this section of the docs:
http://docs.python.org/library/functions.html#staticmethod

There is no example for calling a static method from another static method 
within the same class.

As I discovered later, it's simple: C.f() -- from inside the class or outside 
it.

A total newbie will accept this and move on... but in other programming 
languages, it's frowned upon to the class name from within the class.  For 
example, in PHP you use the "self::" prefix and Java you don't need a prefix at 
all.  

So, even though I had it right the first time, it didn't SEEM right... so I 
went on a wild goose chase, for nothing.  Googling "java call static method" 
will get you java documentation that lists both cases, as does "c++ call static 
method" and "php call static method".  

I feel that by adding "Note: you must also use the C.f() syntax when calling 
from within the class", the documentation will be more complete.

----------
assignee: d...@python
components: Documentation
messages: 121314
nosy: d...@python, ifreecarve
priority: normal
severity: normal
status: open
title: list an example for calling static methods from WITHIN classes
type: feature request

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10438>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to