title: Are there technical reasons a Ruby DSL like RSpec couldn't be rewritten in Python?
body: <p>The section below goes into more detail, but basically someone stated that the Ruby-written <a href="http://en.wikipedia.org/wiki/Domain-specific_language" rel="noreferrer">DSL</a> <a href="http://rspec.info/" rel="noreferrer">RSpec</a> couldn't be rewritten in Python. Is that true? If so, why? </p>
  
  <p>I'm wanting to better understand the technical differences between Ruby and Python.</p>
  
  <h2>Update: Why am I asking this question?</h2>
  
  <p>The <a href="http://permalink.gmane.org/gmane.comp.python.testing.general/3730" rel="noreferrer"><em>Running away from RSpec</em></a> discussion has some statements about it being "impossible" to recreate <a href="http://rspec.info/" rel="noreferrer">RSpec</a> in Python. I was trying to make the question a little broader in hopes of learning more of the technical differences between Ruby and Python. In hindsight, maybe I should have tightened the question's scope to just asking if it truly is impossible to recreate <a href="http://rspec.info/" rel="noreferrer">RSpec</a> in Python, and if so why.</p>
  
  <p>Below are just a few quotes from the <a href="http://permalink.gmane.org/gmane.comp.python.testing.general/3730" rel="noreferrer"><em>Running away from RSpec</em></a> discussion.</p>
  
  <h3>Initial Question</h3>
  
  <blockquote>
    <p>For the past few weeks I have been thinking a lot about RSpec and why there is no clear, definite answer when someone asks:</p>
    
    <blockquote>
      <p>"I'm looking for a Python equivalent of RSpec. Where can I find such a
      thing?"</p>
    </blockquote>
    
    <p>Probably the most common (and understandable) answer is that Python syntax
    wouldn't allow such a thing whereas in Ruby it is possible.</p>
  </blockquote>
  
  <h3>First Response to Initial Question</h3>
  
  <blockquote>
    <p>Not syntax exactly. Rspec monkeypatches every object inside of its
    scope, inserting the methods "should" and "should_not". You can do
    something in python, but you can't monkeypatch the built-in types.</p>
  </blockquote>
  
  <h3>Another Response</h3>
  
  <blockquote>
    <p>As you suggest, it's impossible. Mote and PySpec are just fancy ways
    to name your tests: weak implementations of one tiny corner of RSpec.
    Mote uses horrible settrace magic; PySpec adds a bunch of
    domain-irrelevant noise. Neither even supports arbitrary context
    strings. RSpec is more terse, more expressive, removes the noise, and
    is an entirely reasonable thing to build in Ruby.</p>
    
    <p>That last point is important: it's not just that RSpec is possible in
    Ruby; it's actually idiomatic. </p>
  </blockquote>