cloudpipe / cloudpipe/cloudpickle
Support for pickling functions within a class defined outside of __main__?
- Vorherrschende Sprache
- Python
- Sterne
- 1.9k
- Forks
- 195
- Ø Merge
- 1 T. 10 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Cloudpickle's ability to serialize instantiated classes and their member functions is a huge advantage over cloudpickle alternatives. Unfortunately, this feature seems limited heavily to the check for `instantiated_class.__module__ == '__main__'`.
One hacky solution is to set `__module__` in the class definition:
```
class SomeFunClass(object):
__module__ = '__main__'
# Rest of the class definition
```
But this could cause problems with any code that relies on a proper value for `__module__`. Is there another solution I'm not seeing?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.