classification
Title: Should socket.PF_PACKET be removed, in favor of socket.AF_PACKET?
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: denilsonsa, loewis, neologix
Priority: low Keywords:

Created on 2010-03-31 00:06 by denilsonsa, last changed 2011-11-21 18:57 by neologix. This issue is now closed.

Messages (2)
msg101966 - (view) Author: Denilson Figueiredo de Sá (denilsonsa) Date: 2010-03-31 00:06
If you look at socket module, there are around 29 AF_* constants (like AF_INET).

On the other hand, there is only one PF_ constant: PF_PACKET. This constant is also defined as AF_PACKET.

Following the "There should be one-- and preferably only one --obvious way to do it." advice, Python 3 removed the <> operator.  I know it's a bit late to change things in Python 3, but should socket.PF_PACKET be removed, in favor of socket.AF_PACKET? (of course, before being removed, it would be left as deprecated for quite some time)
msg148069 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-11-21 18:57
There are now more protocol families defined (PF_RDS, PF_CAN), etc.
Since both AF_ and PF_ are valid (see http://en.wikipedia.org/wiki/Berkeley_sockets#Protocol_and_address_families for more information), and there is so much code out there in the wild using either form, let's just keep it that way.
History
Date User Action Args
2011-11-21 18:57:30neologixsetstatus: open -> closed

nosy: + neologix
messages: + msg148069

resolution: rejected
stage: resolved
2010-03-31 00:07:59pitrousetversions: + Python 3.2
nosy: + loewis

priority: low
components: + Library (Lib)
type: behavior
2010-03-31 00:06:36denilsonsacreate