Ammar Askar added the comment:
See also: https://bugs.python.org/issue37645 which discusses changing the
string representation of functions to omit the address.
--
nosy: +ammar2
___
Python tracker
<https://bugs.python.org/issue39
Change by Ammar Askar :
--
keywords: +patch
pull_requests: +17542
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18156
___
Python tracker
<https://bugs.python.org/issu
Ammar Askar added the comment:
Duplicate of https://bugs.python.org/issue25478
See Raymond's open PR here: https://github.com/python/cpython/pull/6574
--
nosy: +ammar2
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Consider adding
Change by Ammar Askar :
--
nosy: +vinay.sajip
___
Python tracker
<https://bugs.python.org/issue39407>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ammar Askar :
--
keywords: +patch
pull_requests: +17512
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/18125
___
Python tracker
<https://bugs.python.org/issu
Ammar Askar added the comment:
Oh and I think the new link should point here:
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
--
___
Python tracker
<https://bugs.python.
Ammar Askar added the comment:
Hi Angel, thank you for the report! The file that corresponds to that
documentation is here
https://github.com/python/cpython/blob/master/Doc/library/venv.rst and we'd be
happy to have you make a PR for it :)
--
nosy: +ammar2
Ammar Askar added the comment:
Do you mean to say we should or shouldn't be raising an error? With Inada-san's
change you get this:
>>> json.loads("true", encoding='utf8')
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\ammar\work
Ammar Askar added the comment:
> Installed the readline module as the arrows do not work when running Python
> interactively.
This is not a suggested way to fix the issue, especially given that the module
you installed is marked as deprecated: https://pypi.org/project/readline/
&
Ammar Askar added the comment:
Just for a quick datapoint: llvm/clang do this by default and you need an
explicit `-fsemantic-interposition` to disable it
http://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html
It seems to me that the performance gains here really outweigh any
Ammar Askar added the comment:
Just for reference/existing behavior:
>>> class A(collections.abc.Iterable): pass
...
>>> class B:
... def __iter__(): pass
...
>>> issubclass(B, A)
False
>>> issubclass(B, collections.abc.Iterable)
True
>>>
Ammar Askar added the comment:
That would potentially let an invalid usage slip through, since you know what
you're doing, you can suppress the warning with:
warnings.filterwarnings('ignore', category=SyntaxWarning, message='"is" with
a literal')
--
nos
Ammar Askar added the comment:
The behavior is documented here:
https://docs.python.org/3.9/library/stdtypes.html#numeric-types-int-float-complex
> Numeric literals containing a decimal point or an exponent sign yield
> floating point numbers.
--
nosy: +
Ammar Askar added the comment:
An easier way to understand might be to just write out the generator expression
"manually":
def generator_expression():
for k, v in sorted(self.__dict__.items()):
yield k
return hash(my_generator_expression())
Wou
Change by Ammar Askar :
--
nosy: +rhettinger
___
Python tracker
<https://bugs.python.org/issue38769>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ammar Askar :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue16575>
___
___
Pyth
Change by Ammar Askar :
--
nosy: +gregory.p.smith
___
Python tracker
<https://bugs.python.org/issue38724>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ammar Askar added the comment:
Will close after
https://buildbot.python.org/all/#/builders?tags=%2Brefleak=%2B3.7 go back
to green.
--
___
Python tracker
<https://bugs.python.org/issue16
Ammar Askar added the comment:
I don't think the word "true" is really the issue here. It's the fact that "is"
in this context is ambiguous, is it referring to the English "is" or the python
operator `is`?
--
Ammar Askar added the comment:
I like Steven's "truthy value" or "true value" proposal. Another alternative:
"x does not evaluate to true"
"x does not evaluate to false"
--
nosy: +ammar2
___
Python trac
Change by Ammar Askar :
--
keywords: +patch
pull_requests: +16575
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17066
___
Python tracker
<https://bugs.python.org/issu
Ammar Askar added the comment:
Opened https://github.com/python/cpython/pull/17064 to fix this. Essentially
it's a tiny little oversight in the back-porting. In the 3.7 branch, we perform
an attribute lookup for `from_param` before the union checking code, so we must
remember to DECREF
Change by Ammar Askar :
--
pull_requests: +16572
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/17064
___
Python tracker
<https://bugs.python.org/issu
Ammar Askar added the comment:
Just for some more reference points from "production" python web servers:
* gunicorn - 2048
(https://github.com/benoitc/gunicorn/blob/678b326dc030b450717ec505df69863dcd6fb716/docs/source/settings.rst#backlog)
* tornado - 128
(https://github.com/
Ammar Askar added the comment:
Aah actually I was looking at an older version of the docs, the documentation
now says, "if the address is allocated for private networks" which is actually
misleading. The addresses here aren't all private networks:
https://github.com/python/cp
Ammar Askar added the comment:
The documentation for is_private notes:
Returns:
A boolean, True if the address is reserved per RFC 4193.
iana-ipv4-special-registry or iana-ipv6-special-registry.
If we take a look at the iana-ipv4-special-registry then 0.0.0.0/8 does show up
Ammar Askar added the comment:
The notion of equivalent regular expressions does exist but is way more
complicated than the simple example you described.
For example:
r"a|b" is the same as r"[ab]",
r"^aa*$" is the same as r"^a+$"
Implement
Ammar Askar added the comment:
Closing, here's the bug in dateutil's repo:
https://github.com/dateutil/dateutil/issues/197
--
resolution: -> third party
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bug
Ammar Askar added the comment:
Err...I mean I think this is a dateutil bug rather than in the Python stdlib.
--
___
Python tracker
<https://bugs.python.org/issue38
Ammar Askar added the comment:
It is windows specific, but I don't think this is a dateutil bug rather than
the python stdlib:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or
Ammar Askar added the comment:
This is what I get on master, will try 3.7.5+ as noted in the Github issue:
Python 3.9.0a0 (heads/noopt-dirty:f3b170812d, Oct 1 2019, 20:15:53) [MSC
v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or
Ammar Askar added the comment:
Thank you for the report Matt!
--
nosy: +ammar2
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9
___
Python tracker
<https://bugs.python.or
Change by Ammar Askar :
--
keywords: +patch
pull_requests: +16451
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16919
___
Python tracker
<https://bugs.python.org/issu
Ammar Askar added the comment:
I did a quick search to see what code would break from sys.argv[0] going
relative
intext:"sys.argv[0]" ext:py site:github.com
https://www.google.com/search?q=intext:"sys.argv%5B0%5D"+ext:py+site:github.com
and while most uses of i
Ammar Askar added the comment:
Any updates on this? Some of the re-organization and simplifications here look
pretty good overall and make the guide way more approachable.
Seeing as how this has been sitting a while and Github has an option allow
maintainers to make edits to PRs. Raymond
Ammar Askar added the comment:
If you're trying to get raw bytes, you need to use
print(b'\x80')
what's happening right now is that the '\x80' is treated as a unicode code
point (see https://docs.python.org/3/howto/unicode.html#the-string-type), and
when Python goes to print
Ammar Askar added the comment:
I think the key thing you're missing here is that the set() constructor can
take any arbitrary iterable
(https://docs.python.org/3/library/functions.html#func-set). It simply goes
over all the elements inside and adds them all to the set. This is no different
Change by Ammar Askar :
--
nosy: +skrah, twouters
___
Python tracker
<https://bugs.python.org/issue38318>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ammar Askar added the comment:
Yeah, that parenthesized bit seems a bit weird: co_stacksize really has nothing
to do with the number of variables, it's just that certain opcodes
(https://docs.python.org/3/library/dis.html#python-bytecode-instructions) push
and pop off the stack
Ammar Askar added the comment:
This isn't the ternary form of pow(), the documentation there is referring to
the `pow(base, exp, modulus)`.
--
nosy: +ammar2
___
Python tracker
<https://bugs.python.org/issue38
Ammar Askar added the comment:
> I'd like to help with this, but I don't even know where to start with
> argumentclinic -- any points would be greatly appreciated
Are you asking about argumentclinic in general or something specific to this
bug? If it's something specific feel free to
Ammar Askar added the comment:
Hmm, I can't recreate this locally:
>>> import tempfile
>>> import os
>>> t = tempfile.TemporaryDirectory()
>>> temp_dir = t.name
>>> os.path.exists(temp_dir)
True
>>> del t
>>> os.pa
Change by Ammar Askar :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Ammar Askar added the comment:
For whitespace, the correct way to achieve this using split() with no argument:
>>> print(list("Hello World How Are You?".split()))
['Hello', 'World', 'How', 'Are', 'You?']
>>> print(list("Hello World How Are You?&q
Ammar Askar added the comment:
Check out this part of the FAQ:
https://docs.python.org/3/faq/programming.html#how-do-i-create-a-multidimensional-list
Essentially, when you did `C = 2*[[]]`, what happens is that the SAME empty
list is placed into C[0] and C[1]. Whereas when you do `M
Change by Ammar Askar :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Docs search should prominently show definitions and glossary
items
___
Python tracker
<https://bugs.python
Ammar Askar added the comment:
Hey Vitaly, not sure if you're the author of the original bug here:
https://bugs.python.org/issue27071
Could you re-open that so the discussion is kept in one place.
--
nosy: +ammar2
___
Python tracker
<ht
Change by Ammar Askar :
--
resolution: -> duplicate
stage: -> resolved
superseder: -> unittest.TestCase.assertCountEqual is a very misleading name
type: -> behavior
___
Python tracker
<https://bugs.python
Ammar Askar added the comment:
math.pow changes removed from PR
--
___
Python tracker
<https://bugs.python.org/issue38237>
___
___
Python-bugs-list mailin
Ammar Askar added the comment:
Before
==
>python -m pyperf timeit "pow(2, 3)" --duplicate 10
Mean +- std dev: 242 ns +- 19 ns
> python -m pyperf timeit "pow(2.0, 3.0)" --duplicate 10
Mean +- std dev: 197 ns +- 16 ns
After
=
> python -m pyperf t
Ammar Askar added the comment:
Here's a little microbenchmark, let me know if there's anything specific you'd
like to see:
Before
==
> python -m pyperf timeit "from test.test_builtin import BuiltinTest; tst =
> BuiltinTest()" -- "tst.test_pow()"
Mean +- s
Ammar Askar added the comment:
I've made a PR, feel free to close it if you'd rather implement this yourself
or this proposal won't be accepted :)
--
___
Python tracker
<https://bugs.python.org/issue38
Change by Ammar Askar :
--
keywords: +patch
pull_requests: +15887
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16302
___
Python tracker
<https://bugs.python.org/issu
Ammar Askar added the comment:
Actually quick question, should a similar change be made for `math.pow` for
consistency's sake?
--
___
Python tracker
<https://bugs.python.org/issue38
Ammar Askar added the comment:
Looks like a solid proposal, I especially like the clarity for the 3-argument
call. Often beginners ask about why there's a third argument in pow especially
when teaching RSA and number-theoretic stuff.
Do you mind if I take this on Raymond?
--
nosy
Ammar Askar added the comment:
> Somewhat related, I am responding to this through the bugs.python.org
> interface. If I reply directly to the email the tracker sent me, will my
> reply be properly routed to this thread?
Yes, it will :)
The bug tracker allows replies
Ammar Askar added the comment:
Changing the title a little to represent that this is now a general improvement
of the docs search. Julien is working to upstream a solution into Sphinx that
will allow any items to be featured prominently on search.
--
title: Docs search does
Ammar Askar added the comment:
This is a great point Matt, the documentation search is a bit lacking and we're
kind of using https://bugs.python.org/issue34398 and
https://github.com/python/cpython/pull/8773 to track it.
The current idea that Julien, the docs expert, had is to add some sort
Ammar Askar added the comment:
Thanks for the report Alexandre, this has to do with issues with negative
numbers in Window's time APIs. There's already a bug open for this, so I've
marked it as a duplicate.
--
nosy: +ammar2
resolution: -> duplicate
stage: -> resolved
status
Ammar Askar added the comment:
> What bothers me here is that we apparently changed de facto behavior between
> maintenance releases, in the middle of 3.7's lifecycle, without warning, no
> doubt because we didn't realize it would break third-party packages.
Arguably, I think the
Ammar Askar added the comment:
For the control path warning, that can be fixed by just hinting to the compiler
that the function doesn't return like so:
# ifdef __GNUC__
__attribute__ ((noreturn))
# elif defined(_MSC_VER)
__declspec(noreturn)
# endif
static inline void
Ammar Askar added the comment:
Hmm, I think this might be the following gcc/binutils bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84847
https://sourceware.org/bugzilla/show_bug.cgi?id=20882
This might be a bit of a pain but could you try updating binutils and see if
the problem
Change by Ammar Askar :
--
keywords: +patch
pull_requests: +15844
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16248
___
Python tracker
<https://bugs.python.org/issu
New submission from Ammar Askar :
When dealing with a heap allocated type
(https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_HEAPTYPE /
PyType_FromSpec), if the type has a custom tp_dealloc function then it MUST
decrement the references to the type object itself due to this code block
Ammar Askar added the comment:
Could you provide the output of
gcc --version
and
ld --version
--
nosy: +ammar2
___
Python tracker
<https://bugs.python.org/issue38
Ammar Askar added the comment:
As the error says:
> Can't connect to HTTPS URL because the SSL module is not available.
Since you built it from source, you should check your build logs, the _ssl
module likely failed to build. You're most probably missing the openssl
depende
Change by Ammar Askar :
--
nosy: +eryksun
___
Python tracker
<https://bugs.python.org/issue38188>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ammar Askar :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Ammar Askar added the comment:
When did you try this? For reference, Doc/conf.py on master currently has
`master_doc = 'contents'` and I performed a successful build with Sphinx 2.2.0
a few days ago.
--
nosy: +ammar2
___
Python tracker
<ht
Ammar Askar added the comment:
What version of Sphinx are you using? As far as I know, Sphinx supports
internationalization for autodoc, so this should be possible.
--
nosy: +ammar2
___
Python tracker
<https://bugs.python.org/issue38
Ammar Askar added the comment:
Thanks for the insight Terry.
I think the functions that accept ints as bools are kind of a red herring:
Booleans were only formally introduced in Python 2.3 [1], thus any functions
that existed before that accepted ints and continued to accept ints
Ammar Askar added the comment:
See also https://bugs.python.org/issue34398
There is some related work done by Julien there as well:
https://github.com/JulienPalard/pydocsearch
--
nosy: +ammar2
___
Python tracker
<https://bugs.python.
Ammar Askar added the comment:
Please try this on the latest version of Python, there was a behavior change
implemented in issue12458 that might make this a non-issue.
--
nosy: +ammar2, serhiy.storchaka
___
Python tracker
<https://bugs.python.
Ammar Askar added the comment:
This particular error used to be covered here:
https://github.com/python/cpython/blob/master/Doc/tools/susp-ignored.csv but
looks like a line number change has broken it.
--
nosy: +ammar2
___
Python tracker
<ht
Change by Ammar Askar :
--
pull_requests: +14085
pull_request: https://github.com/python/cpython/pull/14255
___
Python tracker
<https://bugs.python.org/issue29
Ammar Askar added the comment:
Oh whoops, I was looking at my py2 folder. Let's reopen in that case.
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
resolution: not a bug ->
stage: resolved ->
status: closed -> open
title: Python distrib
Ammar Askar added the comment:
LICENSE.txt only contains Python's licensing information. You can find all the
external licenses in
https://docs.python.org/3/license.html?highlight=libffi#libffi
On Windows, this is also distributed as part of Doc/pythonXXX.chm
If you don't think
Change by Ammar Askar :
--
pull_requests: +13854
pull_request: https://github.com/python/cpython/pull/13991
___
Python tracker
<https://bugs.python.org/issue29
Change by Ammar Askar :
--
pull_requests: +13780
pull_request: https://github.com/python/cpython/pull/13907
___
Python tracker
<https://bugs.python.org/issue29
Ammar Askar added the comment:
Thank you, could you also share the output if you just give it the English name
of the counter?
--
___
Python tracker
<https://bugs.python.org/issue36
Ammar Askar added the comment:
What does `typeperf "\System\Processor Queue Length" -si 1` actually return on
your non-English system?
Does it just return an error with the counter's name or is the umalet just in
the first header line, i.e this one for me:
"(PDH-CSV 4.0)
Ammar Askar added the comment:
I can't speak to the complexity of the choices function but if you're proposing
an alternative implementation for choices, it would be wise to show the
benefits empirically. That is, benchmarks and an explanation of why your
implementation would be better than
Ammar Askar added the comment:
Recreatable on master as well, also Martin your suspicion seems correct,
reverting
https://github.com/python/cpython/commit/23db935bcf258657682e66464bf8512def8af830
fixes it.
--
nosy: +ammar2, serhiy.storchaka
stage: -> needs patch
versions: +Pyt
Ammar Askar added the comment:
Aah, I interpreted the combination of the warning and the fact that it says
"attempted first" to mean that any failures in the actual renaming will leave
the new directory in place. That is, no cleanup is ever performed.
A quick glance at the
Ammar Askar added the comment:
Victor is correct, this is a limitation in Windows. As the documentation for
time notes:
>Although this module is always available, not all functions are available on
>all platforms. Most of the functions defined in this module call platform C
&g
Ammar Askar added the comment:
It seems this behavior is somewhat documented:
https://docs.python.org/3/library/os.html#os.renames
>Works like rename(), except creation of any intermediate directories needed to
>make the new pathname good is attempted first.
>This function
Ammar Askar added the comment:
Great job Serhiy, your work on argument clinic has encompassed the previous PR
very well. I've updated it for the changes.
--
___
Python tracker
<https://bugs.python.org/issue34
Ammar Askar added the comment:
Sounds good, I'll take a look at the changes and update the PR accordingly.
--
___
Python tracker
<https://bugs.python.org/issue34
Ammar Askar added the comment:
This change in difference is caused by
https://github.com/python/cpython/commit/e036ef8fa29f27d57fe9f8cef8d931d4122d8223
The old code checked for duplicate arguments by essentially running
`set().intersection(d)` and since `set().intersection
Ammar Askar added the comment:
Iterating over _fields_ and adding up the sizeof() for each type could be one
solution.
--
___
Python tracker
<https://bugs.python.org/issue35
Ammar Askar added the comment:
This has to do with C struct packing and alignment. You are likely on a 64-bit
computer and thus your structs are aligned to 8 byte (64 bit) boundaries.
https://docs.python.org/2/library/ctypes.html#structure-union-alignment-and-byte-order
Create an equivalent
Ammar Askar added the comment:
A good place to start might be to search for a function that says it returns a
borrowed reference in the source tree. For example, "PyImport_AddModule" says
it returns a borrowed reference.
In the search you'll find the relevant file here:
https://
Ammar Askar added the comment:
This is expected behavior, take a look at this section in the tutorial on
classes:
https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables
Unlike say Java, member variables need to be initialized in the constructor.
--
nosy
Ammar Askar added the comment:
Looks like there's an issue already open for this.
--
nosy: +ammar2
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> add support for path-like objects in sys.path
___
Py
Ammar Askar added the comment:
Actually nevermind, disregard that, I was just testing it wrong. I think the
simplest fix here is to add '#' to the list of characters here so we don't
double insert newlines for comments:
https://github.com/python/cpython/blob
Ammar Askar added the comment:
fwiw I think there's more at play here than the newline change. This is the
behavior I get on 3.6.5 (before the newline change is applied). # works as
expected but check out this input:
>>> t.untokenize(tokenize.generate_tokens(io.StringIO('#')
Ammar Askar added the comment:
Looks like this is caused by this line here:
https://github.com/python/cpython/blob/b83d917fafd87e4130f9c7d5209ad2debc7219cd/Lib/tokenize.py#L551-L558
which adds a newline token implicitly after comments. Since the input didn't
terminate with a '\n', the code
Ammar Askar added the comment:
I agree that
urllib.parse.quote("/", safe=['/'])
should probably work. It looks like the reason it doesn't is because quote
tries to normalize the safe iterable to ASCII characters only. As part of this
it attempts to run `< 128` on each el
Ammar Askar added the comment:
Does rewording that prior part to "safe parameter specifies an iterable of
additional ASCII characters" make it less confusing?
--
___
Python tracker
<https://bugs.python.o
Ammar Askar added the comment:
I would say so since the documentation says: safe parameter specifies
additional ASCII characters
None isn't really a set of ASCII characters but the empty string and empty list
are.
--
___
Python tracker
<ht
201 - 300 of 461 matches
Mail list logo