Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...Mapping Center, who conveniently holds an undergraduate degree in Computer Science. He introduced us to the Barrington Atlas, a twelve year undertaking that culminated with the first comprehensive maps of ancient Greek and Roman civilizations to be produced since 1874. The Ancient World Mapping Center is now digitizing all the information contained in this atlas, making the information held within it into an even richer educational tool. The British Isles were selected as the prototype map. Our ...
...map(chr, list): string = string + character return string To both our surprise, f3() clocked twice as fast as f1()! The reason that this surprised us was twofold: first, it uses more storage (the result of map(chr, list) is another list of the same length); second, it contains two loops instead of one (the one implied by the map() function, and the for loop). Of course, space versus time is a well-known trade-off, so the first one shouldn't have surprised...
...MappingProxyType type was added to the types module of Python 3.3. Abstract Add a new frozendict builtin type. Rationale A frozendict is a read-only mapping: a key cannot be added nor removed, and a key is always mapped to the same value. However, frozendict values can be not hashable. A frozendict is hashable if and only if all values are hashable. Use cases: Immutable global variable like a default configuration. Default value of a function parameter. Avoid the issue of mutable default ar...
...map collection would be very challenging because most programs use the contextvars module indirectly. Specification A new public immutable type frozenmap is added to the collections module. Construction frozenmap implements a dict-like construction API: frozenmap() creates a new empty immutable mapping; frozenmap(**kwargs) creates a mapping from **kwargs, e.g. frozenmap(x=10, y=0, z=-1) frozenmap(collection) creates a mapping from the passed collection object. The passed colle...
...map collection would be very challenging because most programs use the contextvars module indirectly. Specification A new public immutable type frozenmap is added to the collections module. Construction frozenmap implements a dict-like construction API: frozenmap() creates a new empty immutable mapping; frozenmap(**kwargs) creates a mapping from **kwargs, e.g. frozenmap(x=10, y=0, z=-1) frozenmap(collection) creates a mapping from the passed collection object. The passed collection object ca...
...mapping iteration methods directly, and instead rely on builtin functions where possible, and some additional helper functions for cases that would be a simple combination of a builtin and a mapping method in pure Python 3 code, but need to be handled slightly differently to get the exact same semantics in Python 2. Static code checkers like pylint could potentially be extended with an optional warning regarding direct use of the mapping iteration methods in a hybrid code base. Mapping iterati...
...mapping: a hidden mapping from variable names to fast local storage offsets. This mapping is lazily initialized on the first frame read or write access through a fast locals proxy, rather than being eagerly populated as soon as the first fast locals proxy is created. Since the mapping is identical for all frames running a given code object, a single copy is stored on the code object, rather than each frame object populating its own mapping locals: the internal frame value cache returned by the P...
...mapping, where being a mapping is defined as its class being one of the following: a class that inherits from collections.abc.Mapping a Python class that has been registered as a collections.abc.Mapping a builtin class that has its Py_TPFLAGS_MAPPING bit set a class that inherits from any of the above (including classes defined before a parent's Mapping registration) The standard library classes dict and mappingproxy will have their Py_TPFLAGS_MAPPING bit set. A mapping pattern succeeds if ev...
...mapping entries are ignored by default) closed_expr is defined above, under value constraints. Abstract syntax: MatchMapping(expr* keys, pattern* patterns) Mapping constraints allow keys and values within a sequence to be checked and values to optionally be extracted. A mapping pattern fails if the subject value is not an instance of collections.abc.Mapping. A mapping pattern succeeds if every key given in the mapping pattern is present in the subject mapping, and the pattern for each key matc...
...map() built- in function: >>> a = (1, 2, 3) >>> b = (4, 5, 6) >>> for i in map(None, a, b): print i ... (1, 4) (2, 5) (3, 6) >>> map(None, a, b) [(1, 4), (2, 5), (3, 6)] The for-loop simply iterates over this list as normal. While the map() idiom is a common one in Python, it has several disadvantages: It is non-obvious to programmers without a functional programming background. The use of the magic None first argument is non-obvious. It has arbitrary, of...
...mappings will be eliminated, leaving only the "new" names. Programmatic Interface Several methods are added to the sys.stdlib_remapper object, which third party packages can use to register their own remappings. Note however that in all cases, there is one and only one mapping from an old name to a new name. If two .mv files contain different mappings for an old name, or if a programmatic call is made with an old name that is already remapped, the previous mapping is lost. This will not aff...
...mappings, **kw): if mappings and isinstance(mappings[0], dict): # If the first argument is a dict, use its type. new = mappings[0].copy() mappings = mappings[1:] else: # No positional arguments, or the first argument is a # sequence of (key, value) pairs. new = dict() for m in mappings: new.update(m) new.update(kw) return new An alternative might be to forgo the arbitrary keywords, and take a single keyword parameter th...
...map .h2 { margin-bottom: 0; line-height: 1.2; } @media (max-width: 479px) { .section-map .h2 { font-size: 16px; } } .section-chart img { border-image-outset: 1.5rem; border: 1.5rem; border-image: radial-gradient(#ffffff, #f9f9f9); margin: 2rem; } @media (min-width: 480px) and (max-width: 768px) { .section-map .h2 { font-size: 18px; } } @media (min-width: 768px) and (max-width: 1024px) { .section-map .h2 { font-size: 20px; } } .map-hol...
...mapping are substituted for the placeholders in the Template. If there are placeholders which are not present in the mapping, a KeyError will be raised. safe_substitute(). This is similar to the substitute() method, except that KeyErrors are never raised (due to placeholders missing from the mapping). When a placeholder is missing, the original placeholder will appear in the resulting string. Here are some examples: >>> from string import Template >>> s = Template('${name}...
...Mappings These abstract classes represent read-only mappings and mutable mappings. The Mapping class represents the most common read-only mapping API. The built-in type dict derives from MutableMapping. Mapping A subclass of Container, Iterable and Sized. The keys of a mapping naturally form a set. The (key, value) pairs (which must be tuples) are also referred to as items. The items also form a set. Methods: .__getitem__(key) Abstract method that returns the value corresponding to key, o...
...mapping" }, "platlib": { "$ref": "#/$defs/mapping" }, "data": { "$ref": "#/$defs/mapping" }, "headers": { "$ref": "#/$defs/mapping" }, "scripts": { "$ref": "#/$defs/mapping" } }, "additionalProperties": true } }, "additionalProperties": true, "$defs": { "mapping": { "type": "object", "description": "A mapping of source to target paths. The source is absolute path, the destination is relative path.", "additionalProperties...
...maps, showing forecast accuracy by geographical area, are then generated for use on the web site and in printed reports. This forecast accuracy map uses intensity of blue and red to indicate the degree of error in predicting temperatures by geographical area ForecastWatch.com's web interface was originally written in PHP but later changed to Python to simplify the toolset and improve integration with the other components of the system. Quixote, a Python web application framework, was selected...
...Mapping Scientific Programming Simulation Weather Engineering Energy Efficiency GIS and Mapping Lighting Marine Simulation Software Development Accessibility Python in The Blind Audio Tactile Mapping System Python and Zope in the EZRO Content Management System Assistive Technologies Python in The Blind Audio Tactile mapping System A Custom Image Viewing Game for an Autistic Child Code Generation Cog: A Code Generation Tool Written in Python Computer Graphics Industrial Light...
...map/unicode.translate The proposed patch will enhance PyUnicode_TranslateCharmap, so that it also supports the callback registry. This has the additional side effect that PyUnicode_TranslateCharmap will support multi-character replacement strings (see SF feature request #403100 [1]). For PyUnicode_TranslateCharmap the exception class will be named UnicodeTranslateError. PyUnicode_TranslateCharmap will collect all consecutive untranslatable characters (i.e. those that map to None) and call the...
...mapping[key] def __contains__(self, key): return key in self._mapping def __len__(self): return len(self._mapping) def __iter__(self): return iter(self._mapping) def set(self, key, value): copy = _ContextData() copy._mapping = self._mapping.copy() copy._mapping[key] = value return copy def delete(self, key): copy = _ContextData() copy._mapping = self._mapping.copy() del copy._mapping[key] ...