Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deepcoy for dpg model #2523

Merged
merged 7 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/few-poets-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@azure-tools/typespec-python": patch
---

remove deepcopy when DPG model init
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import sys
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -347,7 +346,7 @@ _UNSET = object()

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import logging
import base64
import re
import copy
import typing
import enum
import email.utils
Expand Down Expand Up @@ -339,7 +338,7 @@ def _get_model(module_name: str, model_name: str):

class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
self._data = copy.deepcopy(data)
self._data = data

def __contains__(self, key: typing.Any) -> bool:
return key in self._data
Expand Down
Loading
Loading