Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 08-21-2018, 10:38 PM   #1
flaviut
Junior Member
flaviut began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2018
Device: none
__builtin__.__dict__['dynamic_property']

Hi, I was browsing through the source code and came across the following line:

Code:
__builtin__.__dict__['dynamic_property'] = lambda func: func(None)
in calibre/__init__.py

I'm curious why this was done like this instead of creating a separate module to be imported?
flaviut is offline   Reply With Quote
Old 08-21-2018, 11:03 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because it is used in lots of places. THere are a few extra code-wide globals calibre uses.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 08:39 AM.


MobileRead.com is a privately owned, operated and funded community.