美文网首页
一个奇怪的list

一个奇怪的list

作者: 正哥哥 | 来源:发表于2018-05-13 10:45 被阅读0次
    In [21]: print(inputs)
    [<socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.124.129', 1234)>]
    
    In [22]: type(inputs)
    Out[22]: list
    
    In [23]: mylist = [<socket.socket fd=12, family=AddressFamily.AF_INET, type=Sock
        ...: etKind.SOCK_STREAM, proto=0, laddr=('192.168.124.129', 1234)>]
      File "<ipython-input-23-9836698e2996>", line 1
        mylist = [<socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.124.129', 1234)>]
                  ^
    SyntaxError: invalid syntax
    
    In [33]: mylist = inputs
    
    In [34]: print(mylist)
    [<socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.124.129', 1234)>]
    

    mylist使用inputs相同的值去赋值报错!但是下面一段引用inputs这个列表却没问题,什么鬼?

    暂时搞不清楚什么原因,待后续捣鼓!!!

    相关文章

      网友评论

          本文标题:一个奇怪的list

          本文链接:https://www.haomeiwen.com/subject/ciokdftx.html