Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15003] make PyNamespace_New() public

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jun 4, 2012, 7:53 PM

Post #1 of 18 (235 views)
Permalink
[issue15003] make PyNamespace_New() public

New submission from Eric Snow <ericsnowcurrently [at] gmail>:

The type is available as types.SimpleNamespace, and there's no reason to hold PyNamespace_New() back.

----------
components: Library (Lib)
messages: 162322
nosy: amaury.forgeotdarc, eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: make PyNamespace_New() public
type: enhancement
versions: Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 4, 2012, 8:35 PM

Post #2 of 18 (228 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Raymond Hettinger <raymond.hettinger [at] gmail> added the comment:

SimpleNamespaces also need to be picklable.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 4, 2012, 10:40 PM

Post #3 of 18 (229 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

Patch to make PyNamespace_New() public.

----------
keywords: +patch
Added file: http://bugs.python.org/file25827/issue15003_public.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 4, 2012, 11:14 PM

Post #4 of 18 (229 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

I'll get a patch up tomorrow to make the type pickleable.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 5, 2012, 11:35 PM

Post #5 of 18 (224 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

I'll get to a pickle patch as soon as I can. I also need to add a doc addition for PyNamespace_New() to the existing patch.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 6, 2012, 4:27 PM

Post #6 of 18 (224 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

STINNER Victor <victor.stinner [at] gmail> added the comment:

It would be nice to have a minimum documentation :-) What is the kwds parameter? What are attributes of the object?

----------
nosy: +haypo

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 6, 2012, 8:18 PM

Post #7 of 18 (223 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Changes by Eric Snow <ericsnowcurrently [at] gmail>:


Removed file: http://bugs.python.org/file25827/issue15003_public.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 6, 2012, 8:20 PM

Post #8 of 18 (223 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

Where should the docs go for PyNamespace_New()? I looked at what's in Doc/c-api/concrete.rst (concrete.html#other-objects), and each of them points to its own page. Adding a new page for a single function seems a bit too much. :) Would it be bad to put the doc right at the end of concrete.rst? The attached patch does so.

(Also just noticed that PyStructSequence_* is not documented...)

----------
Added file: http://bugs.python.org/file25853/issue15003_public.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 6, 2012, 8:39 PM

Post #9 of 18 (223 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

I've opened issue 15022 for making SimpleNamespace picklable.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 7, 2012, 12:36 AM

Post #10 of 18 (224 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Changes by Eric Snow <ericsnowcurrently [at] gmail>:


----------
stage: needs patch -> patch review

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 9, 2012, 6:46 PM

Post #11 of 18 (225 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

> The type is available as types.SimpleNamespace

(sorry for being OT) Is this documented in whatsnew? Also, I remember a discussion about making it public or not, but don’t recall a decision. I personally find it bad that we have structseqs for most things, dicts in PEP 418 get_clock_info return values, and now simplenamespace for sys.implementation.

----------
nosy: +eric.araujo

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 11, 2012, 8:28 PM

Post #12 of 18 (223 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

> Is this documented in whatsnew?

I'm not sure what has been (none of my patches have done so).

> Also, I remember a discussion about making it public or not, but
> don’t recall a decision.

Amaury brought it up in msg162127. His point was that the type is public in Python, so why not the C API? That's about the extent of the discussion. :) Do you see any harm in making PyNamespace_New() public?

> I personally find it bad that we have structseqs for most things, dicts
> in PEP 418 get_clock_info return values, and now simplenamespace for
> sys.implementation.

The use cases are different for the different types. StructSequence/namedtuple provides fixed data structures for structured records. A dict is essentially the opposite: an un-fixed data structure for dynamic namespaces, making no firm promises as to what the future holds.

SimpleNamespace fills a similar role to dicts, but offers a higher appearance of stability by virtue of using attributes vs. keys. The problem is that moving from item-access to attribute-access is not a backward-compatible change. That's the big reason why PEP 421 specified the use of an attr-based object.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 12, 2012, 6:31 AM

Post #13 of 18 (212 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

>> Is this documented in whatsnew?
> I'm not sure what has been (none of my patches have done so).
Okay; if a committer does not add a note we can open a doc bug to not forget that.

>> Also, I remember a discussion about making it public or not, but
>> don’t recall a decision.
> Amaury brought it up in msg162127. His point was that the type is public in Python, so why not the C API?
Actually I was talking about making it public at all, i.e. in Python too.

> The use cases are different for the different types. StructSequence/namedtuple provides fixed data structures
> for structured records. A dict is essentially the opposite: an un-fixed data structure for dynamic namespaces,
> making no firm promises as to what the future holds.
Right; I just don’t see why the clock info needs to be a dict instead of a structseq or simplenamespace, but maybe it’s explained in the PEP and I missed it. Also it seems to me that the only advantage of simplenamespace over structseqs is that it has no order and can’t be unpacked; I don’t find that a very strong argument (I do see its value, e.g. “major, minor, *etc = sys.version_info” makes sense but we really don’t want to assign order to sys.implementation elements), but I guess this ship has sailed when the implementation was approved.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 23, 2012, 3:48 PM

Post #14 of 18 (200 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Eric Snow <ericsnowcurrently [at] gmail> added the comment:

Here's an updated patch to address the use of _PyNamespace_New() in changeset 77414:0011536f2a06.

----------
Added file: http://bugs.python.org/file26119/issue15003_public.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 23, 2012, 3:48 PM

Post #15 of 18 (200 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Changes by Eric Snow <ericsnowcurrently [at] gmail>:


Removed file: http://bugs.python.org/file25853/issue15003_public.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 24, 2012, 12:23 AM

Post #16 of 18 (198 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

-1. The entire Python API is already accessible from C, so expansions to the public C API need more justification than "it's exposed in Python".

If new instances of this type end up being used in performance critical third party C extensions, then we can have a conversation about whether or not it needs to be exposed directly in C.

----------
nosy: +ncoghlan

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 24, 2012, 12:00 PM

Post #17 of 18 (199 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Mark Shannon <mark [at] hotpy> added the comment:

-1 for the reasons Nick stated.

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 2, 2012, 1:51 PM

Post #18 of 18 (192 views)
Permalink
[issue15003] make PyNamespace_New() public [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

Suggest closing or marking “remind” and see if people use / request / reimplement SimpleNamespace.

----------
versions: +Python 3.4 -Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15003>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.