vendredi 23 février 2018

Factory method arguments available in instance of inner class in python

When browsing Pyramid code I noticed one interesting thing in pyramid/session.py and I don't understand how it works and would be glad if you could explain or point me to the explanation.

In the mentioned pyramid/session.py there is method BaseCookieSessionFactory, which returns CookieSession object. In the CookieSession.__init__ and CookieSession._set_cookie parameter serializer is used.

I also created a simple example on repl.it, which represents the same behavior. I don't understand how can class instance can continue achieving outer function parameter when I call class_instance.get_a()

Aucun commentaire:

Enregistrer un commentaire