New submission from Erik Allik: >>> class Foo(object): ... pass ... >>> "asdads" % Foo() 'asdads'
Doesn't look like it's supposed to be this way. As per the documentation: "If format requires a single argument, values may be a single non-tuple object. [5] Otherwise, values must be a tuple with exactly the number of items specified by the format string, or a single mapping object (for example, a dictionary)." Tested and confirmed on 2.5, 2.6, 2.7 (both old and new style classes) and 3.2. ---------- messages: 169300 nosy: eallik priority: normal severity: normal status: open title: Weird string interpolation behaviour type: behavior versions: Python 2.6, Python 2.7, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15801> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com