[issue37922] inspect.getsource returns wrong class definition when multiple class definitions share the same name (but are defined in different scopes)
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue37922> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37922] inspect.getsource returns wrong class definition when multiple class definitions share the same name (but are defined in different scopes)
Caleb Donovick added the comment: I think findsource could be made more robust by using __qualname__ if it available. -- ___ Python tracker <https://bugs.python.org/issue37922> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue35113> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29944] Argumentless super() fails in classes constructed with type()
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue29944> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17422] language reference should specify restrictions on class namespace
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue17422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17422] language reference should specify restrictions on class namespace
Caleb Donovick added the comment: While It is perfectly fine behavior for CPython to use a dict, as dict is an ordered mapping. I think Eric is right that the data model should not specify that a dict is necessarily used in the absence of __prepare__. -- ___ Python tracker <https://bugs.python.org/issue17422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17422] language reference should specify restrictions on class namespace
Change by Caleb Donovick : -- pull_requests: +18041 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18682 ___ Python tracker <https://bugs.python.org/issue17422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39775] inspect.Signature.parameters should be an OrderedDict, not a plain dict
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue39775> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39753] inspecting a partial with bound keywods gives incorrect signature
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue39753> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41232] Python `functools.wraps` doesn't deal with defaults correctly
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue41232> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
New submission from Caleb Donovick : Currently EnvBuilder allows for a number of customizations of virtual environments, however, it does not allow for any modifications of the activate script itself (unless one wants to rewrite it completely). Yet, it is fairly common requirement for python packages is to set some environmental variable e.g., DJANGO_SETTINGS_MODULE=. EnvBuilder should be able extend the set of variables which are set and restored on activate / deactivate (or more generally have activate / deactivate hooks). Originally proposed on python-ideas https://mail.python.org/archives/list/python-id...@python.org/thread/MJNFEFT4GBVBEETJWZUQM5SS6C34PT3K/ -- components: Interpreter Core messages: 346122 nosy: donovick priority: normal severity: normal status: open title: venv.EnvBuilder environmental variable hooks type: enhancement ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Change by Caleb Donovick : -- keywords: +patch pull_requests: +14096 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14272 ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Caleb Donovick added the comment: I have basic version working in POSIX. -- ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Caleb Donovick added the comment: Common python libraries that make use of environmental variables: - django - flask - jupyter - TensorFlow This is just off the top my head. While most developers are probably fine just setting the required variables at a system level that doesn't mean they should. The whole point of virtual environments is to avoid global state. Overriding setup scripts is hardly a trivial task. One has to completely recreate the activate script to achieve the desired behavior. -- ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Caleb Donovick added the comment: In regards to the added complexity by needing to be implemented across all shells, the functionality I am requesting already exists across all shells (e.g. setting PYTHONPATH) just not in a extensible way. -- ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Caleb Donovick added the comment: > I didn't say environment variables weren't commonly used. I'm talking about > the specific functionality this issue is about. This is likely true, to most people venv is black magic. That doesn't mean that people wouldn't use it if the functionality existed though. In fact this the first example given by virtualenvwrapper https://virtualenvwrapper.readthedocs.io/en/latest/scripts.html#example-usage I personally don't use virtualenvwrapper because you they use a centralized list of env's which is non-starter for me. I maintain dozens of envs (one per project, sometimes one per branch). So one big list would be a nightmare. > I'm talking about the code to set, reset your custom environment variables - > where is that already existent across all shells? My point is that this code is not really different than the code to set PYTHONPATH. > I'm not saying what you want is unreasonable - it's just putting it into the > stdlib this way that I'm not sure about. Is there an architecture that would be less objectionable? > I mentioned on python-ideas and opened https://bugs.python.org/issue37354 to > actually make the Activate.ps1 file static for security purposes. I am curious how you plan to achieve this without reducing the functionality of venv? -- ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37354] Write PowerShell Activate.ps1 to be static so it can be signed
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue37354> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Caleb Donovick added the comment: >PowerShell has a full programming language and all details can be found in >pyvenv.cfg now as of Python 3.8. So Activate.ps1 can read that file to get >what it needs to set paths and the prompt which is what gets substituted into >the generate Activate.ps1. Then that should be fairly orthogonal to this issue. We should be able to store key, value pairs in the config and set the environmental variables accordingly. -- ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37349] venv.EnvBuilder environmental variable hooks
Caleb Donovick added the comment: I have another idea, instead of baking in the semantics of the environmental variables, we could simply add the hooks __VENV_ACTIVATE_EXTRAS__ and __VENV_DEACTIVATE_EXTRAS__ to activate. By default they would be replaced by '', but would allow subclasses to extend the behavior of activate / deactivate arbitrarily. > One thing I would consider is the ability to configure a custom_script_path > in the same way as other parameters are now. It would be used as follows: If > not None, it should specify a directory, and the files in there would be > copied to the target venv *after* the standard scripts are copied (possibly > overwriting ones already there, such as "activate"), with the same variable > substitutions that are currently done. I'll take a stab at implementing this if the above proposal is not acceptable. -- ___ Python tracker <https://bugs.python.org/issue37349> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue36881> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37670] Description of UserDict is misleading
New submission from Caleb Donovick : The documentation for collections.UserDict states "In addition to supporting the methods and operations of mappings, UserDict instances provide the following attribute: ..." This however is misleading as it supports the operations of mutable mappings. Which is not stated anywhere. -- assignee: docs@python components: Documentation messages: 348393 nosy: docs@python, donovick priority: normal severity: normal status: open title: Description of UserDict is misleading ___ Python tracker <https://bugs.python.org/issue37670> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35083] Fix documentation for __instancecheck__
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue35083> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35992] Metaclasses interfere with __class_getitem__
New submission from Caleb Donovick : OS: Debian testing python3 -VV: Python 3.7.2+ (default, Feb 2 2019, 14:31:48) [gcc 8.2.0] The following: ``` class Meta(type): pass class X(metaclass=Meta): def __class_getitem__(cls, key): return key X[10] ``` Results in ``` TypeError: 'Meta' object does not support indexing ``` However, PEP 560 specifically states that __class_getitem__ should be used as fall back for when a metaclass does not implement __getitem__. -- assignee: docs@python components: Documentation, Interpreter Core messages: 335497 nosy: Donovick, docs@python priority: normal severity: normal status: open title: Metaclasses interfere with __class_getitem__ type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue35992> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17421] Drop restriction that meta.__prepare__() must return a dict (subclass)
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue17421> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17421] Drop restriction that meta.__prepare__() must return a dict (subclass)
Caleb Donovick added the comment: In my mind this seems like a bug. PEP 3115 states: ''' __prepare__ returns a dictionary-like object which is used to store the class member definitions during evaluation of the class body. In other words, the class body is evaluated as a function block (just like it is now), except that the local variables dictionary is replaced by the dictionary returned from __prepare__. This dictionary object can be a regular dictionary or a custom mapping type. ''' -- ___ Python tracker <https://bugs.python.org/issue17421> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35297] untokenize documentation is not correct
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue35297> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29282] Fused multiply-add: proposal to add math.fma()
Change by Caleb Donovick : -- nosy: +donovick ___ Python tracker <https://bugs.python.org/issue29282> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com