Python-clu

Latest version: v0.8.5

Safety actively analyzes 683530 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 8

0.2.2

Not secure
Other

* Bump version: 0.2.1 → 0.2.2. [Alexander Böhn]

* Fixed unlabeled keyword arg “default” in “slots_for(…)” internals. [Alexander Böhn]

* Tweaked and wrote tests for “clu.predicates.slots_for(…)” [Alexander Böhn]

* New accessors in “clu.predicates” using “inspect.getattr_static(…)” ... Which that function, “getattr_static(…)” retrieves attributes from things without setting off any of the “__getattr__(…)” or “__getattribute__(…)” logic insanity; this means that calling it (or any of my new and improved accessors based on it!!) will get you, like, e.g. a descriptor instance instead of to whatever the call to that instances’ “__get__(…)” method would’ve lead. ... So the new predicate attribute getter function things are all named “stattr(…)”, “stattrs(…)” – just like the versions sans the “st” prefixes (which it’s “st” for “static”, get it??) only the underlying calls use “getattr_static(…)” instead of calling “resolve(…)”… which calls “or_none(…)” which calls “getattr(…)” which calls a bajillion descriptor/class-dict/instance-dict/mro thingamabobs about whose inner workings I am always a bit hazy. ... SO YEAH ENJOY. Also I wrote tests for these, plus I simplified “getitem(…)” and also gave “clu.exporting.ValueDescriptor” a real “__repr__(…)” function for some reason. Yup. [Alexander Böhn]

0.2.1

Not secure
Other

* Bump version: 0.2.0 → 0.2.1. [Alexander Böhn]

* Made the “clu.typespace.namespace.SimpleNamespace” type “hashable” [Alexander Böhn]

0.2.0

Not secure
Other

* Bump version: 0.1.9 → 0.2.0. [Alexander Böhn]

* Clarified the “clu.naming.moduleof(…)” docstring. [Alexander Böhn]

* Ensured “determine_module(…)” will return any specified default value. [Alexander Böhn]

* Clarified the “clu.naming.nameof(…)” docstring. [Alexander Böhn]

* Whitespace. [Alexander Böhn]

0.1.9

Not secure
Add

* Added an actual export to the ExporterBase subclass test. [Alexander Böhn]

* Added a __class_getitem__ method to “clu.exporting.Registry” ... and amended the relevant test accordingly. [Alexander Böhn]

* Added builtin exemplars to REPL env. [Alexander Böhn]

* Added “wheel” to the install requirements. [Alexander Böhn]

* Added “show-consts.py” and “show-modules.py” to the tox run ... I did this on a lark, to see if it would work and planning to revert it immediately – but it is actually really good to have these all print out, particularly in the PyPy environment (and perhaps others to come) which are not as readily inspectable. So these stay in. Yes!! [Alexander Böhn]

* Added pytest markers back in to tox.ini – ... I AM PLEASED TO ANNOUNCE TOX RUNS AND EVERYTHING PASSES! Except a bunch of Windows tests that get skipped. BUT OTHERWISE!!!! [Alexander Böhn]

Other

* Bump version: 0.1.8 → 0.1.9. [Alexander Böhn]

* Whitespace. [Alexander Böhn]

* Made “clu.naming.{name,module}of(…)” truly universal ... to wit: they now search over the space of *all* registered instances of *all* registered subclasses of the base class “clu.exporting.ExporterBase” ... the logic is this: 1) First, try the instances’ attributes (either “__qualname__” or “__name__”, or either “__module__” or “__package__”, depending on what we’re doing). 2) Failing that, look up the name with each “ExporterBase” subclass in the registry, using ‘ExporterSubclass.nameof(…)’ or ‘ExporterSubclass.moduleof(…)’, depending. 3) If the instance isn’t found in any registered subclasses’ instance registry, try searching the system-wide module space using “clu.exporting.search_for_{name,module}(…)” 4) For module searches only, try one last search using the “pickle.whichmodule(…)” function before giving up. ... and you know, all tests pass – so fuck yes! [Alexander Böhn]

* Loading the “{attr,pyattr,item}_across(…)” predicates in the REPL. [Alexander Böhn]

* Fixed prefix in “yodogg” embedded test package. [Alexander Böhn]

* Filtering out class-registry function names in “ExporterBase.__dir__(…)” [Alexander Böhn]

* A little DRY in “clu.exporting” [Alexander Böhn]

* Object-identity comparisons in registered items work in tests. [Alexander Böhn]

* Some cheeky-ass motherfucking shit here. [Alexander Böhn]

* Made “path” a first-class keyword arg of “clu.exporting.ExportBase” [Alexander Böhn]

* Fixed a bug in “clu.fs.pypath.remove_paths(…)” and added some stuff ... namely “clu.fs.pypath.remove_invalid_paths(…)”, which removes anything in “sys.path” that doesn’t point anywhere; ... also added a module-private function “mutate_syspath(…)” used in both “remove_paths(…)” and “remove_invalid_paths(…)” to change the “sys.path” list in-place without randomly reordering it at the time. ... the new function is imported into the REPL environment and also called before the interactive interpreter starts, ensuring that the REPL environments’ “sys.path” is not bullshit in any way. [Alexander Böhn]

* Using “clu.naming.nameof(…)” instead of “clu.exporting.determine_name(…)” ... in “clu.typespace.namespace” [Alexander Böhn]

* One more assert in the ExporterBase subclass test. [Alexander Böhn]

* Extraordinarily minor tweak to docstring. [Alexander Böhn]

* Tweaked custom-subclass Exporter test. [Alexander Böhn]

* Simplified class-keyword logic in “ExporterBase” metaclasses. [Alexander Böhn]

* Avoiding namespace clash with “appnames” method and module-level set instance. [Alexander Böhn]

* Generalized “clu.exporting.PrefixDescriptor” as “ValueDescriptor” [Alexander Böhn]

* Class registry for ExporterBase derived types added. [Alexander Böhn]

* Split up ExportBase’s metaclass into “Slotted” and “Prefix” [Alexander Böhn]

* OCD-ish tweak to “clu.exporting.Prefix.__new__(…)” [Alexander Böhn]

* Moved PrefixDescriptor definition out of Prefix.__new__(…) [Alexander Böhn]

* Say that the new class will be slotted in the “__new__” docstring. [Alexander Böhn]

* Rewrote the “basepath” stuff in “clu.exporting.Exporter” ... using metaclasses. Now users of CLU can use the exporting stuff by creating a trivial subclass of “clu.exporting.ExporterBase” like so: [Alexander Böhn]

class MyExporter(clu.exporting.ExporterBase,
prefix="/my/prefix"):
pass

… so easy, like taking candy from a baby (but far less cruel
and sadistic). Yes!

* ALWAYS DOUBLE-CHECK YOUR PROJECT-WIDE FIND-AND-REPLACE RESULTS ... there can be bogus side-effects that are silly at best (like this one) and devastating at worst – I am sure each and every one of you knows personally what I am talking about exactly. Yep. [Alexander Böhn]

* Renamed all those “thingname_xxx(…)” functions in “clu.exporting” ... also refined “clu.naming.{nameof,moduleof}” – coronating them as the new top-level user-facing interface to finding out what the fuck are the names for shit. Use of “determine_name(…)” was getting a bit creaky – that function was originally written as module-private, for use in the Exporter internals; now, it can basically keep that role (with a few reasonable exceptions) and “nameof(…)” and “moduleof(…)” can take over everywhere outside of the CLU exporting and name-discovery module internal code. ... Yes! [Alexander Böhn]

* “nameof(…)” is a real func instead of a “determine_name(…)” wrapper ... this involved: a) Moving *all* the module-search stuff out of “clu.naming” and into “clu.exporting”; b) Implementing module-search functions within exported modules as “Exporter.nameof(…)” and “Exporter.moduleof(…)” – using the generic “thingname(…)” function brought over from the “clu.naming” module; c) Rewiring “clu.naming.nameof(…)”, and its now-irritatingly incongruently-named cousin “clu.naming.determine_module(…)” to 1) first attempt attribute access, falling back on 2) the new “Exporter” class methods before 3) resorting to “determine_name(…)” or “thingname_search_by_id(…)” (which, at that point, will basically both do the same system-wide module search) – with “determine_module(…)” additionally trying to delegate out to “pickle.whichmodule(…)” before giving up entirely; d) Splitting dotpath elements in “nameof(…)” in case the final result ends up being an unwieldy qualified name e) Updating all the imports and exports and et cetera. [Alexander Böhn]

* More relativity. [Alexander Böhn]

* Relative-izing “path_to_dotpath(…)” to keep it non-CLU-specific. [Alexander Böhn]

* Fixed typo in requirements/dev.txt. [Alexander Böhn]

* Fleshed out the “dev” requirements. [Alexander Böhn]

* Removed irritating Makefile rule to clean up after pytest ... having already dealt with this with fixtures. [Alexander Böhn]

* Cleaned up tox.ini. [Alexander Böhn]

0.1.8

Not secure
Add

* Added “scripts/show-modules.py” showing module-name nondeterminism ... it doesn’t really show all the modules, per se: it iterates over all of them but at the moment it only displays the results in which the results from the two calls “pickle.whichmodule(…)” and “clu.naming.determine_module(…)” are dissimilar. ... also I re-used the same ANSI formatting stuff as I used in the “show-consts.py” script (and they weren’t all that fleshed out, designwise, at any rate) so this thing could use some work. [Alexander Böhn]

* Adding submodule in “tests” for Exporter secondary-package setup. [Alexander Böhn]

* Added a “zict.LRU” buffer atop the ANSI code lookup caches. [Alexander Böhn]

Other

* Bump version: 0.1.7 → 0.1.8. [Alexander Böhn]

* Split off testing requirements into tox.txt. [Alexander Böhn]

* Requiring docopt in requirements/install.txt. [Alexander Böhn]

* I HATE VIRTUALENVS. [Alexander Böhn]

* Tweaking the REPL boostrap script. [Alexander Böhn]

* Shuffled imports in module naming test. [Alexander Böhn]

* Resolved double-export situation with SimpleNamespace and Namespace. [Alexander Böhn]

* Laid down a few pytest markers. [Alexander Böhn]

* Removed “Nondeterminism(…)” exception toss in naming test. [Alexander Böhn]

* Removing the last vestiges of the old xfail constants naming test. [Alexander Böhn]

* EXECUTIVE CALL: you have to import from “clu.constants” subpackages ... MEANING: you can’t do this shit anymore: [Alexander Böhn]

from clu.constants import DEBUG, FilesystemError

... RATHER: you have to specify the subpackage:

from clu.constants.consts import DEBUG
from clu.constants.exceptions import FilesystemError

... if that is annoying well TOO BAD. The source of a certain kind
of nondeterminism in like e.g. “clu.naming.determine_module(…)”
was the fact that these constants (it was always the constants,
as they never have “__module__” or “__package__” properties)
could be found by functions like “thingname_search_by_id(…)” in
TWO SEPARATE AND DISTINCT PLACES. The nondeterminism comes from
that, plus the fact that the module-load order (and thus, the
natural-sort order of “sys.modules”) is itself nondeterministic
fundamentally.

* Reshuffled the stuff in conftest.py. [Alexander Böhn]

* Moved list of XDG environment variables into “clu.constants.data” [Alexander Böhn]

* Repaired and updated the “determine_module(…)” test. [Alexander Böhn]

* It looks like this may solve the “xfail” naming test issue… [Alexander Böhn]

* Normalized the arguments for “clu.naming.nameof(…)” [Alexander Böhn]

* Class methods on “clu.exporting.Exporter” to retrieve modules ... So there are two new class methods: 1) Exporter.modulenames() → returns a list of the names of the Exporter instances in the registry – whose names are those of the module in which they’re ensconced; e.g. 'clu.enums', 'clu.fs.filesystem', etc. 2) Exporter.modules() → returns a dict keyed with the names from “Exporter.modulenames()” and populated with the actual modules these dotted paths indicate; this is done internally with “importlib.import_module(…)”. [Alexander Böhn]

* Converted an outlying ‘%’-style format string to an f-string. [Alexander Böhn]

* Exporting “clu.repl.ansi.evict_announcer(…)” in all the right places. [Alexander Böhn]

0.1.7

Not secure
Add

* Added tests for “clu.naming.dotpath_to_prefix(…)” [Alexander Böhn]

* Added argument checking to “clu.naming.dotpath_to_prefix(…)” [Alexander Böhn]

* Added φ to represent the name of a Partial lambda-type ... which, you may ask, what the fuck does that mean? Allow me to explain: I had originally used a hack (by way of subclassing) to allow the Partial types returned from “apply_to(…)” to be given names and repr-string that matched lambda-type functions – that is to say, functions created with the “lambda” keyword – and in doing so, they’d all be treated the same as lambda-types by the “clu.exporting” mechanisms. This was handy because, as it turned out, “apply_to(…)” Partials were just as useful as typical lambda-type predicates, in like a whooole lot of the kinds of situations we get ourselves into, programmatically, here in the salt-mines of CLU coding. ... The problem arose just now, which while checking out some other recent (but unrelated) updates to the Partial-type structure, I saw that Partial instances retained a value for “__module__” that matched where the Partial class was defined (that is to say, “clu.predicates”) rather than wherever that specific Partial had been instantiated. ... I did not like that. This was due, of course, to the fact that lambda-types are created with a keyword, whereas Partial-types are just dumb ol’ instances, and these things obey different internal Python laws. ... To fix it, the Exporter again came to the rescue. This patch is mainly: a) The addition of the constant φ to represent the default name of the Partial-type – known as the “phi-type” here- after – and all the necessary support for a constant of this sort (it gets referenced in some GREEK_STUFF dict somewhere, etc etc). b) The embellishment of the Exporter’s “export” method to support the φ constant and the phi-type idea – which incedentally results in the “__lambda_name__” attribute actually being useful now, as it retains the naming information germane to what the thing originally was: lambda-type (“<lambda>”) or phi-type (“<Partial>”). c) The necessary tweaks to related functions to consider all of this (like e.g. the clu.typology predicate called “islambda(…)” considers both λ and φ when checking the value of “__lambda_name__”) d) Finally, and most crucially, the addition of logic – again in the Exporter – to alter the attribute value of “__module__” to the correct value whenever it encounters a phi-type in need of name-adjustment. This is doubly interesting (if you asked me) as it is the first use of the “dotpath” attribute the Exporter now sets, as a result of that recent edit wherein all Exporters are now initialized as “Exporter(path=__file__)” – the “path” value is used to compute the dotted module path, and lo, IT SEEMS TO WORK!!!!!!!!!!!!!!! Yeah dogg. [Alexander Böhn]

* Adding the new Directory subclasses to the REPL environment. [Alexander Böhn]

* Added two more Directory shortcut-subclasses in “clu.fs.filesystem” [Alexander Böhn]

* Added “predicate_none(…)” to clu.predicates using “negate(…)” ... also added tests for same and for the recently-added predicate “clu.typology.differentlength(…)” [Alexander Böhn]

* Added “differentlength” to clu.predicates ... this predicate isn’t a simple “negate(…)” of “samelength(…)” – it checks that its arguments are iterable in the same way as “samelength(…)” – so we define it here preemptively because of the fact that its negation is nontrivial. [Alexander Böhn]

* Added scripts/show-consts.py – a prettyprinter for clu.constants ... It’s adapted from the ad-hoc little inline const prettyprinter, “clu.constants.consts.print_all()” with a bunch of my own ANSI formatting sludge on top ... At this point it looks childish, but not too far off the final mark – it’s a weird medium in which to design, can I just say? ... Yeah like I would say 72-74% done, maybe ... Just go ahead, straight up `python scripts/show-consts.py` to execute it… you (meaning anyone besides me) might have to do some freaky PYTHONPATH shit first; I am virtualenv-ing all of this stuff right now but I’ll try and make these sort of things work OK, as like a example-code thing, an “Intro to CLU” type of deal, maybe. [Alexander Böhn]

* Added and filled a fixture graveyard at tests/obsolete_fixtures.py ... contains my spruced-up versions of the pytest-datadir fixture code, like for future reference of someshit I guess. [Alexander Böhn]

* Added a test for “resolve(…)” from clu.predicates. [Alexander Böhn]

* Added in instance checks for “metaclass(…)” tests. [Alexander Böhn]

* Added “iscallable(…)” and “iscallablelist(…)” to clu.typology ... and in so doing also tweaked “isfunction(…)” to return False for class types – all of which are callable – and any arbitrary instances of class types in posession of a `__call__(…)` method …the identification of which is now the domain of the brand-new “iscallable(…)” predicate. NOTE that this means “iscallable(…)” is VERRRRY DIFFERENT from the builtin “callable(…)” predicate, the likes of which is very eager call its operands callable if that is in any way vaguely the case. [Alexander Böhn]

* Adding to the “callable_types” typelist in clu.typology. [Alexander Böhn]

* Added a test for the collator-based accessors. [Alexander Böhn]

* Added “metaclass(…)” predicate and collator-based accessors ... all are found in clu.predicates; ... `metaclass(thing)` will retrieve either a) type(type(thing), b) type(thing), or c) thing, depending on whether “thing” is a metaclass, a class, or an instance. ... There are three new accessors: “attrs(…)”, “pyattrs(…)” and “items(…)”. These are all based on the new “collator(…)” apply- style basis function, which works like the “accessor(…)” and “searcher(…)” functions to apply one simple “getattr(…)”-type function to a thing, using a list of 1+ attribute or item names to compose its result. Unlike the other functions, which return the first viable result from the application list that gets returned, “collator(…)”-based accessors accumulate all results into an ordered tuple for return. WHICH MEANS: these accessors work like so: [Alexander Böhn]

class YoDogg(object):

yo = "Yo dogg,"
dogg = "I heard you like"
iheard = "irritating recursion"

assert attrs(YoDogg, 'yo', 'dogg') == ("Yo Dogg,",
"I heard you like")
assert attrs(YoDogg, 'dogg', 'yo') == ("I heard you like",
"Yo Dogg,")
assert attrs(YoDogg, 'yo', 'wtf') == ("Yo Dogg,",)
assert attrs(YoDogg, 'wtf', 'hax') == None

... I mean and you know the drill by now, “pyattrs(…)” is the same
shit but for __python__ __reserved__ __names__, and “items(…)”
of course is for getting items, like out of dicts and whatnot.

Minutiae

* Minutiae. [Alexander Böhn]

Other

* Bump version: 0.1.6 → 0.1.7. [Alexander Böhn]

* Tests for “clu.exporting.Exporter” instance registry. [Alexander Böhn]

* If a module wasn’t using the Exporter just then, it is now. [Alexander Böhn]

* Instance registry for all “clu.exporting.Exporter” objects. [Alexander Böhn]

* REPL script updates. [Alexander Böhn]

* Combined “path_to_dotpath(…)” and “dotpath_to_prefix(…)” ... and what do we get? why, “path_to_prefix(…)” of course, you doofus goober! ... threw in some quick addenda to the “dotpath_to_prefix(…)” test function to test this new shortcut. [Alexander Böhn]

* Trimmed dead code. [Alexander Böhn]

* F-STRINGS!!! F-STRINGS!!!!!!!!! F-STRINGS!!!!!!!!!!!!!! [Alexander Böhn]

* Rewrote “clu.predicates.getitem(…)” to not use a ‘get()’ function ... now it sticks to basic “__getitem__(…)” and “__contains__(…)” calls, which are fine ... also: started generally replacing the string-interpolate ‘%’ operator with f-strings (yay!!!!!) [Alexander Böhn]

* That empty-string default to “getattr(…)” was bugging me ... in “clu.exporting.Exporter.export(…)”, so I changed it up. [Alexander Böhn]

* Streamlining in the “clu.exporting.Exporter” initializer. [Alexander Böhn]

* Realigning “clu.exporting.Exporter” logic. [Alexander Böhn]

* Allow easy access to a Partial’s function and predicate arguments ... that is, “clu.predicates.Partial”, our custom module-local subclass of “functools.partial” that we use with “apply_to(…)” ... this “Partial” class is only ever returned from “apply_to(…)”; as such, we can kit it out for that purpose – as in this case, where we’ve added some properties for accessing the “function” and “predicate” arguments that were used to initialize this Partial instance. [Alexander Böhn]

* Ensure that copy operations in “clu.fs.filesystem” return booleans. [Alexander Böhn]

* Further simplifying the sequence predicates of “clu.typology” ... instead of manually checking the sequence argument in a lambda definition, we make all of the simple sequence predicates the partial-application result of “predicate_all(predicate)” which basically delegates the sequence argument handling to the “apply_to(…)” internals, which are like way more considerate than any ad-hoc stuff could possibly manage to be ... still, also added “isxtypelist(…)” intermediate (even though there was only one sequence-predicate corner-case that used a call to “istypelist(…)” rather than “issequence(…)” and that has since been redefined using the “predicate_all(…)” trick mentioned above, it’s helpful to look at if you’re thinking about doing something of that sort ... Yeah! Basically. [Alexander Böhn]

* Using an intermediate predicate to simplify the sequence predicates ... that are found in “clu.typology” ... added a “xlist(predicate, thinglist)” lambda, which basically is a shortcut for: [Alexander Böhn]

issequence(thinglist) and predicate_all(predicate, thinglist)

… which was getting to be a boilerplate-y repetetive refrain in
all of those “clu.typology” sequence predicates
... used this new intermediate in “clu.mathematics” just basically
to like kick the tires and soforth

* Simplified “lambda_repr(…)” definition in clu.predicates ... the “pyname(…)” shortcut lambda had been defined, like, a mere eleven LoC north of the offending definition… how embarrasing. [Alexander Böhn]

* Simplified the “predicate_none” test predicate. [Alexander Böhn]

* Importing “operator” in reply-bpython.py. [Alexander Böhn]

* Updated “clu.typology” testsuite function name. [Alexander Böhn]

* Fixed test function name, which was wrong, and needed fixing. [Alexander Böhn]

* Updated some filesystem tests to use the “temporarydir” fixture. [Alexander Böhn]

* Moved the huge greek-text dict to new module “clu.constants.data” ... Which OK yeah I know “data” is a lame-ass name for a module or anything like that – technically they *all* contain data so it is not that descriptive – but I wanted a catch-all junk-drawer module, and so. Yes! [Alexander Böhn]

* Removed dangling import. [Alexander Böhn]

* Trying package scope for the “dirname” fixture ... the latest pytest docs call package-scope “experimental” – so that’s what this is: like that time you drunkenly made out with your sophomore-year roommate and then never really talked about it afterward for like twenty years, I am “experimenting”. [Alexander Böhn]

* Split the “datadir” fixture into two fixtures, one module-scoped ... this way a) you can just get the "test/data" path wrapped in a Directory instance, if you like, and b) that part of all the fixture code only runs once per module, which that in theory might be vaguely faster, one day. [Alexander Böhn]

* Sometimes you have to just do it yourself to do it right ... I mean, no offense to the pytest-datadir author(s), or to the people behind pytest itself – but what the fuck, the datadir plugin has, you know, ONE JOB: mirror a data directory for use at test-function scope. And I mean, it was technically doing that job – but that’s all it was doing; its usage was causing copies of the mirrored directory contents to unceremoniously pile up in a $TMPDIR subfolder (hithertofore unknown to me) called “pytest-of-fish” (because that’s my local username, OK, “fish”)… like one copy every time the fucking testsuite ran. There are like a nontrivial stash of test images in there right now (and that is just like off the bat, it would only have gone up) and I was only using the fixture in like ONE fucking test, imagine had I been more zealous. ... So OK whatever, like I am sure all the other pytest programmers and plugin developers all have gigantic SANs and redundant SSDs in the biggest and storage-capacity-est laptops money can buy, or someshit – I do not, and after dealing with multitudinous secret stashes like e.g. “.pytest_cache” and “.tox” and others, I was not expecting this last heap of data to show up where it did, grow with reckless abandon until “rm -rf”-ed, without any further explanation. ... So! I looked at the fucking plugin and it was like 20 lines of code, in three fixture functions. I copypasta’ed it into clu’s “conftest.py” file, commented it (which like expanded its LoC count by at least 2.5x) and then wrote a new fixture that did what the original code was supposed to do – only a) correctly, b) using my own filesystem abstractions, which are fairly more featureful in a bunch of ways than “pathlib.Path” or othershit … «BRAGGGGG» yes erm ok – but and then c) using `yield` and managed context and assertions, because who the fuck wrote this original shit anyway?? I am sorry guys but your thing had ONE FUCKING JOB and while it technically did do this (like, without shooting uncaught exceptions everywhere or trashing my files, I guess) IT SUCKED. My shit rules, because it works, it’s legible, it’s commented and be-docstring’d and on GitHub – any one can use it of course – and it doesn’t have the ridiculous overblown sense of purpose to be like a whole plugin package and shit. YOURE JUST ANOTHER PART OF ME!! oh wait I shouldn’t be quoting that guy these days, how uncouth, sorry about that. [Alexander Böhn]

* Replaced “allof(…)” helper with “and” operator expressions ... the problem with using “allof(…)” within functional-style compositions is that it does not short-circuit, so you can’t really use it in situations like: [Alexander Böhn]

yodogg = lambda a, b: allof(isiterable(a),
isiterable(b),
set(a).issuperset(set(b)))

… which that looks like it might work, but if either “a” or “b”
is actually not iterable – that is to say, one of the first two
predicates being fed to “allof(…)” evaluates to False – then
the last expression throws a TypeError at the point where it
attempts to initialize a `set` with something non-iterable.

… This lambda should be rewritten like this:

yodogg = lambda a, b: isiterable(a) and \
isiterable(b) and \
set(a).issuperset(set(b))

… Notice how all it takes is a backslash and some indentation
here and there, and no one has to gripe about “waaaah Python
lambdas’re only one line, whyyyyyy” or such shit. Yeah so the
2nd form of the lambda works if you call “yodogg(None, None)” –
that is, assuming returing False from such a call is within the
definition of “works”. Frankly if you *want* exceptions (which
generally I don’t, for normal operations) that is one case in
which lambdas will definitely not assuage your issues, as you
can’t really backslash your way through try/except blocks, I
don’t think. Yep.
... Also in this commit: some miscellaneous import-juggling

* Minor simplification in the clu.exporting.Exporter constructor. [Alexander Böhn]

* Whitespace OCD. [Alexander Böhn]

* Simplified some of the collator tests’ assertions. [Alexander Böhn]

* Renamed “collator” to “acquirer” and rewrote “collator” ... as always this is all found in clu.predicates, my favorite module these days ... “collator” better refered to the operation that got all of the occurrences of something* across all of a list of things (as it is now), rather than the operation to get each occurrence of many somethings from a single thing (which is what “acquirer” now does); I like these names better as they are more apropos, what do you think? [Alexander Böhn]

* Got rid of “unicode” usage in clu.predicates. [Alexander Böhn]

* Exporting some oddly un-exported typelists from clu.typology. [Alexander Böhn]

* Test for “isunique(…)” and “samelength(…)” of clu.typology. [Alexander Böhn]

* I dunno dogg it just reads better this way I think. [Alexander Böhn]

* Rewrote “isunique(¬)” and added “samelength(¬)” in clu.typology. [Alexander Böhn]

* Import ordering OCD. [Alexander Böhn]

* Expanded “apply_to(…)” test to include exception-raising. [Alexander Böhn]

* Amended test function name. [Alexander Böhn]

* Tests for “subclasscheck(…)” and sundry callable-related predicates ... all from clu.typology, in the new typology test suite. [Alexander Böhn]

* Formatting and whitespace. [Alexander Böhn]

* Removed unnecessary call to “maketypelist(…)” in “subclasscheck(…)” ... that would be in clu.typology – in the function definition that is arguably the backbone of that whole module, actually. [Alexander Böhn]

* Finally, started a testcase suite for clu.typology. [Alexander Böhn]

* Trepidaciously starting to use “functools.wraps(…)” in “negate(…)” ... I can’t seem to get it to NOT update the function signature, as is displayed in e.g. bpython above the display of inline __doc__ strings …!? [Alexander Böhn]

* Expanded classtype predicates test to cover “metaclass(…)” [Alexander Böhn]

* Fixed a docstring that was showing the wrong arity. [Alexander Böhn]

* Made “isfunction(…)” – née “ΛΛ(…)” – not use “callable(…)” [Alexander Böhn]

* Using an empty tuple as the collator’s default return value. [Alexander Böhn]

* Exporting “collator(…)” from clu.predicates. [Alexander Böhn]

* Using new collation accessor to build typelists in clu.typology. [Alexander Böhn]

* Whitespace. [Alexander Böhn]

* Fixed SUNDER and DUNDER in clu.enums. [Alexander Böhn]

Whoooooooooops

* Updated an old source notation in clu.typology. [Alexander Böhn]

* Swiped dotpath-attribute resolution function snipped from stdlib ... AND IT JUST WORKS. Tests just pass, everything is just fine. HOW IS THAT POSSIBLE… I am suspicious of course but if that were to be that, how awesome would that be??? Here’s the orig: [Alexander Böhn]

https://docs.python.org/3/library/operator.html#operator.attrgetter

... YEAH!!!

Page 7 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.