Eric V. Smith added the comment:
Why do you think the first 3 bits should be dropped? That's not the documented
behavior of <<.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.
Eric V. Smith added the comment:
That's not how they're defined. From
https://docs.python.org/3/reference/expressions.html?highlight=left%20shift#shifting-operations
"A right shift by n bits is defined as floor division by pow(2,n). A left shift
by n bits is defined as mult
Eric V. Smith added the comment:
I wouldn't let breaking these tests deter you from improving the output. I
think using "options" is an improvement.
--
___
Python tracker
<https://bugs.py
Eric V. Smith added the comment:
This tracker is for reporting bugs in python. I think you'd have better luck
asking this question on Stack Overflow, or maybe the python-list mailing list:
https://mail.python.org/mailman/listinfo/python-list
--
nosy: +eric.
Eric V. Smith added the comment:
You'd need to return a different class in order to add the
collections.abc.Mapping base class. Currently, dataclasses by design always
return the same class that's passed in.
I'd suggest adding this as a stand-alone decorator.
Eric V. Smith added the comment:
Something like that. You'd have to write some tests and try it out.
--
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
I don't think this belongs in dataclasses itself, at least not until it's been
vetted widely. You might want to put it on PyPI first as a standalone project.
--
___
Python tracker
<https://bu
Eric V. Smith added the comment:
I'm just warning you that I probably won't accept it. I haven't heard of any
demand for this feature.
You might want to bring it up on python-ideas if you want to generate support
for the proposal.
--
___
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue42724>
___
___
Eric V. Smith added the comment:
Do you have a C compiler installed? It's mentioned here
https://devguide.python.org/setup/#unixhttps://devguide.python.org/setup/#unix
I found a number of guides for building Python on Chromebooks via searching. I
don't have any experience, so I
Change by Eric V. Smith :
--
components: +Build -Installation
___
Python tracker
<https://bugs.python.org/issue42753>
___
___
Python-bugs-list mailing list
Unsub
Eric V. Smith added the comment:
Can you describe what this would do? How is it different from
path.is_relative_to(other_path)?
>>> import pathlib
>>> pathlib.Path('/home/Torxed/machine.qcow2').is_relative_to(pathlib.Path('/home/Torxed'
Change by Eric V. Smith :
--
versions: -Python 3.9
___
Python tracker
<https://bugs.python.org/issue42758>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I don't think there's any chance we'd add "in" as an alias for
"is_relative_to()", so I'm going to close this.
If you disagree, you could try and get support on python-ideas, and then we can
re-open this.
Thanks!
-
Eric V. Smith added the comment:
This appears to not be a bug with Python, so I'm going to close this. If you're
having additional build problems, I suggest you ask for help on the python-list
mailing list, or maybe on Stack Overflow.
--
resolution: -> not a bug
stage:
Eric V. Smith added the comment:
The ipaddress documentation references
https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml,
which says that 192.0.0.0/29 is reserved and not globally reachable. I think
in that sense, it's a private ad
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue42765>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
'abcddd'.find('a', start=0) would appear to be allowed from the help text, but
it isn't legal. This is because .find() does not allow keyword arguments.
It looks like find could be documented as
find(self, sub, start=None, end=None
Eric V. Smith added the comment:
Regular division (/) yields a float, so 1 / 1 is 1.0.
https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations
says that for floor division, the arguments are first converted to a common
type, which here would be float.
So, your
Eric V. Smith added the comment:
Oops, my message collided with rhettinger.
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue42788>
___
___
Eric V. Smith added the comment:
I don't think zero padding makes sense. For example:
>>> td = datetime.timedelta(hours=100)
>>> str(td)
'4 days, 4:00:00'
I think '4 days, 04:00:00' would not be very user friendly.
In any event, backward compat
Eric V. Smith added the comment:
Notice that this isn't just for __init__ or return types, it happens with any
annotations (here, with 3.8):
>>> def g(i: None): pass
...
>>> g.__annotations__
{'i': None}
>>> get_type_hints(g)
{'i':
Eric V. Smith added the comment:
See also https://github.com/python/mypy/issues/640 "Support type(None) as a
type", which was closed with "I don't think anyone cares". Jukka's comment was
"Or maybe we should update PEP 484 to not suggest that type(None) i
Eric V. Smith added the comment:
+1 also. I agree with Raymond it should be optional.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue42
Eric V. Smith added the comment:
Even if we wanted to switch to "i" we'd have to continue to also support "j":
there's a ton of existing code that uses it. Since "j" is used by some fields
(including my own) for the imaginary part of complex numbers,
Eric V. Smith added the comment:
As I said in msg385648, I don't think it's feasible.
Maybe I'll write a PEP just to get it rejected so we can point to it when this
discussion comes up, which it does a few times a year.
--
___
Eric V. Smith added the comment:
I don't think it really matters what other languages do. We're not designing
this from scratch. We need to reflect that state we're in, which is many, many
lines of working code using 'j'. I see the two options as: support 'i
Eric V. Smith added the comment:
Good point on surveying other languages for a PEP. You're further along in your
thinking than I am!
--
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
resolution: -> wont fix
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue41459>
___
___
Eric V. Smith added the comment:
I agree with Serhiy: changing TemporaryDirectory.__str__() definitely has
drawbacks.
I assume gitPython is using str() where they might want to use os.fspath().
Maybe tempfile.TemporaryDirectory (and similar) could then support __fspath__.
--
nosy
Eric V. Smith added the comment:
Thanks, Mark. I'll just close it now. I've made a reminder about the PEP, but
not sure when/if I'll get to it.
--
resolution: -> rejected
stage: -> resolved
status: open -> closed
__
Eric V. Smith added the comment:
I think this is pretty clearly the intended semantics. In your first example,
what do you propose "print(x)" would produce? Consider:
if False and (x:=input()) != '':
pass
else:
print(x)
We cannot change the semantics to now call inpu
Eric V. Smith added the comment:
I'm going to close this. The short circuit evaluation of and/or expressions is
already documented, and this behavior follows directly from that.
--
resolution: -> not a bug
stage: -> resolved
status: ope
Eric V. Smith added the comment:
I've been thinking about this some more, and I agree with Terry. Changing str()
seems dangerous, and __fspath__ wouldn't be backwardly compatible. If you want
the name, use .name. So I'm going to close this.
--
resolution: -&
Eric V. Smith added the comment:
Adding an attribute on the __repr__ (and other methods?) signifying that they
were generated would let us distinguish them.
Say, checking getattr(__repr__, '__is_generated__', False), or similar.
--
Eric V. Smith added the comment:
I agree that we need a better pprint. I think it would be easier to create
something new rather than try and morph the existing pprint, but maybe I lack
enough imagination. I'd prefer to use functools.singledispatch instead of a
__pprint__ method, b
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43086>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
That's the correct behavior. The elements given by the start and end range are
replaced by what's on the right hand side of the assignment. They don't need to
be the same length.
>>> list_test=[0,1,2,3,4,5,6]
>>>
Eric V. Smith added the comment:
This isn't a forum for helping users with questions about Python, it's for
reporting bugs in Python.
I suggest you ask this question on the python-list mailing list:
https://mail.python.org/mailman/listinfo/python-list
And when you do ask you
Eric V. Smith added the comment:
I suggest making no change here, except maybe documenting it somewhere.
Removing the filename would make this problem even harder to diagnose. And
adding additional code to an error condition just increases the chance of
something failing. The error
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue43130>
___
___
Eric V. Smith added the comment:
This looks like a numpy usage question, not a python bug. I suggest you ask on
Stackoverflow or a numpy user forum.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
Providing a default value does not imply setting nargs, so you need to specify
both. I think it's not clear what nargs would default to, if you wanted to
change the behavior if default= is supplied.. In your example you probably want
nargs=
Eric V. Smith added the comment:
I agree with @hroncok, and maybe we could tweak the message to say
FileNotFoundError: [Errno 2] No such file or directory: while executing
'./demo'. Maybe bad shebang, or missing file?
Or something to that effect. I realize that listing all poss
Eric V. Smith added the comment:
Would you infer it to be ‘?’ or ‘*’?
I’m not completely opposed, but I haven’t thought it through or looked at the
code.
--
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
If you could demonstrate the problem without numpy, then we could probably help
you here. I don't know much about numpy.
--
___
Python tracker
<https://bugs.python.org/is
Eric V. Smith added the comment:
It's hard to tell because you didn't show the whole program, but this looks
like a mutable default argument problem. Basically you're changing the default
value in a different call to Row().
https://docs.python.org/3/faq/programming.html#
Eric V. Smith added the comment:
Please do not post screen captures. It makes it difficult for users with
accessibility software and it makes it hard for people trying to help you to
copy and paste exactly what you've tried.
I'm unable to duplicate your problem.
[~]$ ps
Eric V. Smith added the comment:
Where did you install Python from?
Before you've activated the virtual env, please run "echo $PATH".
After you've activated the virtual env, can you run "ls -l .venv/bin" and "echo
$PATH"?
--
__
Eric V. Smith added the comment:
Thanks. I’m guessing the space in the path is causing a problem.
--
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
Yes, they're prohibited anywhere inside of the braces {}.
This might be relaxed in the future, but through 3.9 it's still enforced.
--
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue43227>
___
___
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43257>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
I don't think there's a problem with Python here.
The complaint seems to be one or more of:
- The creating software allowed a newline to be in the filename.
- Windows allows the creation of filenames with newlines.
- The Windows UI doesn't h
Change by Eric V. Smith :
--
resolution: -> not a bug
___
Python tracker
<https://bugs.python.org/issue43326>
___
___
Python-bugs-list mailing list
Unsubscrib
Eric V. Smith added the comment:
As a rule we don't try and document every exception that can be raised. I could
go either way on documenting encoding errors with the json module, although it
seems pretty clear that an encoding error would be possible in this case.
--
ass
Eric V. Smith added the comment:
You're going to get more help by posting your question elsewhere. This isn't a
forum where we can help you debug your code: it's for reporting bugs in Python.
You might try https://discuss.python.org/c/users/, or maybe the python-list
mail
Eric V. Smith added the comment:
Can you show the values of “expected” and “actual” for both the failures and
successes?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
Was
def createD(D):
supposed to be:
def createD(d):
?
Not that that changes your problem. I just want to understand the exact issue.
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43
Eric V. Smith added the comment:
I think this is all about: should inspect.signature() resolve string
annotations into actual types (via get_type_hints, or whatever)? I don't use
expect much, so I can't offer an opinion there.
--
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43415>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
New changeset 0554044ddccdb7bf1fa4a8bc880e7a7b59f6479c by Guilherme Martins
Crocetti in branch 'master':
bpo-43415: Fix typo on dataclasses.rst (#24789)
https://github.com/python/cpython/commit/0554044ddccdb7bf1fa4a8bc880e7a
Change by Eric V. Smith :
--
assignee: docs@python -> eric.smith
title: Typo -> Typo in dataclasses documentation
___
Python tracker
<https://bugs.python.org/i
Eric V. Smith added the comment:
New changeset fb3b0310305acdfad7c26705c2ee9a8712a43cf4 by Miss Islington (bot)
in branch '3.9':
bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24790)
https://github.com/python/cpython/commit/fb3b0310305acdfad7c26705c2ee9a
Eric V. Smith added the comment:
New changeset 6d4273356764a3837c914b2aced7a668c534e0be by Miss Islington (bot)
in branch '3.8':
bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24791)
https://github.com/python/cpython/commit/6d4273356764a3837c914b2aced7a6
Eric V. Smith added the comment:
Thanks!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
David:
If you could give us an example showing the inputs, the actual outputs, and how
they differ from what you expect, that would be helpful. Otherwise it's a lot
of guessing on our part.
--
nosy: +eric.
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue43463>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
You're probably missing needed dependencies. For example, see
https://stackoverflow.com/questions/12806122/missing-python-bz2-module
If you look at the output of make, you should be able to see that _bz2 wasn't
built.
--
nosy: +
Eric V. Smith added the comment:
This is almost surely a problem in your environment, and not a bug in python.
This bug tracker is for reporting bugs in python.
I suggest you look for help elsewhere, such as the python-list mailing list
(https://mail.python.org/mailman/listinfo/python-list
Eric V. Smith added the comment:
https://stackoverflow.com/questions/7116889/is-module-file-attribute-absolute-or-relative
and https://bugs.python.org/issue18416 might help explain behavior. I agree
it's working as designed.
--
nosy: +eric.
Eric V. Smith added the comment:
Thanks for the info.
It's weird that this is just showing up for you, and I assume works everywhere
else. How are you invoking the compiler, via make, or something else?
And, what's the gcc command line look like when this specific file fails?
I g
New submission from Eric V. Smith :
https://docs.python.org/3.9/whatsnew/3.9.html#optimizations has this sentence:
"Unlike to the := operator this idiom does not leak a variable to the outer
scope.". I'm not exactly sure what it should be. Probably the first "to
Eric V. Smith added the comment:
Yes, please go ahead.
--
___
Python tracker
<https://bugs.python.org/issue40730>
___
___
Python-bugs-list mailing list
Unsub
Eric V. Smith added the comment:
New changeset 983b17ca1319adf9f06d5f2779a44450241eba54 by Miss Islington (bot)
in branch '3.9':
bpo-40730: Remove redundant 'to' (GH-20316) (GH-20318)
https://github.com/python/cpython/commit/983b17ca1319adf9f06d
Eric V. Smith added the comment:
Thanks, @DahlitzFlorian!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10
___
Python tracker
<https://bugs.python.or
Eric V. Smith added the comment:
That's not what I see:
$ python3.8
Python 3.8.0b4 (default, Sep 15 2019, 15:56:44)
[GCC 7.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> some_dict = {3
Eric V. Smith added the comment:
Thanks for clarifying, Giampaolo. I'll accept this PR once it's cleaned up.
--
___
Python tracker
<https://bugs.python.o
Change by Eric V. Smith :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue40780>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
FWIW, which is probably not much with ".g" formatting, this is how Decimal
behaves:
>>> from decimal import Decimal as D
>>> format(D(1504), '.3g')
'1.50e+3'
>>> format(D(1505), '.3g')
'
Change by Eric V. Smith :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue40780>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric V. Smith added the comment:
For completeness, here's the output using just format, which I prefer over
str.format because there's less going on: it removes all of the str.format
machinery and basically directly calls obj.__format__.
>>> format(1504, '.3g
Eric V. Smith added the comment:
I think I'd just do 3.9 and master. It does seem subtle for a minor release,
when people are less likely to be looking at the release notes.
--
___
Python tracker
<https://bugs.python.org/is
Change by Eric V. Smith :
--
title: str.format() handles trailing zeros inconsistently in “general” format
-> float.__format__() handles trailing zeros inconsistently in “general” format
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
To my knowledge, dataclasses works with `from __future__ import annotations`.
If there are specific examples of problems, I'd like to hear about it: please
open a separate issue.
There is a hack (discussed at PyCon 2018 with all of the relevant pl
Eric V. Smith added the comment:
> Short of outright banning the use of bytes (raise a TypeError), I think
> the current behaviour is least-worst.
I agree.
I'd like to see the TypeError raised for everything that's not a string or
number (since the docs say that's wha
Eric V. Smith added the comment:
Hmm. That's a regression, at least from 3.7, which is the only version I have
ready access to:
$ python3
Python 3.7.3 (default, Mar 27 2019, 13:36:35)
[GCC 9.0.1 20190227 (Red Hat 9.0.1-0.8)] on linux
Type "help", "copyright", "
Eric V. Smith added the comment:
I see. Not sure how I overlooked that. Thanks.
At first blush, I think your approach would work.
--
___
Python tracker
<https://bugs.python.org/issue40
Eric V. Smith added the comment:
Isn't this error that you're providing a field without a default value after
one with a default value?
What's the exception look like?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.pyt
Eric V. Smith added the comment:
No problem!
It can't reorder fields, because you might not be passing them by name. There's
some discussion about requiring keyword-only parameters, in which case what
you're doing would work (as long as they were keyword-only params).
--
New submission from Eric V. Smith :
Currently, the csv library calls str() on each value it writes. This can lead
to surprising behavior, see issue40762 for example.
On the other hand, for writing the documentation says that the values must be
strings or numbers.
The proposed "s
Eric V. Smith added the comment:
I've created issue40825 for adding a "strict" parameter.
--
___
Python tracker
<https://bugs.python.org/issue40762>
___
_
Eric V. Smith added the comment:
For backward compatibility, strict would have to default to False.
--
___
Python tracker
<https://bugs.python.org/issue40
Eric V. Smith added the comment:
I guess an isinstance check against numbers.Number would be the best way to
check if an argument is a number. I'm not sure how convenient that is from C
code.
--
___
Python tracker
<https://bugs.py
Eric V. Smith added the comment:
Losing Decimal would be a problem. I use those a lot in CSV files, and I assume
others do, too.
--
___
Python tracker
<https://bugs.python.org/issue40
Eric V. Smith added the comment:
That seems like a good plan.
--
___
Python tracker
<https://bugs.python.org/issue40825>
___
___
Python-bugs-list mailin
Eric V. Smith added the comment:
I'd prefer a new module just for this. As for names, I like toposort over
topsort.
I already have a library on PyPI named toposort. Personally, I don't have a
problem with the stdlib taking over that name, and I'd just deprecate mine at
3
Eric V. Smith added the comment:
I wouldn't have a problem with isinstance(obj, str) for a string check in
strict mode. If you want to write something like a Path, convert it to a string
yourself. That's exactly the behavior I'd like enforced by strict: only accept
num
Eric V. Smith added the comment:
You should probably bring this up on the python-ideas mailing list.
--
nosy: +eric.smith
type: -> enhancement
versions: +Python 3.10
___
Python tracker
<https://bugs.python.org/issu
Eric V. Smith added the comment:
What type of changes are you proposing to make?
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue40
1001 - 1100 of 2699 matches
Mail list logo