a segment tree of available features for the current/a given Python interpreter
To reframe the problem (set the subject line), a segment tree of available
features for the current/a given Python interpreter would be useful.
* [ ] this could be e.g. 'features.py' and
* [ ] requested of (new) implementations (with historical data)
* [ ] very simple Python package (python.features ?)
On May 30, 2015 7:54 AM, "Wes Turner"
Would it be useful to have one Python source file with an OrderedDict of (API_feat_lbl, [(start, None)]) mappings and a lookup?
* [ ] feat/version segments/rays map * [ ] .lookup("print[_function]")
Syntax ideas:
* has("print[_function]")
Advantages
* More pythonic to check for features than capabilities * Forward maintainability
Disadvantages:
*
Alternatives:
* six, nine, future * try/import ENOENT
On 30 May 2015 at 23:15, Wes Turner
To reframe the problem (set the subject line), a segment tree of available features for the current/a given Python interpreter would be useful.
* [ ] this could be e.g. 'features.py' and * [ ] requested of (new) implementations (with historical data) * [ ] very simple Python package (python.features ?)
Now I'm even more convinced I'm not following you properly :) Is it perhaps a request for a programmatically queryable version of Ned Batchelder's "What's in which Python?" articles? http://nedbatchelder.com/blog/201109/whats_in_which_python.html http://nedbatchelder.com/blog/201310/whats_in_which_python_3.html If yes, that seems like a reasonable idea, but would likely work better as a community maintained PyPI module, rather than as a standard library module. My rationale for that: * older versions would need support for new feature checks to avoid failing on the feature checker * other implementations could contribute as needed to adjust feature checks that were overly specific to CPython * the community could collectively determine what "features" were sufficiently interesting to be worth tracking through the relevant projects issue tracker, rather than the core development team needing to decide a priori which new features in each release end users are going to want to conditionally adopt If that interpretation of the question is incorrect, then you're going to need to expand more on the problem you're hoping to solve with this suggestion. Regards, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
participants (2)
-
Nick Coghlan
-
Wes Turner