[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-10-15 Thread Berker Peksag

Berker Peksag added the comment:

+ self.assertTrue(socket.SocketType is _socket.socket)

You can use assertIs instead of assertTrue.

--
nosy: +berker.peksag
versions: +Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-10-15 Thread koobs

koobs added the comment:

This change looks to be implicated in a buildbot breakage on koobs-freebsd9 
(3.4).

I couldn't reproduce the test failure by re-running the build, so possibly 
intermittent or non-deterministic.

Full build log attached.

I'll leave the issue closed for now, please re-open if verified.

==
ERROR: test_pickling 
(test.test_multiprocessing_fork.WithProcessesTestPicklingConnections)
--
Traceback (most recent call last):
  File 
/usr/home/buildbot/python/3.4.koobs-freebsd9/build/Lib/test/_test_multiprocessing.py,
 line 2590, in test_pickling
self.assertEqual(new_conn.recv(), msg.upper())
  File 
/usr/home/buildbot/python/3.4.koobs-freebsd9/build/Lib/multiprocessing/connection.py,
 line 250, in recv
buf = self._recv_bytes()
  File 
/usr/home/buildbot/python/3.4.koobs-freebsd9/build/Lib/multiprocessing/connection.py,
 line 416, in _recv_bytes
buf = self._recv(4)
  File 
/usr/home/buildbot/python/3.4.koobs-freebsd9/build/Lib/multiprocessing/connection.py,
 line 389, in _recv
raise EOFError
EOFError

--
nosy: +koobs
Added file: http://bugs.python.org/file36937/koobs-freebsd9-py34-build-553.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-10-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 613c30ffd344 by Ethan Furman in branch '3.4':
Issue20386: SocketType is again socket.socket; the IntEnum SOCK constants are 
SocketKind
https://hg.python.org/cpython/rev/613c30ffd344

New changeset ef24851f340f by Ethan Furman in branch 'default':
Issue20386: SocketType is again socket.socket; the IntEnum SOCK constants are 
SocketKind
https://hg.python.org/cpython/rev/ef24851f340f

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-10-14 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-02-06 Thread Ethan Furman

Ethan Furman added the comment:

Thanks for the hints, Georg!

--
Added file: http://bugs.python.org/file33945/issue20386.stoneleaf.04.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-27 Thread Ethan Furman

Ethan Furman added the comment:

Well, so far I have tried:

  :class:`IntEnum`
  :class:`.IntEnum`
  :class:`~IntEnum`
  :class:`enum.IntEnum`
  :class:`.enum.IntEnum`
  :class:`~enum.IntEnum`
  :class:`~.enum.IntEnum`

and probably some others I have forgotten; nothing is giving me a link to 
enum.IntEnum.

Any ideas?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-27 Thread Georg Brandl

Georg Brandl added the comment:

Well, IntEnum is nowhere documented as a class.  IOW,

.. class:: IntEnum

is missing if you want these references to work.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-27 Thread Ethan Furman

Ethan Furman added the comment:

IntEnum is not a class in the socket module.

How do I make a link into another rst document?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-27 Thread Georg Brandl

Georg Brandl added the comment:

IntEnum is not a class in the enum module either, as far as the docs are 
concerned ;)

Otherwise :class:`enum.IntEnum` or :class:`.IntEnum` would work, no matter the 
source and target documents.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-26 Thread Ethan Furman

Ethan Furman added the comment:

Okay, staying with SocketKind.

This patch also has a very small doc enhancement.

--
keywords: +patch
Added file: http://bugs.python.org/file33735/issue20386.stoneleaf.03.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-26 Thread Georg Brandl

Georg Brandl added the comment:

integer enumerations of enumtype sounds weird to me.

Also, here it might be nice to link to IntEnum (use :class:`.IntEnum`).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

Here's a patch for the test.

--
Added file: http://bugs.python.org/file33706/issue20386.stoneleaf.test.patch.01

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

 Please find a better name for the type enum and document the new enums.

Why should new enums be documented and how are they useful?
IMO socket module adopted enum module only to provide a better representation 
of AF_* and SOCK_* constants on repr(), which is fine.
The fact that in order to do that enum module forces you to create a container 
is incidental and should not result in polluting socket module API (which is 
already pretty crowded).
In summary I'd be for renaming those enums to _SocketType and _AddressFamily.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Georg Brandl

Georg Brandl added the comment:

 Why should new enums be documented and how are they useful?

Because they are a new public class(-like object) in the module. When renaming 
them to a non-public name, as you suggest, that could be left out.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

But as a user when are you gonna need to use AddressFamily container?
Before enum we didn't have something like:

AddressFamily = (AF_INET, AF_INET6, ...)

Basically because we didn't need it. Sorry if I'm missing something here.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Georg Brandl

Georg Brandl added the comment:

I'm not saying the enums are necessary (argue about that with Eli), but that if 
they *are* in the module as a public attribute, they *have* to be documented, 
period.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

Complete patch with new test, fixed tests, and regression fix.

Doc patch still needed.

--
stage: test needed - patch review
Added file: http://bugs.python.org/file33707/issue20386.stoneleaf.patch.02

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

The containers are there to help with discoverability.  If you want to know 
what all the (common) AF values are you can either do

[name for name in dir(socket) if name.isupper() and name.startswith('AF_')]

or

list(socket.AddressFamily)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Eli Bendersky

Eli Bendersky added the comment:

Yep, the overriding of the type name was inadvertent. Nothing sacred about it, 
so Ethan's SocketKind is just as good.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Ethan Furman

Ethan Furman added the comment:

How do we feel about SockType instead?  (Just a short round of bike-shedding, 
promise! ;)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-25 Thread Nick Coghlan

Nick Coghlan added the comment:

I strongly prefer SocketKind - SockType is far too close to SocketType and
type is too closely associated with the type system in general.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20386] socket.SocketType enum overwrites import of _socket.SocketType

2014-01-24 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
title: Missing docs for SocketType and AddressFamily in socket module - 
socket.SocketType enum overwrites import of _socket.SocketType

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20386
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com