Skip to content

Commit 9f5a095

Browse files
committed
Use __all__ in bitcoin.messages
First step in getting rid of the from foo import *'s
1 parent d6c5cd6 commit 9f5a095

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

bitcoin/messages.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
else:
2222
import cStringIO as io
2323

24+
# Bad practice, so we have a __all__ at the end; this should be cleaned up
25+
# later.
2426
from bitcoin.core import *
2527
from bitcoin.core.serialize import *
2628
from bitcoin.net import *
@@ -438,3 +440,28 @@ def __repr__(self):
438440
messagemap = {}
439441
for cls in msg_classes:
440442
messagemap[cls.command] = cls
443+
444+
445+
__all__ = (
446+
'MSG_TX',
447+
'MSG_BLOCK',
448+
'MSG_FILTERED_BLOCK',
449+
'MsgSerializable',
450+
'msg_version',
451+
'msg_verack',
452+
'msg_addr',
453+
'msg_alert',
454+
'msg_inv',
455+
'msg_getdata',
456+
'msg_getblocks',
457+
'msg_getheaders',
458+
'msg_headers',
459+
'msg_tx',
460+
'msg_block',
461+
'msg_getaddr',
462+
'msg_ping',
463+
'msg_pong',
464+
'msg_mempool',
465+
'msg_classes',
466+
'messagemap',
467+
)

0 commit comments

Comments
 (0)