summaryrefslogtreecommitdiffstats
path: root/Lib/email/policy.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/email/policy.py')
-rw-r--r--Lib/email/policy.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/email/policy.py b/Lib/email/policy.py
index 47ed66b..bfffb45 100644
--- a/Lib/email/policy.py
+++ b/Lib/email/policy.py
@@ -69,6 +69,14 @@ class EmailPolicy(Policy):
object.__setattr__(self, 'header_factory', HeaderRegistry())
super().__init__(**kw)
+ def header_max_count(self, name):
+ """+
+ The implementation for this class returns the max_count attribute from
+ the specialized header class that would be used to construct a header
+ of type 'name'.
+ """
+ return self.header_factory[name].max_count
+
# The logic of the next three methods is chosen such that it is possible to
# switch a Message object between a Compat32 policy and a policy derived
# from this class and have the results stay consistent. This allows a