[issue31113] Stack overflow with large program

2017-08-06 Thread Manuel Krebber

Manuel Krebber added the comment:

@Serhiy That would require me to compile Python myself though, right? Is there 
a reason why the limit is only for try/for and not for if?

@Antoine Well, the goal is to be able to generate Python 2 compatible code . I 
will try to split the code into more functions and see if that helps...

--

___
Python tracker 
<http://bugs.python.org/issue31113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31113] Stack overflow with large program

2017-08-04 Thread Manuel Krebber

Manuel Krebber added the comment:

I have already tried to reduce the nesting, but it still crashes. I have to 
admit that ~20 levels of nesting are still quite a lot. But I am surprised that 
so few levels of nesting already are a problem for the parser... I have 
attached the generated code with reduced nesting.

--
Added file: http://bugs.python.org/file47058/generated.zip

___
Python tracker 
<http://bugs.python.org/issue31113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31113] Stack overflow with large program

2017-08-03 Thread Manuel Krebber

Manuel Krebber added the comment:

1) Yes.
2) A .pyc file was not generated.
3) It is always the same location where the error occurs.
4) It did not crash on the linux machine that I tested it on.

I have tried to split the code up into multiple files, but it still crashes. I 
have uploaded the file to http://wheerd.de/generated.zip
If you want I can also provide the code with multiple files.

--

___
Python tracker 
<http://bugs.python.org/issue31113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31113] Stack overflow with large program

2017-08-03 Thread Manuel Krebber

New submission from Manuel Krebber:

With a pattern matching library I am generating some Python code that matches 
patterns. For a very big pattern set I generate a Python file which is about 
20MB and has ~300K LOC. When I try to execute the file with Python 3.6.2 on 
Windows 10 (64bit), the interpreter crashes. I do not have the Python source 
locally, but I could get it if necessary. The crash is because of a stack 
overflow when calling dfs() in compile.c. I can attach you the program, but it 
needs some dependencies which currently are only availiable via some Github 
repos.

I will try to split the ig file into multiple smaller ones, but I thought you 
might want to know about an interpreter crash.

--
components: Interpreter Core, Windows
messages: 299689
nosy: Wheerd, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Stack overflow with large program
type: crash
versions: Python 3.6

___
Python tracker 
<http://bugs.python.org/issue31113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29418] inspect.isroutine does not return True for some bound builtin methods

2017-02-02 Thread Manuel Krebber

New submission from Manuel Krebber:

Some of the builtin methods are not recognized as such by inspect.isroutine(). 
inspect.ismethoddescriptor() only returns True for the unbound versions of the 
methods but not the bound ones.

For example:

>>> inspect.isroutine(object.__str__)
True
>>> inspect.isroutine(object().__str__)
False

The second one should also return True as it does for user-defined classes:

>>> class A:
... def f(self):
... pass
>>> inspect.isroutine(A.f)
True
>>> inspect.isroutine(A().f)
True

The types needed for that have already been added to the types module in issue 
#29377. Here is the commit: 
https://github.com/python/cpython/commit/1947d33a0a1c2ba006397579ec6235528faea9fd

--
components: Library (Lib)
messages: 286752
nosy: Wheerd, levkivskyi, yselivanov
priority: normal
severity: normal
status: open
title: inspect.isroutine does not return True for some bound builtin methods
type: behavior

___
Python tracker 
<http://bugs.python.org/issue29418>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-02-01 Thread Manuel Krebber

Manuel Krebber added the comment:

One question I was wondering about is whether those types should be checked by 
inspect.isroutine() as well.

--

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-30 Thread Manuel Krebber

Manuel Krebber added the comment:

Okay, I added MethodDescriptorType to the types module and updated the docs. 
Hope this is okay now.

--
Added file: http://bugs.python.org/file46455/slot-wrapper-types.patch

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

Sorry, I accidentally replied to the worng issue -.-

--

___
Python tracker 
<http://bugs.python.org/issue26355>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

I created the last patch without commiting, so maybe this one will work 
properly with the revision tool.

--
Added file: http://bugs.python.org/file46429/slot-wrapper-types.patch

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Changes by Manuel Krebber :


Removed file: http://bugs.python.org/file46428/slot-wrapper-types.patch

___
Python tracker 
<http://bugs.python.org/issue26355>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

I create the last diff without creating a commit, so maybe this one works 
better.

--
nosy: +Wheerd
Added file: http://bugs.python.org/file46428/slot-wrapper-types.patch

___
Python tracker 
<http://bugs.python.org/issue26355>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Manuel Krebber added the comment:

Alright, I added some tests and tried it again with the patch.

--
Added file: http://bugs.python.org/file46427/slot-wrapper-types.patch

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Manuel Krebber added the comment:

I added some docs, but I am not sure what I would want to test here. There are 
no tests for types.BuiltinMethodType either. Maybe the string representation of 
it could be tested, but an isinstance test seems pretty redundant. I hope this 
patch file works better, I created the last one with git diff.

--
Added file: http://bugs.python.org/file46425/slot-wrapper-types.patch

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Manuel Krebber added the comment:

I would suggest the names SlotWrapperType and MethodWrapperType because I think 
they match their string representations the closest.

For checking whether something is a method/function one could also use 
inspect.isroutine (or inspect.ismethoddescriptor), but that is inconsistent 
with regards to builtin and python methods:

>>> import inspect
>>> inspect.isroutine(object.__init__)
True
>>> inspect.isroutine(object().__init__)
False
>>> class A:
...   def f(self):
... pass
...
>>> inspect.isroutine(A.f)
True
>>> inspect.isroutine(A().f)
True

Maybe a function to detect the second case is needed.

--

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

Changes by Manuel Krebber :


--
keywords: +patch
Added file: 
http://bugs.python.org/file46420/0001-Added-SlotWrapperType-and-MethodWrapperType-to-the-t.patch

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-26 Thread Manuel Krebber

New submission from Manuel Krebber:

There currently is no type in the types module for the slot 
wrappers/wrapper_descriptor types.

I would like to have something like

WrapperDescriptor = type(object.__init__)

added to it (or maybe even add it to MethodType). This would be helpful to 
check more easily if some object is a method.

I can create a pull request for this if desired.

--
components: Library (Lib)
messages: 286304
nosy: Wheerd
priority: normal
severity: normal
status: open
title: Add the 'wrapper_descriptor' type to the types module
type: enhancement

___
Python tracker 
<http://bugs.python.org/issue29377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28773] typing.FrozenSet missing in documentation.

2016-11-22 Thread Manuel Krebber

Manuel Krebber added the comment:

I updated the patch to add reflect the covariance.

--
Added file: http://bugs.python.org/file45606/frozenset-doc.patch

___
Python tracker 
<http://bugs.python.org/issue28773>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28773] typing.FrozenSet missing in documentation.

2016-11-22 Thread Manuel Krebber

New submission from Manuel Krebber:

The typing.FrozenSet is missing in the typing module documentation. I have 
attached a patch that adds it similar to the typing.Set which is already in the 
documentation.

--
components: Library (Lib)
files: frozenset-doc.patch
keywords: patch
messages: 281476
nosy: Wheerd
priority: normal
severity: normal
status: open
title: typing.FrozenSet missing in documentation.
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45601/frozenset-doc.patch

___
Python tracker 
<http://bugs.python.org/issue28773>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28296] Add __le__ and __ge__ to collections.Counter

2016-09-28 Thread Manuel Krebber

Manuel Krebber added the comment:

Oh, I should have searched properly before creating this ticket. Sorry about 
that. I guess I will be subclassing Counter in my project then, to get this 
functionality... Only problem is, that when using the builtin __add__ etc. of 
my Counter subclass, I will get a Counter instance, that does not support 
ordering... So I guess I will not use it at all.

--

___
Python tracker 
<http://bugs.python.org/issue28296>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28296] Add __le__ and __ge__ to collections.Counter

2016-09-28 Thread Manuel Krebber

New submission from Manuel Krebber:

I would really like there to be comparison operators for collection.Counter 
similar to the ones for sets. While you can now use minus to some degree for 
that comparison, it is very inefficient. I have attached an implementation of 
__ge__ and __le__ as a patch. I could also provide the necessary additions to 
the documentation, if that is desired.

--
components: Library (Lib)
files: counter_comparison.patch
keywords: patch
messages: 277597
nosy: Wheerd
priority: normal
severity: normal
status: open
title: Add __le__ and __ge__ to collections.Counter
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44858/counter_comparison.patch

___
Python tracker 
<http://bugs.python.org/issue28296>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com