Comments (3)
I do not understand what the problem is. Can you post a minimal code example of what it does and what you'd want it to do?
from typedload.
class IEntry(NamedTuple):
front: str = ""
deck: str = ""
id: Optional[int] = None
back: Optional[str] = None
mnemonic: Optional[str] = None
tag: Optional[List[str]] = None
srsLevel: Optional[int] = None
nextReview: Optional[str] = None
created: Optional[str] = None
modified: Optional[str] = None
stat: Optional[IStat] = None
template: Optional[str] = None
model: Optional[str] = None
tFront: Optional[str] = None
tBack: Optional[str] = None
css: Optional[str] = None
js: Optional[str] = None
key: Optional[str] = None
data: Optional[List[IDataSocket]] = None
source: Optional[str] = None
sH: Optional[str] = None
sCreated: Optional[str] = None
print(typedload.dump(IEntry()))
Should preferably yield
{"front":"", "deck": ""}
from typedload.
It just hides the fields which have the same value as the default value, so None
is in no way different than ''
or whatever other arbitrary value you might chose.
You can implement custom behaviours by adding specific handlers.
Closing this.
from typedload.
Related Issues (20)
- Support typing.NewType
- doc package fixe HOT 1
- Lack of type safety due to `**kwargs` HOT 1
- Suggestion: Automatically handle types that provide a from_dict and to_dict method HOT 10
- Inherited fields not serialized HOT 1
- handle from __future__ import annotations / ForwardRefs better HOT 8
- typedload.dataloader.is_union(int | str) == False HOT 1
- `typing.NotRequired[]` not supported HOT 5
- support decimal and fraction HOT 4
- Dictionary produced by dump() missing field its value is the default value HOT 1
- use typing extensions to support types on older py versions HOT 1
- crash
- Look into dataclass transform HOT 1
- Package not available in conda channels. HOT 2
- See whatever the hell this deprecation means
- compare to msgspec
- Possible to disable error on type which cannot be dealt with? HOT 2
- Why not cattrs HOT 1
- License compatibility with MPL-2 HOT 6
- type definition out of date compared to the documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typedload.