git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The slash "/" as used in the documentation


On 2/9/2019 2:10 PM, Piet van Oostrum wrote:
> Christian Gollwitzer <auriocus at gmx.de> writes:
> 
>>>>> __import__( 'sys' ).version
>> '3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) \n[GCC
>> 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]'
>>>>> help( __import__( 'math' ).sin )
>>
>>
>> Help on built-in function sin in module math:
>>
>> sin(...)
>>      sin(x)
>>
>>      Return the sine of x (measured in radians).
>>
>>
>> The help is actually not written out to the terminal but, displayed in
>> the pager (less), and the first sin(...) is typeset in boldface.
>>
>> 	Christian
> 
> Even simpler:
> 
>>>> help(len)
> help(len)
> Help on built-in function len in module builtins:
> 
> len(obj, /)
>      Return the number of items in a container.
> 
> both in python 3.6 and 3.7.
> 
> This is weird.

This is the result of Python being a project of mostly unpaid volunteers.

See my response in this thread explaining how '/' appears in help output 
and IDLE calltips.  '/' only appears for CPython C-coded functions that 
have been modified to use Argument Clinic.  A.C. was added, I believe, 
in 3.5.  Simple builtins like len would have been the first to be 
converted.  The math module was converted for 3.7.  There are some new 
conversions for 3.8 and likely some will be left for future versions.

-- 
Terry Jan Reedy