[issue21406] Some socket constants are not enums

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21406] Some socket constants are not enums

2014-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, I missed the fact that the "family" and "type" properties are re-computed on the fly; I thought the enum values where stored on the socket object. Then it makes it harder to do the same for "proto", since there are family-specific namespaces with colliding

[issue21406] Some socket constants are not enums

2014-05-01 Thread Charles-François Natali
Charles-François Natali added the comment: To put it slightly differently: AF_XXX constant actually whome belong to the same namespace, the socket address family namespace. So we put them all in AddressFamily Enum. Now, for many constants defined in system header files, it's not so clear, e.g. B

[issue21406] Some socket constants are not enums

2014-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It makes sense for address families, especially since they're used so > much, but when it comes to e.g. SO_REUSEADDR or BTPROTO_RFCOMM, Hmm, I was thinking mostly about protocol numbers. All the BTPROTO_* constants should be part of a given enum (BlueToothPro

[issue21406] Some socket constants are not enums

2014-05-01 Thread Charles-François Natali
Charles-François Natali added the comment: > But no, nothing in the python Enum implementation restricts it to a value > *range*. It is really a collection of named constants. I didn't say in the implementation, I said in spirit. Would you describe all possible Unix PIDs are a Enum? Also, the

[issue21406] Some socket constants are not enums

2014-05-01 Thread R. David Murray
R. David Murray added the comment: This is why we should have had named constants and not Enums :) But no, nothing in the python Enum implementation restricts it to a value *range*. It is really a collection of named constants. -- nosy: +r.david.murray ___

[issue21406] Some socket constants are not enums

2014-05-01 Thread Charles-François Natali
Charles-François Natali added the comment: Enum are for, well, enumerated values, so for values within a finite and known range (like days, cards, etc). OTOH, I'm not sure all socket constants could be categorized like this. It makes sense for address families, especially since they're used so mu

[issue21406] Some socket constants are not enums

2014-05-01 Thread Antoine Pitrou
New submission from Antoine Pitrou: Many constants in the socket module, are not int enums. Examples are socket.CAN_BCM, socket.BTPROTO_RFCOMM, etc. For example when creating a bluetooth socket, you may get the following repr(): >>> socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, >>> s