11
11
from mcproto .types .abc import MCType
12
12
13
13
T = TypeVar ("T" )
14
- T_2 = TypeVar ("T_2 " )
14
+ U = TypeVar ("U " )
15
15
16
16
17
17
class EntityMetadataEntry (MCType , Generic [T ]):
@@ -137,19 +137,19 @@ def deserialize(cls, buf: Buffer) -> EntityMetadataEntry[T]:
137
137
return cls (index = index , value = value )
138
138
139
139
140
- class ProxyEntityMetadataEntry (MCType , Generic [T , T_2 ]):
140
+ class ProxyEntityMetadataEntry (MCType , Generic [T , U ]):
141
141
"""A proxy entity metadata entry which is used to designate a part of a metadata entry in a human-readable format.
142
142
143
143
For example, this can be used to represent a certain mask for a ByteEME entry.
144
144
"""
145
145
146
146
ENTRY_TYPE : ClassVar [int ] = None # type: ignore
147
147
148
- bound_entry : EntityMetadataEntry [T_2 ]
148
+ bound_entry : EntityMetadataEntry [U ]
149
149
150
150
__slots__ = ("bound_entry" ,)
151
151
152
- def __init__ (self , bound_entry : EntityMetadataEntry [T_2 ], * args : Any , ** kwargs : Any ):
152
+ def __init__ (self , bound_entry : EntityMetadataEntry [U ], * args : Any , ** kwargs : Any ):
153
153
self .bound_entry = bound_entry
154
154
self .validate ()
155
155
@@ -159,7 +159,7 @@ def serialize_to(self, buf: Buffer) -> None:
159
159
160
160
@override
161
161
@classmethod
162
- def deserialize (cls , buf : Buffer ) -> ProxyEntityMetadataEntry [T , T_2 ]:
162
+ def deserialize (cls , buf : Buffer ) -> ProxyEntityMetadataEntry [T , U ]:
163
163
raise NotImplementedError ("Proxy entity metadata entries cannot be deserialized." )
164
164
165
165
@abstractmethod
@@ -195,7 +195,7 @@ def entry(entry_type: type[EntityMetadataEntry[T]], value: T) -> T:
195
195
196
196
197
197
@define
198
- class ProxyEntityMetadataEntryDeclaration (Generic [T , T_2 ]):
198
+ class ProxyEntityMetadataEntryDeclaration (Generic [T , U ]):
199
199
"""Class used to pass the bound entry and additional arguments to the proxy entity metadata entry.
200
200
201
201
Explanation:
@@ -209,16 +209,16 @@ class ProxyEntityMetadataEntryDeclaration(Generic[T, T_2]):
209
209
This is set by the EntityMetadataCreator.
210
210
"""
211
211
212
- m_bound_entry : EntityMetadataEntry [T_2 ]
212
+ m_bound_entry : EntityMetadataEntry [U ]
213
213
m_args : tuple [Any ]
214
214
m_kwargs : dict [str , Any ]
215
- m_type : type [ProxyEntityMetadataEntry [T , T_2 ]]
215
+ m_type : type [ProxyEntityMetadataEntry [T , U ]]
216
216
m_bound_index : int
217
217
218
218
219
219
def proxy (
220
- bound_entry : T_2 , # This will in fact be an EntityMetadataEntry, but treated as a T_2 during type checking
221
- proxy : type [ProxyEntityMetadataEntry [T , T_2 ]],
220
+ bound_entry : U , # This will in fact be an EntityMetadataEntry, but treated as a U during type checking
221
+ proxy : type [ProxyEntityMetadataEntry [T , U ]],
222
222
* args : Any ,
223
223
** kwargs : Any ,
224
224
) -> T :
0 commit comments