aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-03-23 00:25:44 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-03-23 00:25:44 -0400
commitd6b63dab019b16f2738b0b62350718827b52d0a6 (patch)
tree34e38312b7c87e8890f741fc1bfe182517867008
parent427bcf036b56b5df8ba0816ea75253415e980f1b (diff)
downloadcryptography-d6b63dab019b16f2738b0b62350718827b52d0a6.tar.gz
cryptography-d6b63dab019b16f2738b0b62350718827b52d0a6.tar.bz2
cryptography-d6b63dab019b16f2738b0b62350718827b52d0a6.zip
Attempt at simplifying the repr code.
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/rsa.py2
-rw-r--r--src/cryptography/x509.py5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
index 8adc7459..ae00184f 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -348,7 +348,7 @@ class RSAPublicNumbers(object):
return backend.load_rsa_public_numbers(self)
def __repr__(self):
- return "<RSAPublicNumbers(e={0}, n={1})>".format(self._e, self._n)
+ return "<RSAPublicNumbers(e={0.e}, n={0.n})>".format(self)
def __eq__(self, other):
if not isinstance(other, RSAPublicNumbers):
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index ad7ebbe0..1d2a9489 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -90,10 +90,7 @@ class NameAttribute(object):
return not self == other
def __repr__(self):
- return "<NameAttribute(oid={oid}, value={value!r})>".format(
- oid=self.oid,
- value=self.value
- )
+ return "<NameAttribute(oid={0.oid}, value={0.value!r})>".format(self)
class ObjectIdentifier(object):