The section below goes into more detail, but basically someone stated that the Ruby-written DSL RSpec couldn't be rewritten in Python. Is that true? If so, why?
I'm wanting to better understand the technical differences between Ruby and Python.
Update: Why am I asking this question?
The Running away from RSpec discussion has some statements about it being "impossible" to recreate RSpec 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 RSpec in Python, and if so why.
Below are just a few quotes from the Running away from RSpec discussion.
Initial Question
For the past few weeks I have been thinking a lot about RSpec and why there is no clear, definite answer when someone asks:
"I'm looking for a Python equivalent of RSpec. Where can I find such a thing?"
Probably the most common (and understandable) answer is that Python syntax wouldn't allow such a thing whereas in Ruby it is possible.
First Response to Initial Question
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.
Another Response
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.
That last point is important: it's not just that RSpec is possible in Ruby; it's actually idiomatic.