Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context.locals_() does not update the returned Context's kwargs attribute #219

Closed
sqlalchemy-bot opened this issue Jun 7, 2013 · 3 comments
Labels
bug Something isn't working low priority runtime

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Anonymous

unit test:

class ContextTest(unittest.TestCase):
  def test_locals_kwargs(self):
    c = Context(None, foo='bar')
    self.assertEqual(c.kwargs, {'foo': 'bar'})
    d = c.locals_({'zig': 'zag'})
    self.assertEqual(c.kwargs, {'foo': 'bar'})
    self.assertEqual(d.kwargs, {'foo': 'bar', 'zig': 'zag'})

attached is a patch for mako 0.7.2.


Attachments: mako-0.7.2.patch

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

thanks for this - I haven't looked at this code in over a year, is there a template-oriented use case you can show me that's impacted by this ?

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

OK not sure what your use case was since I don't have one here, if it was that you were calling locals_() yourself for something, that's not what its for, and if it was that you were using context.kwargs and expecting some local variable or something to be present inside of it, that's also not what its for, else there would be no need for kwargs to be maintained separately in the first place. So locals_() is now _locals() and documentation has been clarified in 420a083.

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority runtime
Projects
None yet
Development

No branches or pull requests

1 participant