[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Ram Rachum

Ram Rachum cool...@cool-rr.com added the comment:

But why? What's the reason for that? Why mislabel a type as a function?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

staticmethod being a type or int being a function is really a CPython 
implementation detail.  If the docs say something is a class, it behaves as a 
class, you can subclass it and everything, and the other VMs implement it as a 
class, why would you want to consider the detail that it’s really a C function?

--
nosy: +eric.araujo
stage:  - committed/rejected
versions:  -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Ram Rachum

Ram Rachum cool...@cool-rr.com added the comment:

I'm really confused by your comment.

int being a function is really a CPython implementation detail

I don't understand this. I should be able to do isinstance(x, int) in all 
implementations of Python, no? So `int` must be a class across all Python 
implementation, no?

why would you want to consider the detail that it’s really a C function?

I don't want to consider the detail that int is a C function, I thought that 
int is a class and expected it to be marked :class:`int` in the documentation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Okay, scratch the comment about int, it’s not been accurate for quite a number 
of years.  Going back to staticmethod, my point still applies: Follow what the 
docs say.

staticmethod is a type in CPython probably due to the way descriptors work; 
contextlib.closing is a class for simplicity and efficiency; both of these 
examples are irrelevant internal details, they’re marked up as functions, so 
you should treat them as functions.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Ram Rachum

Ram Rachum cool...@cool-rr.com added the comment:

So if int is officially a class, why not start doing :class:`int` instead of 
:func:`int`?

they’re marked up as functions, so you should treat them as functions.

Here, I've treated staticmethod as a function:

 assert isinstance(staticmethod, types.FunctionType)
Traceback (most recent call last):
  File pyshell#1, line 1, in module
assert isinstance(staticmethod, types.FunctionType)
AssertionError

I get an error.

So I understand that you are using Sphinx's :func: role in a liberal way; You 
consider it okay to use it to mark anything that is callable, regardless of 
whether it's a function or a class. Am I right?

This looks to me like an abuse of Sphinx notation. When I read documentation I 
don't want to be second-guessing the author's intentions. If someone writes 
:func:`whatever` I expect `whatever` to be a function and not a class.

Perhaps we need a :callable: role?

--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I don’t have enough experience to make a judgment call here.  Raymond or Georg, 
can you?

--
nosy: +georg.brandl
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

That's just the way we do our markup.
Sorry, but this is a total non-issue.
You're trying to create finer distinctions
than the markup needs to support.

Besides, the distinction between types,
objects, callables, functions, instances,
descriptors and whatnot are much less
black and white than you might imagine.

--
nosy: +rhettinger
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-13 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Fully agreed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-12 Thread Ram Rachum

New submission from Ram Rachum cool...@cool-rr.com:

The Python documentation uses :func:`staticmethod` to describe staticmethod, 
while staticmethod is a type.

I want to link to the Python documentation from my project's documentation 
using Intersphinx, and I wouldn't want to mislead my users by marking static 
method as a function.

--
assignee: d...@python
components: Documentation
messages: 126090
nosy: cool-RR, d...@python
priority: normal
severity: normal
status: open
title: The docs mark staticmethod as a function
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-12 Thread SilentGhost

SilentGhost ghost@gmail.com added the comment:

So, is int, str, bool and enumerate. And many others. The preface on functions 
page (http://docs.python.org/dev/library/functions.html) says: 

The Python interpreter has a number of functions and types built into it that 
are always available.

I would think it's clear enough.

--
nosy: +SilentGhost

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10893] The docs mark staticmethod as a function

2011-01-12 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10893
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com