Neil Schemenauer added the comment:

Thank you for the excellent review Martin.  I'm attaching a new patch which I 
think addresses your points.  I created it from hg, maybe that works nicer.

I've added constants for SO_DOMAIN, SO_PROTOCOL, SO_PASSCRED, SO_PEERSEC, and 
SO_PASSEC.

Using SO_PROTOCOL to get the protocol value seems to work fine on Linux.

I've dropped the union as you suggest.  I think the docs have been fixed.

I would be okay with making fdtype() a non-public function.  It seems possibly 
useful though.

Regarding the name, currently I think fromfd2 is best.  It really does what 
fromfd() should have done if SO_TYPE/SO_PROTOCOL was available and portable.  

Extending fromfd() seems a bad idea.  I don't want dup() and it seems better 
that application code can use hasattr() to test for new functionality.  You can 
work around not having fromfd2() by using getsockname() and then using some 
ugly text matching to work out what kind of socket you have.

----------
Added file: http://bugs.python.org/file43530/fromfd2_v2.txt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to