Re: [PATCH v2] kernel-doc: rename the kernel-doc directive 'functions' to 'identifiers'

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

 



Am 29.10.19 um 01:31 schrieb Changbin Du:
But is it, really? I agree with Jon about the distinction between None
and '' being confusing.

Here python is different from C. Both empty string and None are False in python.
Note such condition is common in python.

The one is a empty string str(''), its bool('') value is False.

| >>> type(''), bool('')
| (<class 'str'>, False)

The other is a NoneType, its bool(None) value is False.

| >>> type(None), bool(None)
| (<class 'NoneType'>, False)

None often used like NULL (pointer). E.g if a function does not give an explicit return value, the returned value is None.

| >>> def foo():
| ...     pass
| ...
| >>> print(foo())
| None


-- Markus --




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux