[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2019-10-13 Thread retnikt


Change by retnikt :


--
type:  -> behavior

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



[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2019-10-07 Thread retnikt


retnikt  added the comment:

I can (and will) submit a PR for this, by the way.

--

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



[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2019-10-07 Thread retnikt


New submission from retnikt :

Essentially the same as https://bugs.python.org/issue29581 (more detail is 
there), but for the additional meta-classes enum.EnumMeta and probably 
typing.NamedTupleMeta (discussion needed - is there a use-case for this?)

The __new__ method on these metaclasses should include **kwargs at the end of 
the method definition and pass them on to the super call in order to allow the 
special method __init_subclass__ to be defined with custom parameters on 
classes using the metaclass.

(also, perhaps the issue for typing should be reported separately on github 
python/typing instead)

--
components: Library (Lib)
messages: 354104
nosy: retnikt
priority: normal
severity: normal
status: open
title: __init_subclass__ causes TypeError when used with more standard library 
metaclasses (such as EnumMeta)
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue37717] argparse subcommand docs has non-existent parameter "action"

2019-07-30 Thread retnikt


New submission from retnikt :

In the library documentation for argparse, the section for 
ArgumentParser.add_subparsers ( 
https://docs.python.org/3/library/argparse.html#sub-commands ) states that 
there is a parameter for 'action' with the description 'the basic type of 
action to be taken when this argument is encountered at the command line'. 
However, no such parameter actually exists, and passing it to the function 
causes very strange behaviour:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/argparse.py", line 1716, in add_subparsers
action = parsers_class(option_strings=[], **kwargs)
TypeError: __init__() got an unexpected keyword argument 'parser_class'

This line should be removed from the documentation. It is present in versions 
3.4+ and 2.7

--
assignee: docs@python
components: Documentation
messages: 348718
nosy: docs@python, retnikt
priority: normal
severity: normal
status: open
title: argparse subcommand docs has non-existent parameter "action"
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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