Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one parameter format #30

Closed
kbandla opened this issue Jun 4, 2015 · 1 comment
Closed

one parameter format #30

kbandla opened this issue Jun 4, 2015 · 1 comment

Comments

@kbandla
Copy link
Owner

kbandla commented Jun 4, 2015

From sunyi...@gmail.com on March 15, 2007 17:59:18

class P(dpkt.Packet):
hdr = (('a','B',0))
won't work

class P(dpkt.Packet):
hdr = [('a','B',0)]

works.

Original issue: http://code.google.com/p/dpkt/issues/detail?id=2

@kbandla
Copy link
Owner Author

kbandla commented Jun 4, 2015

From dugsong on March 15, 2007 17:02:01

this is actually a Python language issue not specific to dpkt.

what you want is

hdr = (('a','B',0), ) # note the dangling comma

from http://docs.python.org/lib/typesseq.html :

"A single item tuple must have a trailing comma, such as (d,)."

using a list instead is fine too, and probably looks better anyway. :-)

Status: Invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant