You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an IRC bot that fetches content when it sees certain URLs. It would be nice to pull the correct article for a given URL based on its language code in the URL. Currently, this is only possible by setting the language property. This has two downsides: (a) the memoized cache is cleared, (b) you need to make sure the language property is set back afterwards.
If page() took a language parameter, it would be possible to easily toggle it for specific lookups. The cache could either be ignored in these cases, or the cache could be extended to use a per-language dictionary.
The text was updated successfully, but these errors were encountered:
It would also be nice to be able to specify what data is preloaded - for example, I'd like to defer network calls to a thread, and I can do this with preload=True but then when I go to fetch langlinks, another call is made. Since langlinks is also a property and not a function, it's also a bit awkward to defer that call to a thread.
@johnmaguire I think there wouldn't be a reason not to do the language parameter on the page function and allow bypassing the cache. I guess another short term option would be to keep a few instances around for different languages but not sure how that would work in your case.
As for the other comment, I guess that would be possible to let people set the preload items but I'm not sure if that would make it even less likely to be utilized. I'd be happy to look at suggestions on how that could be done.
Unfortunately, I do not have much time to dedicate to making these types of changes myself at the moment but Pull Requests are always welcome!
Hi there, thanks for this library.
I have an IRC bot that fetches content when it sees certain URLs. It would be nice to pull the correct article for a given URL based on its language code in the URL. Currently, this is only possible by setting the language property. This has two downsides: (a) the memoized cache is cleared, (b) you need to make sure the language property is set back afterwards.
If
page()
took a language parameter, it would be possible to easily toggle it for specific lookups. The cache could either be ignored in these cases, or the cache could be extended to use a per-language dictionary.The text was updated successfully, but these errors were encountered: