From 588a1566ef5c5a07101a138e170f26683e4e2063 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 30 Jul 2025 14:51:32 +1200 Subject: [PATCH] py:samdb: drop unused methods (get_binary_integer, get_bytes) get_binary_integer() is still a method on BinaryDn, but not on StringDn and PlainDn where it makes no sense. x.get_bytes() is merely an alias for x.binary. Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- python/samba/samdb.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 47a8399321f..483bfd7a71c 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -28,7 +28,7 @@ import time import base64 import os import re -from typing import Optional, Union +from typing import Union from samba import dsdb, dsdb_dns from samba.ndr import ndr_unpack, ndr_pack @@ -1737,18 +1737,10 @@ class BaseDsdbDn: def __ge__(self, other): return self.__cmp__(other) >= 0 - def get_bytes(self) -> Optional[bytes]: - return self.binary - def __str__(self) -> str: dnstr = self.dn.extended_str(mode=1) return f"{self.prefix}{dnstr}" - def get_binary_integer(self) -> int: - # Overridden in BinaryDn to return the binary value as an integer. - # We will remove it from here soon. - return 0 - class PlainDn(BaseDsdbDn): """This does very little, other than providing the sort order (via -- 2.47.2