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 #2

Closed
GoogleCodeExporter opened this issue May 5, 2015 · 1 comment
Closed

one parameter format #2

GoogleCodeExporter opened this issue May 5, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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

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

works.

Original issue reported on code.google.com by sunyi...@gmail.com on 15 Mar 2007 at 9:59

@GoogleCodeExporter
Copy link
Author

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. :-)

Original comment by dugsong on 16 Mar 2007 at 12:02

  • Changed state: 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