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.
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
@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
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
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
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
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
[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
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
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
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
[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
__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
`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(
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
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
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. *
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
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
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
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
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
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`.
-
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
[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
"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
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
[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
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
[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
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 `
31 matches
Mail list logo