Hacker GitHub

← All repos

syrusakbary/interpy

View on GitHub ↗ ★ 253 Python

Ruby like string interpolation #{} in Python

7 mentions on Hacker News by 4 people: 3 stories, 4 comments · first 2014-01-08 · latest 2016-01-04

Mentions per year 7 mentions · busiest year 2015 (4)
20082026
  1. Quite useful! If you want to have string interpolation in Python 2.6+ just use https://github.com/syrusakbary/interpy
    comment by syrusakbary · 2016-01-04 · in New string formatting in Python
  2. …to fix >>> def test(x=1):return lambda:say.say("{x}") >>> test() NameError: name 'x' is not defined https://github.com/syrusakbary/interpy seems like a closer solution, could be modified to also support format specs
  3. …but you can also have magic macros using `coding` hack. It could add arbitrary syntax to python https://github.com/syrusakbary/interpy previously https://news.ycombinator.com/item?id=9340784
  4. > Is there a default, fixed encoding For interpy, I think it assumes utf-8 by default. https://github.com/syrusakbary/interpy/blob/master/interpy/c...
  5. ▲ 63
    Ruby-like string interpolation in Python
    story by est · 2015-04-08 · 50 comments
  6. ▲ 1
    Interpy - Extending Python to support Ruby like string interpolation
    story by syrusakbary · 2014-01-08 · 0 comments
  7. ▲ 1
    Interpy: Ruby like string interpolation in Python
    story by randlet · 2014-01-08 · 0 comments