Hacker News new | past | comments | ask | show | jobs | submit login

There are a bunch of these. There's the Python 2 specific string formatting as well:

    # Input, assignment
    >>> name = input('What is your name?\n')
    >>> print 'Hi, %s.' % name
Why so Python 2 specific? Why not Python 3? : (



However, they also used an example showing that integer division returns a float, which is a behaviour specific to Python 3.


Not completely, this has been available in python 2 for a long time:

>>> from __future__ import division


%-based string interpolation still works in python 3.


Huh, you're right. I could have sworn it was taken out in favor of '.format'; I wonder where I got that idea from...?


I believe they were going to but were met with stern resistance from the community and caved.


I concur. % formatting is extremely cute and I miss it in every other language.


% formatting is not Python 2 specific, plans to remove it from 3 have been deferred.


They had better not. I much prefer it to .format()


Me too; .format() is too verbose.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: