V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
leisurelylicht
V2EX  ›  Python

What the f*ck Python !

  •  3
     
  •   leisurelylicht · 2018-11-28 15:53:05 +08:00 · 5260 次点击
    这是一个创建于 1948 天前的主题,其中的信息可能已经有所发展或是发生改变。

    看到一个有趣的 Python 项目, 专门介绍 python 里那些奇奇怪怪的语言坑。

    觉得很有意思,正好最近在学英语,就翻译了一份中文版.

    欢迎大家支持,纠错!顺便来波 star :-)

    28 条回复    2018-11-29 16:03:47 +08:00
    kepenj
        1
    kepenj  
       2018-11-28 15:55:39 +08:00
    亦可赛艇
    hk3475
        2
    hk3475  
       2018-11-28 15:56:41 +08:00   ❤️ 1
    感觉写一版 javascript 的能长一倍 哈哈
    verzhshq
        3
    verzhshq  
       2018-11-28 15:57:14 +08:00   ❤️ 1
    标题配合楼主头像食用味道更佳
    leisurelylicht
        4
    leisurelylicht  
    OP
       2018-11-28 15:57:58 +08:00
    @hk3475 事实上这个项目的原作者就是受到类似的 js 项目的启发才做了这个项目,文章最后有写
    1iuh
        5
    1iuh  
       2018-11-28 15:59:38 +08:00
    很有趣,感谢楼主翻译,已 star。
    hflyf123
        6
    hflyf123  
       2018-11-28 16:11:49 +08:00
    已 star,感谢楼主
    wohenyingyu03
        7
    wohenyingyu03  
       2018-11-28 17:02:20 +08:00
    看了前几个例子,java 不是也一样嘛,猜猜下面输出什么?

    Integer c=2;
    Integer d=2;
    Integer u=1000;
    Integer i=1000;
    int o=1000;
    System.out.println(c==d);
    System.out.println(u==i);
    System.out.println(o==i);
    System.out.println(o==u);
    Vegetable
        8
    Vegetable  
       2018-11-28 17:05:14 +08:00   ❤️ 6
    拜托别让出面试题的人看到这些
    andyL
        9
    andyL  
       2018-11-28 17:08:36 +08:00   ❤️ 1
    666666 看了几个例子 就觉的很不一般
    ddzzhen
        10
    ddzzhen  
       2018-11-28 17:08:58 +08:00
    有点意思
    chanchan
        11
    chanchan  
       2018-11-28 17:21:36 +08:00
    @wohenyingyu03 不想回答,反正就是 integerCache 相关的
    zcmxw1
        12
    zcmxw1  
       2018-11-28 17:29:37 +08:00 via Android
    我觉得上边 java 这几个知识点还是有必要掌握的
    glacer
        13
    glacer  
       2018-11-28 17:44:09 +08:00   ❤️ 1
    @wohenyingyu03 小整数缓存我一个不是主写 Java 的都知道
    JCZ2MkKb5S8ZX9pq
        14
    JCZ2MkKb5S8ZX9pq  
       2018-11-28 17:48:11 +08:00
    1002xin
        15
    1002xin  
       2018-11-28 18:04:48 +08:00
    666666
    0x5f
        16
    0x5f  
       2018-11-28 18:34:02 +08:00
    有意思 star 了
    di94sh
        17
    di94sh  
       2018-11-28 20:02:17 +08:00 via Android
    这些坑只要理解名字空间,就能看懂一大半。至于 return finally return 这种。估计没人这样用
    www5070504
        18
    www5070504  
       2018-11-28 20:16:02 +08:00
    感觉这个作者相当爱 python...
    codechaser
        19
    codechaser  
       2018-11-28 20:17:35 +08:00 via Android
    没看到链接啊
    waytoexplorewhat
        20
    waytoexplorewhat  
       2018-11-28 23:38:10 +08:00
    感谢楼主分享这个有意思的项目,翻译有心了
    likuku
        21
    likuku  
       2018-11-28 23:43:13 +08:00
    竟然是另起炉灶,而不是从原项目 fork 出来而新增加一个中文版 .md 来自己维护...
    likuku
        22
    likuku  
       2018-11-28 23:46:25 +08:00
    这个真是棒极了!比前几天吵的火热的那个 “将代码翻译成中文” 的项目 有意义得多啊...
    wspsxing
        23
    wspsxing  
       2018-11-28 23:48:40 +08:00 via Android
    真有爱啊,可惜我已经离开了
    fanhaipeng0403
        24
    fanhaipeng0403  
       2018-11-28 23:50:48 +08:00
    廖良开
    wohenyingyu03
        25
    wohenyingyu03  
       2018-11-29 10:01:25 +08:00
    @glacer 我没有说你不知道啊?本来就是常识啊,我只是问是不是应该写一篇 what the f**ck java ?
    leisurelylicht
        26
    leisurelylicht  
    OP
       2018-11-29 10:14:07 +08:00
    @Vegetable 😂😂😂


    @di94sh 我觉得这篇文章的意义就在于让你知道有这样的写法,但平时最好别用


    @likuku 另起炉灶的初衷时希望 commit 记录能保持纯净,因为我是每个列子提一个 commit,这样当你觉得我的翻译看不懂的时候翻一下 commit 记录就能很容易的获取原文与翻译对照的页面,而不用你在两个页面里来回找了。
    leisurelylicht
        27
    leisurelylicht  
    OP
       2018-11-29 10:14:49 +08:00
    @codechaser “中文版” 那三个字就是链接,直接点就可以了。
    8355
        28
    8355  
       2018-11-29 16:03:47 +08:00
    @hk3475 #2 IE6 7 8 9
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5405 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:32 · PVG 16:32 · LAX 01:32 · JFK 04:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.