renpy/renpy — pull request #120 by ckoepp (2013-07-14 08:27:14+00:00)
Title: Added __str__ to ADVCharacter class

I found it quite terrible to have to directly write every name into dialogues. The only solution I found was to define a variable for every char which is simply unnecessary as most characters do have a definition.

I think it would be way easier to simply implement an ``ADVCharacter.__str__`` method. With this patch you could avoid multiple definitions of a character's name:

```
define c = Character('myChar', color="#c0c0c0")
c "Hello there. My name is %(c)s"
```

Additionally my emacs removed all hidden tabs and spaces for example if there were tabs and/or space in empty lines (sorry about that - but by doing this at least the file gets smaller in size, so I just left it this way). The ``__str__`` method is at line 731.

I'm not quite sure if this would be your way of handling this issue, but if you're fine with a ``__str__`` method to directly use your classes in dialogues you may accept this small patch. I think it's easier and more convenient to us this a syntax like ``%(c)s`` in order to reduce redundancy.