[Discussions on Python.org] Confirm your new account

2024-10-03 Thread Discussions on Python.org
Welcome to Discussions on Python.org! Click the following link to confirm and activate your new account: https://discuss.python.org/u/activate-account/07f5e9c8063acc78d595f097b6fa27cb If the above link is not clickable, try copying and pasting it into the address bar of your web browser.

[Py] [Python Help] Request for Guidance and Resources for Contributing to CPython

2024-10-09 Thread Stefan via Discussions on Python.org
Visit python.org, click "Contributing". --- [Visit Topic](https://discuss.python.org/t/request-for-guidance-and-resources-for-contributing-to-cpython/67149/2) or reply to this email to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails

[Py] [Core Development] Review requested for 13 pull requests

2024-10-08 Thread Nice Zombies via Discussions on Python.org
@barneygale, I'm still waiting for your response here: - https://github.com/python/cpython/pull/120146 - https://github.com/python/cpython/pull/119172 --- [Visit Topic](https://discuss.python.org/t/review-requested-for-13-pull-requests/62582/2) or reply to this email to respond. You are

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread James Campbell via Discussions on Python.org
Nice so it will give an error like this now ? If so, nice! ``` TypeError: Key “name” cannot be used with “NoneType” because it’s not subscripts or ``` --- [Visit Topic](https://discuss.python.org/t/small-suggestion-regarding-type-errors-and-subscription/67898/3) or reply to this email to

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread James Webber via Discussions on Python.org
Do you mean like this? ``` $ python -c 'print({"profile":None}["profile"]["name"])' Traceback (most recent call last): File "", line 1, in print({"profile":None}["profile"]["name"]) ~~~ TypeError: 'NoneType' object is not subscriptable ``` This i

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread Cornelius Krupp via Discussions on Python.org
No, it will give the error message @jamestwebber showed. Try it out in a python shell! That is the easiest way to figure out exactly how a feature behaves. --- [Visit Topic](https://discuss.python.org/t/small-suggestion-regarding-type-errors-and-subscription/67898/4) or reply to this emai

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread Elis Byberi via Discussions on Python.org
https://peps.python.org/pep-0657/ --- [Visit Topic](https://discuss.python.org/t/small-suggestion-regarding-type-errors-and-subscription/67898/5) or reply to this email to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click her

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread Saaket Prakash via Discussions on Python.org
[quote="James Webber, post:2, topic:67898, username:jamestwebber"] confirmed it’s new in 3.13 [/quote] This should be available since 3.11 https://docs.python.org/3/whatsnew/3.11.html#pep-657-fine-grained-error-locations-in-tracebacks But it seems the old REPL didn't show them properly. So I th

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread James Webber via Discussions on Python.org
That makes much more sense. I was sure I had seen it before 3.13, but it must have been in a notebook or somewhere else where it displayed properly. I don't use the base REPL very often. --- [Visit Topic](https://discuss.python.org/t/small-suggestion-regarding-type-errors-and-subscription

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-14 Thread James Campbell via Discussions on Python.org
If this provides you an error message on the specific key that’s missing ``` class User: profile = None u = User() u.profile.name # AttributeError: None does not have attribute name ``` Then may I suggest that this has the same ? ``` user = { “profile”: None } user[“profile”][“name”] # Ty

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-15 Thread James Campbell via Discussions on Python.org
Noted, yes this was more just a QOL improvement suggestion by me as it strikes me as a useful breadcrumb that could be left to help to the developer get to the bottom of where it's come from especially when debugging bad code like this. The faster they can find where the bad code is and refact

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-15 Thread Michael H via Discussions on Python.org
[quote="James Campbell, post:11, topic:67898, full:true, username:jcampbell05"] **getattr** already includes the attribute name in the Exception, is there a reason that **getitem** could not do the same ? [/quote] If you look closely at the exception here, where `None` comes from is underlined

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-15 Thread James Campbell via Discussions on Python.org
__getattr__ already includes the attribute name in the Exception, is there a reason that __getitem__ could not do the same ? --- [Visit Topic](https://discuss.python.org/t/small-suggestion-regarding-type-errors-and-subscription/67898/11) or reply to this email to respond. You are receivi

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-15 Thread Chris Markiewicz via Discussions on Python.org
`obj[key]` is sugar for `obj.__getitem__(key)`. The first step is to look up the `__getitem__` method, and the second is to call it with the key. While it's possible that the code that raises the `TypeError` has access to all three objects, it can already be raised just by attempting `getattr(

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-15 Thread James Parrott via Discussions on Python.org
If that line of code is broken up across two lines, the error will be more specific, and the bug simple to fix. Python one liners are superficially great, but only when they work. Debugging them and trying to understand them, not so much. --- [Visit Topic](https://discuss.python.org/t/s

[Py] [Ideas] Small suggestion regarding type errors and subscription

2024-10-15 Thread James Campbell via Discussions on Python.org
Of course but there is always a big gap between the code you should write And the code you’ve been given to debug 😀 --- [Visit Topic](https://discuss.python.org/t/small-suggestion-regarding-type-errors-and-subscription/67898/9) or reply to this email to respond. You are receiving this b

[Py] [Python Help] Request for Guidance and Resources for Contributing to CPython

2024-10-09 Thread Nishant Bansal via Discussions on Python.org
Hi CPython Community, I’m Nishant Bansal, and I’m excited to start contributing to CPython as part of my preparation for Google Summer of Code (GSoC). I would love to gain a deeper understanding of how the CPython codebase works so I can contribute effectively. Could anyone guide me on: 1. *

[Py] [Python Help] Request for Guidance and Resources for Contributing to CPython

2024-10-10 Thread Daniel Hollas via Discussions on Python.org
You might also check out the traffic on CPython repo, pull requests and issues, to see what is being worked on and by whom. --- [Visit Topic](https://discuss.python.org/t/request-for-guidance-and-resources-for-contributing-to-cpython/67149/4) or reply to this email to respond. You are re

[Py] [Python Help] Request for Guidance and Resources for Contributing to CPython

2024-10-10 Thread Carol Willing via Discussions on Python.org
The DevGuide is a good starting point: https://devguide.python.org --- [Visit Topic](https://discuss.python.org/t/request-for-guidance-and-resources-for-contributing-to-cpython/67149/3) or reply to this email to respond. You are receiving this because you enabled mailing list mode. To un

[Py] [Python Help] No able to activate a virtual env on pycharm

2024-10-11 Thread Luis Saavedra via Discussions on Python.org
Dear Python community. the issue I am facing is i am not able to activate a virtual env. using Pycharm app. Please not the following: 1. I have a folder with a project running python/Django, named “Production” copied in an external hard drive, the project folder was copied from a ubun

[Py] [Python Help] No able to activate a virtual env on pycharm

2024-10-11 Thread Alexander Bessman via Discussions on Python.org
The command to activate a venv is `source venv/bin/activate`. --- [Visit Topic](https://discuss.python.org/t/no-able-to-activate-a-virtual-env-on-pycharm/67551/2) or reply to this email to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these em

[Py] [Python Help] No able to activate a virtual env on pycharm

2024-10-11 Thread Luis Saavedra via Discussions on Python.org
thank you Alexander I was so used to running it from powershell on windows, that I didn't use the source command. Thank you so much --- [Visit Topic](https://discuss.python.org/t/no-able-to-activate-a-virtual-env-on-pycharm/67551/3) or reply to this email to respond. You are receiving

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-11 Thread Clint Hepner via Discussions on Python.org
Still, it boils down to: whatever command `west` executes is either not found outside your virtual environment, or a different version exists outside it. Path lookup is not exclusive to the shell; `subprocess.run` *also* uses path lookup to find `command-provided-by-a-required-package`. -

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-11 Thread James Parrott via Discussions on Python.org
It's expected behaviour. To be able to run a command line tool globally, it could be installed with pipx. Pipx'll put it in its own venv, and add the tool's executable to the global path. --- [Visit Topic](https://discuss.python.org/t/venv-activate-script-changes-path-while-executing-th

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-11 Thread Clint Hepner via Discussions on Python.org
[quote="Jérôme Pouiller, post:5, topic:67580, full:true, username:jerome-pouiller"] But, the [documentation says](https://docs.python.org/3/library/venv.html#how-venvs-work): > Furthermore, all scripts installed in the environment should be runnable > without activating it. My understanding

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-11 Thread James Parrott via Discussions on Python.org
"Should" is a strong word. Why not simply import the package and call the entry point directly? --- [Visit Topic](https://discuss.python.org/t/venv-activate-script-changes-path-while-executing-the-binary-doesnt/67580/9) or reply to this email to respond. You are receiving this because y

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-11 Thread Clint Hepner via Discussions on Python.org
No, the idea is that you write the Python code with enough information to *identify* the external binary, given a suitable execution environment. Ideally, you are going to execute the command by name alone, not an absolute or relative path, and configure the (virtual) environment so that the c

[Py] [Core Development] Help requested with implementing strict-map

2024-10-04 Thread Zeke W via Discussions on Python.org
[quote="Nice Zombies, post:1, topic:66557, username:Nineteendo"] Would anyone be willing to assist? [/quote] Add a developer in residence to the issue. They are paid to help bring PRs to fruition. --- [Visit Topic](https://discuss.python.org/t/help-requested-with-implementing-strict-map/6

[Py] [Core Development] Help requested with implementing strict-map

2024-10-04 Thread Nice Zombies via Discussions on Python.org
The issue is that I don't know who can help me. And pinging Raymond or Brandt again isn't going to change anything. --- [Visit Topic](https://discuss.python.org/t/help-requested-with-implementing-strict-map/66557/3) or reply to this email to respond. You are receiving this because you en

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-12 Thread Alyssa Coghlan via Discussions on Python.org
[quote="Jérôme Pouiller, post:8, topic:67580, full:true, username:jerome-pouiller"] hmm… so the idea is “a python package should never call a binary provided by another package”, that’s it? Yet, I believe it is a common pattern. [/quote] Not quite, as the behaviour you're describing is technic

[Py] [Python Help] Venv: `activate` script changes `$PATH` while executing the binary doesn't

2024-10-11 Thread Clint Hepner via Discussions on Python.org
Your first two examples are equivalent; activating the virtual environment is done primarily to modify `PATH` in exactly the way you do so manually in your second example. What happens when you (try to) execute `west` without modifying your `PATH` variable depends on whether a command named `