text:
June 2008
- 122 participants
- 124 discussions
PEP 1, PEP Purpose and Guidelines
by email@example.com 18 May '21
by firstname.lastname@example.com 18 May '21
18 May '21
It has been a while since I posted a copy of PEP 1 to the mailing lists and newsgroups. I've recently done some updating of a few sections, so in the interest of gaining wider community participation in the Python development process, I'm posting the latest revision of PEP 1 here. A version of the PEP is always available on-line at http://www.python.org/peps/pep-0001.html Enjoy, -Barry -------------------- snip snip -------------------- PEP: 1 Title: PEP Purpose and Guidelines Version: $Revision: 1.36 $ Last-Modified: $Date: 2002/07/29 18:34:59 $ Author: Barry A. Warsaw, Jeremy Hylton Status: Active Type: Informational Created: 13-Jun-2000 Post-History: 21-Mar-2001, 29-Jul-2002 What is a PEP? PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python. The PEP should provide a concise technical specification of the feature and a rationale for the feature. We intend PEPs to be the primary mechanisms for proposing new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. The PEP author is responsible for building consensus within the community and documenting dissenting opinions. Because the PEPs are maintained as plain text files under CVS control, their revision history is the historical record of the feature proposal[1]. Kinds of PEPs There are two kinds of PEPs. A standards track PEP describes a new feature or implementation for Python. An informational PEP describes a Python design issue, or provides general guidelines or information to the Python community, but does not propose a new feature. Informational PEPs do not necessarily represent a Python community consensus or recommendation, so users and implementors are free to ignore informational PEPs or follow their advice. PEP Work Flow The PEP editor, Barry Warsaw <peps(a)python.org>, assigns numbers for each PEP and changes its status. The PEP process begins with a new idea for Python. It is highly recommended that a single PEP contain a single key proposal or new idea. The more focussed the PEP, the more successfully it tends to be. The PEP editor reserves the right to reject PEP proposals if they appear too unfocussed or too broad. If in doubt, split your PEP into several well-focussed ones. Each PEP must have a champion -- someone who writes the PEP using the style and format described below, shepherds the discussions in the appropriate forums, and attempts to build community consensus around the idea. The PEP champion (a.k.a. Author) should first attempt to ascertain whether the idea is PEP-able. Small enhancements or patches often don't need a PEP and can be injected into the Python development work flow with a patch submission to the SourceForge patch manager[2] or feature request tracker[3]. The PEP champion then emails the PEP editor <peps(a)python.org> with a proposed title and a rough, but fleshed out, draft of the PEP. This draft must be written in PEP style as described below. If the PEP editor approves, he will assign the PEP a number, label it as standards track or informational, give it status 'draft', and create and check-in the initial draft of the PEP. The PEP editor will not unreasonably deny a PEP. Reasons for denying PEP status include duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the Python philosophy. The BDFL (Benevolent Dictator for Life, Guido van Rossum) can be consulted during the approval phase, and is the final arbitrator of the draft's PEP-ability. If a pre-PEP is rejected, the author may elect to take the pre-PEP to the comp.lang.python newsgroup (a.k.a. python-list(a)python.org mailing list) to help flesh it out, gain feedback and consensus from the community at large, and improve the PEP for re-submission. The author of the PEP is then responsible for posting the PEP to the community forums, and marshaling community support for it. As updates are necessary, the PEP author can check in new versions if they have CVS commit permissions, or can email new PEP versions to the PEP editor for committing. Standards track PEPs consists of two parts, a design document and a reference implementation. The PEP should be reviewed and accepted before a reference implementation is begun, unless a reference implementation will aid people in studying the PEP. Standards Track PEPs must include an implementation - in the form of code, patch, or URL to same - before it can be considered Final. PEP authors are responsible for collecting community feedback on a PEP before submitting it for review. A PEP that has not been discussed on python-list(a)python.org and/or python-dev(a)python.org will not be accepted. However, wherever possible, long open-ended discussions on public mailing lists should be avoided. Strategies to keep the discussions efficient include, setting up a separate SIG mailing list for the topic, having the PEP author accept private comments in the early design phases, etc. PEP authors should use their discretion here. Once the authors have completed a PEP, they must inform the PEP editor that it is ready for review. PEPs are reviewed by the BDFL and his chosen consultants, who may accept or reject a PEP or send it back to the author(s) for revision. Once a PEP has been accepted, the reference implementation must be completed. When the reference implementation is complete and accepted by the BDFL, the status will be changed to `Final.' A PEP can also be assigned status `Deferred.' The PEP author or editor can assign the PEP this status when no progress is being made on the PEP. Once a PEP is deferred, the PEP editor can re-assign it to draft status. A PEP can also be `Rejected'. Perhaps after all is said and done it was not a good idea. It is still important to have a record of this fact. PEPs can also be replaced by a different PEP, rendering the original obsolete. This is intended for Informational PEPs, where version 2 of an API can replace version 1. PEP work flow is as follows: Draft -> Accepted -> Final -> Replaced ^ +----> Rejected v Deferred Some informational PEPs may also have a status of `Active' if they are never meant to be completed. E.g. PEP 1. What belongs in a successful PEP? Each PEP should have the following parts: 1. Preamble -- RFC822 style headers containing meta-data about the PEP, including the PEP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. 2. Abstract -- a short (~200 word) description of the technical issue being addressed. 3. Copyright/public domain -- Each PEP must either be explicitly labelled as placed in the public domain (see this PEP as an example) or licensed under the Open Publication License[4]. 4. Specification -- The technical specification should describe the syntax and semantics of any new language feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current Python platforms (CPython, JPython, Python .NET). 5. Motivation -- The motivation is critical for PEPs that want to change the Python language. It should clearly explain why the existing language specification is inadequate to address the problem that the PEP solves. PEP submissions without sufficient motivation may be rejected outright. 6. Rationale -- The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. 7. Backwards Compatibility -- All PEPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The PEP must explain how the author proposes to deal with these incompatibilities. PEP submissions without a sufficient backwards compatibility treatise may be rejected outright. 8. Reference Implementation -- The reference implementation must be completed before any PEP is given status 'Final,' but it need not be completed before the PEP is accepted. It is better to finish the specification and rationale first and reach consensus on it before writing code. The final implementation must include test code and documentation appropriate for either the Python language reference or the standard library reference. PEP Template PEPs are written in plain ASCII text, and should adhere to a rigid style. There is a Python script that parses this style and converts the plain text PEP to HTML for viewing on the web[5]. PEP 9 contains a boilerplate[7] template you can use to get started writing your PEP. Each PEP must begin with an RFC822 style header preamble. The headers must appear in the following order. Headers marked with `*' are optional and are described below. All other headers are required. PEP: <pep number> Title: <pep title> Version: <cvs version string> Last-Modified: <cvs date string> Author: <list of authors' real names and optionally, email addrs> * Discussions-To: <email address> Status: <Draft | Active | Accepted | Deferred | Final | Replaced> Type: <Informational | Standards Track> * Requires: <pep numbers> Created: <date created on, in dd-mmm-yyyy format> * Python-Version: <version number> Post-History: <dates of postings to python-list and python-dev> * Replaces: <pep number> * Replaced-By: <pep number> The Author: header lists the names and optionally, the email addresses of all the authors/owners of the PEP. The format of the author entry should be address(a)dom.ain (Random J. User) if the email address is included, and just Random J. User if the address is not given. If there are multiple authors, each should be on a separate line following RFC 822 continuation line conventions. Note that personal email addresses in PEPs will be obscured as a defense against spam harvesters. Standards track PEPs must have a Python-Version: header which indicates the version of Python that the feature will be released with. Informational PEPs do not need a Python-Version: header. While a PEP is in private discussions (usually during the initial Draft phase), a Discussions-To: header will indicate the mailing list or URL where the PEP is being discussed. No Discussions-To: header is necessary if the PEP is being discussed privately with the author, or on the python-list or python-dev email mailing lists. Note that email addresses in the Discussions-To: header will not be obscured. Created: records the date that the PEP was assigned a number, while Post-History: is used to record the dates of when new versions of the PEP are posted to python-list and/or python-dev. Both headers should be in dd-mmm-yyyy format, e.g. 14-Aug-2001. PEPs may have a Requires: header, indicating the PEP numbers that this PEP depends on. PEPs may also have a Replaced-By: header indicating that a PEP has been rendered obsolete by a later document; the value is the number of the PEP that replaces the current document. The newer PEP must have a Replaces: header containing the number of the PEP that it rendered obsolete. PEP Formatting Requirements PEP headings must begin in column zero and the initial letter of each word must be capitalized as in book titles. Acronyms should be in all capitals. The body of each section must be indented 4 spaces. Code samples inside body sections should be indented a further 4 spaces, and other indentation can be used as required to make the text readable. You must use two blank lines between the last line of a section's body and the next section heading. You must adhere to the Emacs convention of adding two spaces at the end of every sentence. You should fill your paragraphs to column 70, but under no circumstances should your lines extend past column 79. If your code samples spill over column 79, you should rewrite them. Tab characters must never appear in the document at all. A PEP should include the standard Emacs stanza included by example at the bottom of this PEP. A PEP must contain a Copyright section, and it is strongly recommended to put the PEP in the public domain. When referencing an external web page in the body of a PEP, you should include the title of the page in the text, with a footnote reference to the URL. Do not include the URL in the body text of the PEP. E.g. Refer to the Python Language web site [1] for more details. ... [1] http://www.python.org When referring to another PEP, include the PEP number in the body text, such as "PEP 1". The title may optionally appear. Add a footnote reference that includes the PEP's title and author. It may optionally include the explicit URL on a separate line, but only in the References section. Note that the pep2html.py script will calculate URLs automatically, e.g.: ... Refer to PEP 1 [7] for more information about PEP style ... References [7] PEP 1, PEP Purpose and Guidelines, Warsaw, Hylton http://www.python.org/peps/pep-0001.html If you decide to provide an explicit URL for a PEP, please use this as the URL template: http://www.python.org/peps/pep-xxxx.html PEP numbers in URLs must be padded with zeros from the left, so as to be exactly 4 characters wide, however PEP numbers in text are never padded. Reporting PEP Bugs, or Submitting PEP Updates How you report a bug, or submit a PEP update depends on several factors, such as the maturity of the PEP, the preferences of the PEP author, and the nature of your comments. For the early draft stages of the PEP, it's probably best to send your comments and changes directly to the PEP author. For more mature, or finished PEPs you may want to submit corrections to the SourceForge bug manager[6] or better yet, the SourceForge patch manager[2] so that your changes don't get lost. If the PEP author is a SF developer, assign the bug/patch to him, otherwise assign it to the PEP editor. When in doubt about where to send your changes, please check first with the PEP author and/or PEP editor. PEP authors who are also SF committers, can update the PEPs themselves by using "cvs commit" to commit their changes. Remember to also push the formatted PEP text out to the web by doing the following: % python pep2html.py -i NUM where NUM is the number of the PEP you want to push out. See % python pep2html.py --help for details. Transferring PEP Ownership It occasionally becomes necessary to transfer ownership of PEPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred PEP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the PEP process, or has fallen off the face of the 'net (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the PEP. We try to build consensus around a PEP, but if that's not possible, you can always submit a competing PEP. If you are interested assuming ownership of a PEP, send a message asking to take over, addressed to both the original author and the PEP editor <peps(a)python.org>. If the original author doesn't respond to email in a timely manner, the PEP editor will make a unilateral decision (it's not like such decisions can be reversed. :). References and Footnotes [1] This historical record is available by the normal CVS commands for retrieving older revisions. For those without direct access to the CVS tree, you can browse the current and past PEP revisions via the SourceForge web site at http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/python/nondist/peps/?cvsroot=… [2] http://sourceforge.net/tracker/?group_id=5470&atid=305470 [3] http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse [4] http://www.opencontent.org/openpub/ [5] The script referred to here is pep2html.py, which lives in the same directory in the CVS tree as the PEPs themselves. Try "pep2html.py --help" for details. The URL for viewing PEPs on the web is http://www.python.org/peps/ [6] http://sourceforge.net/tracker/?group_id=5470&atid=305470 [7] PEP 9, Sample PEP Template http://www.python.org/peps/pep-0009.html Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End:
8 14
pthreads, fork, import, and execvp
by Rotem Yaari 16 Sep '09
by Rotem Yaari 16 Sep '09
16 Sep '09
Hello everyone! We have been encountering several deadlocks in a threaded Python application which calls subprocess.Popen (i.e. fork()) in some of its threads. This has occurred on Python 2.4.1 on a 2.4.27 Linux kernel. Preliminary analysis of the hang shows that the child process blocks upon entering the execvp function, in which the import_lock is acquired due to the following line: def _ execvpe(file, args, env=None): from errno import ENOENT, ENOTDIR ... It is known that when forking from a pthreaded application, acquisition attempts on locks which were already locked by other threads while fork() was called will deadlock. Due to these oddities we were wondering if it would be better to extract the above import line from the execvpe call, to prevent lock acquisition attempts in such cases. Another workaround could be re-assigning a new lock to import_lock (such a thing is done with the global interpreter lock) at PyOS_AfterFork or pthread_atfork. We'd appreciate any opinions you might have on the subject. Thanks in advance, Yair and Rotem
12 29
Re: subprocess and EINTR errnos
by Peter Astrand 06 Jul '09
by Peter Astrand 06 Jul '09
06 Jul '09
On Wed, 10 Nov 2004, John P Speno wrote: Hi, sorry for the delayed response. > While using subprocess (aka popen5), I came across one potential gotcha. I've had > exceptions ending like this: > > File "test.py", line 5, in test > cmd = popen5.Popen(args, stdout=PIPE) > File "popen5.py", line 577, in __init__ > data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB > OSError: [Errno 4] Interrupted system call > > (on Solaris 9) > > Would it make sense for subprocess to use a more robust read() function > which can handle these cases, i.e. when the parent's read on the pipe > to the child's stderr is interrupted by a system call, and returns EINTR? > I imagine it could catch EINTR and EAGAIN and retry the failed read(). I assume you are using signals in your application? The os.read above is not the only system call that can fail with EINTR. subprocess.py is full of other system calls that can fail, and I suspect that many other Python modules are as well. I've made a patch (attached) to subprocess.py (and test_subprocess.py) that should guard against EINTR, but I haven't committed it yet. It's quite large. Are Python modules supposed to handle EINTR? Why not let the C code handle this? Or, perhaps the signal module should provide a sigaction function, so that users can use SA_RESTART. Index: subprocess.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/subprocess.py,v retrieving revision 1.8 diff -u -r1.8 subprocess.py --- subprocess.py 7 Nov 2004 14:30:34 -0000 1.8 +++ subprocess.py 17 Nov 2004 19:42:30 -0000 @@ -888,6 +888,50 @@ pass + def _read_no_intr(self, fd, buffersize): + """Like os.read, but retries on EINTR""" + while True: + try: + return os.read(fd, buffersize) + except OSError, e: + if e.errno == errno.EINTR: + continue + else: + raise + + + def _read_all(self, fd, buffersize): + """Like os.read, but retries on EINTR, and reads until EOF""" + all = "" + while True: + data = self._read_no_intr(fd, buffersize) + all += data + if data == "": + return all + + + def _write_no_intr(self, fd, s): + """Like os.write, but retries on EINTR""" + while True: + try: + return os.write(fd, s) + except OSError, e: + if e.errno == errno.EINTR: + continue + else: + raise + + def _waitpid_no_intr(self, pid, options): + """Like os.waitpid, but retries on EINTR""" + while True: + try: + return os.waitpid(pid, options) + except OSError, e: + if e.errno == errno.EINTR: + continue + else: + raise + def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, @@ -963,7 +1007,7 @@ exc_value, tb) exc_value.child_traceback = ''.join(exc_lines) - os.write(errpipe_write, pickle.dumps(exc_value)) + self._write_no_intr(errpipe_write, pickle.dumps(exc_value)) # This exitcode won't be reported to applications, so it # really doesn't matter what we return. @@ -979,7 +1023,7 @@ os.close(errwrite) # Wait for exec to fail or succeed; possibly raising exception - data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB + data = self._read_all(errpipe_read, 1048576) # Exceptions limited to 1 MB os.close(errpipe_read) if data != "": child_exception = pickle.loads(data) @@ -1003,7 +1047,7 @@ attribute.""" if self.returncode == None: try: - pid, sts = os.waitpid(self.pid, os.WNOHANG) + pid, sts = self._waitpid_no_intr(self.pid, os.WNOHANG) if pid == self.pid: self._handle_exitstatus(sts) except os.error: @@ -1015,7 +1059,7 @@ """Wait for child process to terminate. Returns returncode attribute.""" if self.returncode == None: - pid, sts = os.waitpid(self.pid, 0) + pid, sts = self._waitpid_no_intr(self.pid, 0) self._handle_exitstatus(sts) return self.returncode @@ -1049,27 +1093,33 @@ stderr = [] while read_set or write_set: - rlist, wlist, xlist = select.select(read_set, write_set, []) + try: + rlist, wlist, xlist = select.select(read_set, write_set, []) + except select.error, e: + if e[0] == errno.EINTR: + continue + else: + raise if self.stdin in wlist: # When select has indicated that the file is writable, # we can write up to PIPE_BUF bytes without risk # blocking. POSIX defines PIPE_BUF >= 512 - bytes_written = os.write(self.stdin.fileno(), input[:512]) + bytes_written = self._write_no_intr(self.stdin.fileno(), input[:512]) input = input[bytes_written:] if not input: self.stdin.close() write_set.remove(self.stdin) if self.stdout in rlist: - data = os.read(self.stdout.fileno(), 1024) + data = self._read_no_intr(self.stdout.fileno(), 1024) if data == "": self.stdout.close() read_set.remove(self.stdout) stdout.append(data) if self.stderr in rlist: - data = os.read(self.stderr.fileno(), 1024) + data = self._read_no_intr(self.stderr.fileno(), 1024) if data == "": self.stderr.close() read_set.remove(self.stderr) Index: test/test_subprocess.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_subprocess.py,v retrieving revision 1.14 diff -u -r1.14 test_subprocess.py --- test/test_subprocess.py 12 Nov 2004 15:51:48 -0000 1.14 +++ test/test_subprocess.py 17 Nov 2004 19:42:30 -0000 @@ -7,6 +7,7 @@ import tempfile import time import re +import errno mswindows = (sys.platform == "win32") @@ -35,6 +36,16 @@ fname = tempfile.mktemp() return os.open(fname, os.O_RDWR|os.O_CREAT), fname + def read_no_intr(self, obj): + while True: + try: + return obj.read() + except IOError, e: + if e.errno == errno.EINTR: + continue + else: + raise + # # Generic tests # @@ -123,7 +134,7 @@ p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stdout.write("orange")'], stdout=subprocess.PIPE) - self.assertEqual(p.stdout.read(), "orange") + self.assertEqual(self.read_no_intr(p.stdout), "orange") def test_stdout_filedes(self): # stdout is set to open file descriptor @@ -151,7 +162,7 @@ p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("strawberry")'], stderr=subprocess.PIPE) - self.assertEqual(remove_stderr_debug_decorations(p.stderr.read()), + self.assertEqual(remove_stderr_debug_decorations(self.read_no_intr(p.stderr)), "strawberry") def test_stderr_filedes(self): @@ -186,7 +197,7 @@ 'sys.stderr.write("orange")'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - output = p.stdout.read() + output = self.read_no_intr(p.stdout) stripped = remove_stderr_debug_decorations(output) self.assertEqual(stripped, "appleorange") @@ -220,7 +231,7 @@ stdout=subprocess.PIPE, cwd=tmpdir) normcase = os.path.normcase - self.assertEqual(normcase(p.stdout.read()), normcase(tmpdir)) + self.assertEqual(normcase(self.read_no_intr(p.stdout)), normcase(tmpdir)) def test_env(self): newenv = os.environ.copy() @@ -230,7 +241,7 @@ 'sys.stdout.write(os.getenv("FRUIT"))'], stdout=subprocess.PIPE, env=newenv) - self.assertEqual(p.stdout.read(), "orange") + self.assertEqual(self.read_no_intr(p.stdout), "orange") def test_communicate(self): p = subprocess.Popen([sys.executable, "-c", @@ -305,7 +316,8 @@ 'sys.stdout.write("\\nline6");'], stdout=subprocess.PIPE, universal_newlines=1) - stdout = p.stdout.read() + + stdout = self.read_no_intr(p.stdout) if hasattr(open, 'newlines'): # Interpreter with universal newline support self.assertEqual(stdout, @@ -343,7 +355,7 @@ def test_no_leaking(self): # Make sure we leak no resources - max_handles = 1026 # too much for most UNIX systems + max_handles = 10 # too much for most UNIX systems if mswindows: max_handles = 65 # a full test is too slow on Windows for i in range(max_handles): @@ -424,7 +436,7 @@ 'sys.stdout.write(os.getenv("FRUIT"))'], stdout=subprocess.PIPE, preexec_fn=lambda: os.putenv("FRUIT", "apple")) - self.assertEqual(p.stdout.read(), "apple") + self.assertEqual(self.read_no_intr(p.stdout), "apple") def test_args_string(self): # args is a string @@ -457,7 +469,7 @@ p = subprocess.Popen(["echo $FRUIT"], shell=1, stdout=subprocess.PIPE, env=newenv) - self.assertEqual(p.stdout.read().strip(), "apple") + self.assertEqual(self.read_no_intr(p.stdout).strip(), "apple") def test_shell_string(self): # Run command through the shell (string) @@ -466,7 +478,7 @@ p = subprocess.Popen("echo $FRUIT", shell=1, stdout=subprocess.PIPE, env=newenv) - self.assertEqual(p.stdout.read().strip(), "apple") + self.assertEqual(self.read_no_intr(p.stdout).strip(), "apple") def test_call_string(self): # call() function with string argument on UNIX @@ -525,7 +537,7 @@ p = subprocess.Popen(["set"], shell=1, stdout=subprocess.PIPE, env=newenv) - self.assertNotEqual(p.stdout.read().find("physalis"), -1) + self.assertNotEqual(self.read_no_intr(p.stdout).find("physalis"), -1) def test_shell_string(self): # Run command through the shell (string) @@ -534,7 +546,7 @@ p = subprocess.Popen("set", shell=1, stdout=subprocess.PIPE, env=newenv) - self.assertNotEqual(p.stdout.read().find("physalis"), -1) + self.assertNotEqual(self.read_no_intr(p.stdout).find("physalis"), -1) def test_call_string(self): # call() function with string argument on Windows /Peter Åstrand <astrand(a)lysator.liu.se>
5 5
deprecating BaseException.message
by Brett Cannon 07 Apr '09
by Brett Cannon 07 Apr '09
07 Apr '09
During the PyCon sprint I tried to make BaseException accept only a single argument and bind it to BaseException.message . I was successful (see the p3yk_no_args_on_exc branch), but it was very painful to pull off as anyone who sat around me the last three days of the sprint will tell you as they had to listen to me curse incessantly. Because of the pain that I went through in the transition and thus the lessons learned, Guido and I discussed it and we think it would be best to give up on forcing BaseException to accept only a single argument. I think it is still doable, but requires a multi-release transition period and not the one that 2.6 -> 3.0 is offering. And so Guido and I plan on deprecating BaseException.message as its entire point in existence was to help transition to what we are not going to have happen. =) Now that means BaseException.message might hold the record for shortest lived feature as it was only introduced in 2.5 and is now to be deprecated in 2.6 and removed in 2.7/3.0. =) Below is PEP 352, revised to reflect the removal of BaseException.messageand for letting the 'args' attribute stay (along with suggesting one should only pass a single argument to BaseException). Basically the interface for exceptions doesn't really change in 3.0 except for the removal of __getitem__. -------------------------------------------------------------------------- PEP: 352 Title: Required Superclass for Exceptions Version: $Revision: 53592 $ Last-Modified: $Date: 2007-01-28 21:54:11 -0800 (Sun, 28 Jan 2007) $ Author: Brett Cannon <brett(a)python.org> Guido van Rossum <guido(a)python.org> Status: Final Type: Standards Track Content-Type: text/x-rst Created: 27-Oct-2005 Post-History: Abstract ======== In Python 2.4 and before, any (classic) class can be raised as an exception. The plan for 2.5 was to allow new-style classes, but this makes the problem worse -- it would mean *any* class (or instance) can be raised! This is a problem as it prevents any guarantees from being made about the interface of exceptions. This PEP proposes introducing a new superclass that all raised objects must inherit from. Imposing the restriction will allow a standard interface for exceptions to exist that can be relied upon. It also leads to a known hierarchy for all exceptions to adhere to. One might counter that requiring a specific base class for a particular interface is unPythonic. However, in the specific case of exceptions there's a good reason (which has generally been agreed to on python-dev): requiring hierarchy helps code that wants to *catch* exceptions by making it possible to catch *all* exceptions explicitly by writing ``except BaseException:`` instead of ``except *:``. [#hierarchy-good]_ Introducing a new superclass for exceptions also gives us the chance to rearrange the exception hierarchy slightly for the better. As it currently stands, all exceptions in the built-in namespace inherit from Exception. This is a problem since this includes two exceptions (KeyboardInterrupt and SystemExit) that often need to be excepted from the application's exception handling: the default behavior of shutting the interpreter down without a traceback is usually more desirable than whatever the application might do (with the possible exception of applications that emulate Python's interactive command loop with ``>>>`` prompt). Changing it so that these two exceptions inherit from the common superclass instead of Exception will make it easy for people to write ``except`` clauses that are not overreaching and not catch exceptions that should propagate up. This PEP is based on previous work done for PEP 348 [#pep348]_. Requiring a Common Superclass ============================= This PEP proposes introducing a new exception named BaseException that is a new-style class and has a single attribute, ``args``. Below is the code as the exception will work in Python 3.0 (how it will work in Python 2.x is covered in the `Transition Plan`_ section):: class BaseException(object): """Superclass representing the base of the exception hierarchy. Provides a 'message' attribute that contains either the single argument to the constructor or the empty string. This attribute is used in the string representation for the exception. This is so that it provides the extra details in the traceback. """ def __init__(self, *args): """Set the 'message' attribute'""" self.args = args def __str__(self): """Return the str of 'message'""" if len(self.args) == 1: return str(self.args[0]) else: return str(self.args) def __repr__(self): return "%s(*%s)" % (self.__class__.__name__, repr(self.args)) No restriction is placed upon what may be passed in for ``args`` for backwards-compatibility reasons. In practice, though, only a single string argument should be used. This keeps the string representation of the exception to be a useful message about the exception that is human-readable; this is why the ``__str__`` method special-cases on length-1 ``args`` value. Including programmatic information (e.g., an error code number) should be stored as a separate attribute in a subclass. The ``raise`` statement will be changed to require that any object passed to it must inherit from BaseException. This will make sure that all exceptions fall within a single hierarchy that is anchored at BaseException [#hierarchy-good]_. This also guarantees a basic interface that is inherited from BaseException. The change to ``raise`` will be enforced starting in Python 3.0 (see the `Transition Plan`_ below). With BaseException being the root of the exception hierarchy, Exception will now inherit from it. Exception Hierarchy Changes =========================== With the exception hierarchy now even more important since it has a basic root, a change to the existing hierarchy is called for. As it stands now, if one wants to catch all exceptions that signal an error *and* do not mean the interpreter should be allowed to exit, you must specify all but two exceptions specifically in an ``except`` clause or catch the two exceptions separately and then re-raise them and have all other exceptions fall through to a bare ``except`` clause:: except (KeyboardInterrupt, SystemExit): raise except: ... That is needlessly explicit. This PEP proposes moving KeyboardInterrupt and SystemExit to inherit directly from BaseException. :: - BaseException |- KeyboardInterrupt |- SystemExit |- Exception |- (all other current built-in exceptions) Doing this makes catching Exception more reasonable. It would catch only exceptions that signify errors. Exceptions that signal that the interpreter should exit will not be caught and thus be allowed to propagate up and allow the interpreter to terminate. KeyboardInterrupt has been moved since users typically expect an application to exit when the press the interrupt key (usually Ctrl-C). If people have overly broad ``except`` clauses the expected behaviour does not occur. SystemExit has been moved for similar reasons. Since the exception is raised when ``sys.exit()`` is called the interpreter should normally be allowed to terminate. Unfortunately overly broad ``except`` clauses can prevent the explicitly requested exit from occurring. To make sure that people catch Exception most of the time, various parts of the documentation and tutorials will need to be updated to strongly suggest that Exception be what programmers want to use. Bare ``except`` clauses or catching BaseException directly should be discouraged based on the fact that KeyboardInterrupt and SystemExit almost always should be allowed to propagate up. Transition Plan =============== Since semantic changes to Python are being proposed, a transition plan is needed. The goal is to end up with the new semantics being used in Python 3.0 while providing a smooth transition for 2.x code. All deprecations mentioned in the plan will lead to the removal of the semantics starting in the version following the initial deprecation. Here is BaseException as implemented in the 2.x series:: class BaseException(object): """Superclass representing the base of the exception hierarchy. The __getitem__ method is provided for backwards-compatibility and will be deprecated at some point. """ def __init__(self, *args): """Set the 'args' attribute.""" self.args = args def __str__(self): """Return the str of args[0] or args, depending on length.""" return str(self.args[0] if len(self.args) <= 1 else self.args) def __repr__(self): func_args = repr(self.args) if self.args else "()" return self.__class__.__name__ + func_args def __getitem__(self, index): """Index into arguments passed in during instantiation. Provided for backwards-compatibility and will be deprecated. """ return self.args[index] Deprecation of features in Python 2.9 is optional. This is because it is not known at this time if Python 2.9 (which is slated to be the last version in the 2.x series) will actively deprecate features that will not be in 3.0 . It is conceivable that no deprecation warnings will be used in 2.9 since there could be such a difference between 2.9 and 3.0 that it would make 2.9 too "noisy" in terms of warnings. Thus the proposed deprecation warnings for Python 2.9 will be revisited when development of that version begins to determine if they are still desired. * Python 2.5 [done] - all standard exceptions become new-style classes - introduce BaseException - Exception, KeyboardInterrupt, and SystemExit inherit from BaseException - deprecate raising string exceptions * Python 2.6 - deprecate catching string exceptions - deprecate ``message`` attribute (see `Retracted Ideas`_) * Python 2.7 - deprecate raising exceptions that do not inherit from BaseException - remove ``message`` attribute * Python 2.8 - deprecate catching exceptions that do not inherit from BaseException * Python 2.9 - deprecate ``__getitem__`` (optional) * Python 3.0 [done] - drop everything that was deprecated above: + string exceptions (both raising and catching) + all exceptions must inherit from BaseException + drop ``__getitem__`` Retracted Ideas =============== A previous version of this PEP that was implemented in Python 2.5 included a 'message' attribute on BaseException. Its purpose was to begin a transition to BaseException accepting only a single argument. This was to tighten the interface and to force people to use attributes in subclasses to carry arbitrary information with an exception instead of cramming it all into ``args``. Unfortunately, while implementing the removal of the ``args`` attribute in Python 3.0 at the PyCon 2007 sprint [#pycon2007-sprint-email]_, it was discovered that the transition was very painful, especially for C extension modules. It was decided that it would be better to deprecate the ``message`` attribute in Python 2.6 (and remove in Python 2.7 and Python 3.0) and consider a more long-term transition strategy in Python 3.0 to remove multiple-argument support in BaseException in preference of accepting only a single argument. Thus the introduction of ``message`` and the original deprecation of ``args`` has been retracted. References ========== .. [#pep348] PEP 348 (Exception Reorganization for Python 3.0) http://www.python.org/peps/pep-0348.html .. [#hierarchy-good] python-dev Summary for 2004-08-01 through 2004-08-15 http://www.python.org/dev/summary/2004-08-01_2004-08-15.html#an-exception-i… .. [#SF_1104669] SF patch #1104669 (new-style exceptions) http://www.python.org/sf/1104669 .. [#pycon2007-sprint-email] python-3000 email ("How far to go with cleaning up exceptions") http://mail.python.org/pipermail/python-3000/2007-March/005911.html Copyright ========= This document has been placed in the public domain. .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End:
3 3
Re: [Python-Dev] [Distutils] unicode bug in distutils
by Phillip J. Eby 05 Apr '09
by Phillip J. Eby 05 Apr '09
05 Apr '09
At 02:47 PM 2/24/2007 -0600, Tarek Ziadé wrote: >I have created a setup.py file for distirbution and I bumped into >a small bug when i tried to set my name in the contact field (Tarek Ziadé) > >Using string (utf8 file): > >setup( > maintainer="Tarek Ziadé" >) > >leads to: > > File ".../lib/python2.5/distutils/command/register.py", line 162, in > send_metadata > auth) > File ".../lib/python2.5/distutils/command/register.py", line 257, in > post_to_server > value = unicode(value).encode("utf-8") >UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: >ordinal not in range(128) > > >Using unicode: > >setup( > maintainer=u"Tarek Ziadé" >) > >leads to: > > File ".../lib/python2.5/distutils/dist.py", line 1094, in write_pkg_file > file.write('Author: %s\n' % self.get_contact() ) >UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in >position 18: ordinal not in range(128) > >I would propose a patch for this problem but i don't know what would be >the best input (i guess unicode > for names) At 05:45 PM 2/24/2007 -0500, Tres Seaver wrote: >Don't you still need to tell Python about the encoding of your string >literals [1] [2] ? E.g.:: That's not the problem, it's that the code that writes the PKG-INFO file doesn't handle Unicode. See distutils.dist.DistributionMetadata.write_pkg_info(). It needs to use a file with encoding support, if it's doing unicode However, there's currently no standard, as far as I know, for what encoding the PKG-INFO file should use. Meanwhile, the 'register' command accepts Unicode, but is broken in handling it. Essentially, the problem is that Python 2.5 broke this by adding a unicode *requirement* to the "register" command. Previously, register simply sent whatever you gave it, and the PKG-INFO writing code still does. Unfortunately, this means that there is no longer any one value that you can use for your name that will be accepted by both "register" and anything that writes a PKG-INFO file. Both register and write_pkg_info() are arguably broken here, and should be able to work with either strings or unicode, and degrade gracefully in the event of non-ASCII characters in a string. (Because even though "register" is only run by the package's author, users may run other commands that require a PKG-INFO, so a package prepared using Python <2.5 must still be usable with Python 2.5 distutils, and Python <2.5 allows 8-bit maintainer names.) Unfortunately, this isn't fixable until there's a new 2.5.x release. For previous Python versions, both register and write_pkg_info() accepted 8-bit strings and passed them on as-is, so the only workaround for this issue at the moment is to revert to Python 2.4 or less.
4 5
Python + Java Integration
by Chas Emerick 05 Dec '08
by Chas Emerick 05 Dec '08
05 Dec '08
This may seem like it's coming out of left field for a minute, but bear with me. There is no doubt that Ruby's success is a concern for anyone who sees it as diminishing Python's status. One of the reasons for Ruby's success is certainly the notion (originally advocated by Bruce Tate, if I'm not mistaken) that it is the "next Java" -- the language and environment that mainstream Java developers are, or will, look to as a natural next step. One thing that would help Python in this "debate" (or, perhaps simply put it in the running, at least as a "next Java" candidate) would be if Python had an easier migration path for Java developers that currently rely upon various third-party libraries. The wealth of third-party libraries available for Java has always been one of its great strengths. Ergo, if Python had an easy-to-use, recommended way to use those libraries within the Python environment, that would be a significant advantage to present to Java developers and those who would choose Ruby over Java. Platform compatibility is always a huge motivator for those looking to migrate or upgrade. In that vein, I would point to JPype (http://jpype.sourceforge.net). JPype is a module that gives "python programs full access to java class libraries". My suggestion would be to either: (a) include JPype in the standard library, or barring that, (b) make a very strong push to support JPype (a) might be difficult or cumbersome technically, as JPype does need to build against Java headers, which may or may not be possible given the way that Python is distributed, etc. However, (b) is very feasible. I can't really say what "supporting JPype" means exactly -- maybe GvR and/or other heavyweights in the Python community make public statements regarding its existence and functionality, maybe JPype gets a strong mention or placement on python.org....all those details are obviously not up to me, and I don't know the workings of the "official" Python organizations enough to make serious suggestions. Regardless of the form of support, I think raising people's awareness of JPype and what it adds to the Python environment would be a Good Thing (tm). For our part, we've used JPype to make PDFTextStream (our previously Java-only PDF text extraction library) available and supported for Python. You can read some about it here: http://snowtide.com/PDFTextStream.Python And I've blogged about how PDFTextStream.Python came about, and how we worked with Steve Ménard, the maintainer of JPype, to make it all happen (watch out for this URL wrapping): http://blog.snowtide.com/2006/08/21/working-together-pythonjava-open- sourcecommercial Cheers, Chas Emerick Founder, Snowtide Informatics Systems Enterprise-class PDF content extraction cemerick(a)snowtide.com http://snowtide.com | +1 413.519.6365
3 2
Proposal: add odict to collections
by Armin Ronacher 01 Sep '08
by Armin Ronacher 01 Sep '08
01 Sep '08
Hi, I noticed lately that quite a few projects are implementing their own subclasses of `dict` that retain the order of the key/value pairs. However half of the implementations I came across are not implementing the whole dict interface which leads to weird bugs, also the performance of a Python implementation is not that great. To fight that problem I want to proposed a new class in "collections" called odict which is a dict that keeps the items sorted, similar to a PHP array. The interface would be fully compatible with dict and implemented as dict subclass. Updates to existing keys does not change the order of a key but new keys are inserted at the end. Additionally it would support slicing where a list of key, value tuples is returned and sort/reverse/index methods that work like their list equivalents. Index based lookup could work via odict.byindex(). An implementation of that exists as part of the ordereddict implementation which however goes beyond that and is pretty much a fork of the python dict[1]. Some reasons why ordered dicts are a useful feature: - in XML/HTML processing it's often desired to keep the attributes of an tag ordered during processing. So that input ordering is the same as the output ordering. - Form data transmitted via HTTP is usually ordered by the position of the input/textarea/select field in the HTML document. That information is currently lost in most Python web applications / frameworks. - Eaiser transition of code from Ruby/PHP which have sorted associative arrays / hashmaps. - Having an ordered dict in the standard library would allow other libraries support them. For example a PHP serializer could return odicts rather then dicts which drops the ordering information. XML libraries such as etree could add support for it when creating elements or return attribute dicts. Regards, Armin [1]: http://www.xs4all.nl/~anthon/Python/ordereddict/
28 52
optimization required: .format() is much slower than %
by Christian Heimes 18 Aug '08
by Christian Heimes 18 Aug '08
18 Aug '08
Dear fellow Python developers! Ten minutes ago I raised a concern about speed differences between the old style % formatting and the new .format() code. Some quick benchmarking from Benjamin and me showed, that it's even worse than I expected. $ ./python -m timeit "'%s'.format('nothing')" 100000 loops, best of 3: 2.63 usec per loop $ ./python -m timeit "'%s' % 'nothing'" 10000000 loops, best of 3: 0.188 usec per loop $ ./python -m timeit "'some text with {0}'.format('nothing')" 100000 loops, best of 3: 4.34 usec per loop $ ./python -m timeit "'some text with %s' % 'nothing'" 100000 loops, best of 3: 2.04 usec per loop $ ./python -m timeit "'some text with {0} {1}'.format('nothing', 'more')" 100000 loops, best of 3: 6.77 usec per loop $ ./python -m timeit "'some text with %s %s' % ('nothing', 'more')" 100000 loops, best of 3: 2.22 usec per loop As you can clearly see the new .format() code is *much* slower than the old style % code. I recommend we spend some time on optimizing common code paths of the new .format() code. As first step I propose the move the __format__ method to a new type slot. __format__() is called for every object. My gut feeling says that a slot method is going to speed up the most common usage "{0}".format(some_string). Christian
10 19
Any PEP about 2.6 -> 3000 code transition?
by Jesus Cea 13 Aug '08
by Jesus Cea 13 Aug '08
13 Aug '08
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I can't find any PEP about detailed 2.6 -> 3000 migration guidelines, specially in the module (C code) extension area. Yes, I know about the 2to3 tool, but I'm interested in updating my 2.x code in order to keep (automatic via "2to3") difference between 2.x and 3.x codebase so small as possible. Also, 2to3 doesn't manage migration for C modules. Since I need to port bsddb3 to py3k, what I need to know?. Is any *updated* document out there?. PS: My plan is keep working in the python side under 2.x, and manage Python 3.0 via "2to3", for a long time. In the C side, I plan keeping the same codebase, with conditional compilation. Ideas?. - -- Jesus Cea Avion _/_/ _/_/_/ _/_/_/ jcea(a)jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/ jabber / xmpp:email@example.com _/_/ _/_/ _/_/_/_/_/ ~ _/_/ _/_/ _/_/ _/_/ _/_/ "Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/ "My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/ "El amor es poner tu felicidad en la felicidad de otro" - Leibniz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBSDjqJplgi5GaxT1NAQLP3QP/Y2bWmNzHKsIq23dRz9sxd237TSfzbs5X UzEQ6Ze9Kv1lRXYRfiGjk37aOeiO4xqoKPfASc/WjMN/TmRkUNZxMQEQWwFYhmCA aAVqGxNMEX3KCXvRP9MkkZYLPa9RZg8boPTMYCn+uLDW1Ff2Pwj96hFKbWKG0dkJ RamNp8BFhkM= =ngK+ -----END PGP SIGNATURE-----
17 31
Deprecate parser's "ast" functions?
by Georg Brandl 29 Jul '08
by Georg Brandl 29 Jul '08
29 Jul '08
The parser module exports each function and type twice, once with "AST" in the name, once with "ST". Since "AST" now has a different meaning for Python code compilation, I propose to deprecate the "ast" variants in 2.6 and remove them in Python 3000. (Also, all keyword arguments are called "ast", that cannot change in 2.6 but should in 3.0.) I'm at the moment changing the documentation of parser to only refer to the "st" variants anymore. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
3 2


text:
Essential Photoshop Tools with Sef McCullough
Essential Photoshop Tools
Essential Photoshop Tools with Sef McCullough : Did you know most photographers only use about 20% of the Photoshop Workspace? Don't be held back by what you already know and learn (almost) every tool within Adobe Photoshop with high-end, commercial retoucher, Sef McCullough.
Adobe Photoshop is the world's best imaging and graphic design software for photographers and retouchers. This tutorial is designed to be the ultimate reference guide for anybody who wants to learn Photoshop. Get started by learning the layout of the workspace then follow along as Sef walks through and thoroughly demonstrates each tool in the toolbar. He'll give you suggestions on when to use each tool, when to avoid a tool, and provide little known tips and tricks to make your retouching projects easier.
Even expert retouchers have something to learn from this tutorial! Expand your understanding of destructive versus non-destructive workflows and learn best practices plus shortcuts for using every tools and applying them to your projects.
This tutorial uses Adobe Photoshop CC 2019 20.0.4.
Isn't it time to take the guesswork out of your workflow? Learn how to use Photoshop with The Essential Photoshop Tools Tutorial from PRO EDU.
Welcome to Essential Photoshop Tools with high end retoucher, Sef McCullough. In the training series, follow Sef in learning the most essential tools for your Photoshop retouching workflow.
The Layout
Begin the exploration of Adobe Photoshop by examining how to open a project and explore the main layout of the application. Identify panels, how to customize them, and define their basic functions. Navigate through the tool and option bars, to begin building a foundation for understanding Photoshop's essential tools.
Navigation Tools
To build a solid foundation for understanding Photoshop, explore how to effectively use its navigation tools. Examine the relationship between the hand and zoom tools to quickly move about your images. Practice flick-panning and rotating your view, to create better access during your retouching workflow.
The Move Tool
With a firm grasp of how to navigate around your images, transition into moving an image layer, or selection. Distinguish a background layer from standard layers. Learn how to activate transform controls to enable scale and position adjustments of a selection within your Photoshop project.
Transform Tools
Begin to apply direct transformations and manipulations to your imagery using Photoshop's transform tools. Learn to adjust scale for your images, learning the value and impact of a non-destructive workflow. Apply best practices in working with layers. Follow high end retoucher, Sef McCullough, as he compares and contrasts destructive transformations to an image to the original capture. Practice transform concepts that affect image scale, rotation, skew, distortion, perspective and warp.
Selection Tools
With a global look at viewing, moving around, and manipulating an image, work through a series of examples on creating specific selections within your composition. Compare the marquee and ellipse tools for broad quick selections. Contrast those with the organic control of the lasso tool and geometric precision of the polygon and magnetic lasso tools. Begin to leverage the power of Photoshop's semi automated tools, applying quick selections with the magic wand and quick selections tools.
Automated Selection Tools
With a variety of selection methods in hand, develop an automated selection process for clean, precise, and fast results. Leverage the power of Photoshop using select subject, to quickly isolate exactly what you want with a click of a button. Using color range and focus, apply a strategic method of selection, harnessing the color values and focus areas of your imagery. And for speed and precision, use Photoshop's select and mask capabilities for powerful selection and isolation results.
The Crop Tool
Compare cropping versus scaling an image. Evaluate cropping in a non-destructive workflow. Consider cropping as a means to manage project file sizes. Utilize the straighten tool to correct horizon lines within the constraint of cropping. Leverage the power of content aware, expanding the boundaries of your frame and scaling your image with cropping. Connect your knowledge of the selection tool with the cropping tool.
The Brush Tool
Dive into the native Photoshop paint brush toolset. Learn to adjust color, saturation, hue and brush size. Compare and contrast opacity and flow settings, as well as your ability to control your paint strokes, to refine your command and control of the tool. With a solid foundation for using the paintbrush, explore the native and downloadable brush presets provided by Adobe for creative application to your imagery. Apply a simple brush lighting effect for dynamic and instant results.
The Pen Tool
Follow high end retoucher, Sef McCullough, in a step by step demonstration of using the pen tool to create powerful, dynamic, and precise image masks. Learn to create paths, adjust points in paths, and adjust path settings for more complex workflows. Practice creating a clipping mask using the pen tool to isolate a specific aspect or your imagery. Identify and learn to manage the Paths palette.
Mastering usage of the pen tool is critical in creating effective, high quality masks. In this section, define masking and follow a practical application. Develop your skill in creating high quality clipping masks to isolate and control any creative aspect of an image.
Two Pass Clipping
Create a method of clipping paths that is efficient and maximizes your time during retouching. Form good habits as you learn professional workflow for two pass clipping. Apply a rough and then refined approach to form precise isolations to your images for powerful, effective masking.
Measurement Tools
The measurement tools allow you to create important creative decisions. Learn how to effectively use the eyedropper tool with the sampling ring for color assessment and matching. Utilize the Color Sample tool to get more accurate feedback of color data. Leverage the note tool to leave targeted feedback and reminders on specific areas of your imagery. Utilize rulers and guides to assess symmetry, balance, and spatial relationships within your project elements.
The Clone Stamp Tool
With solid fundamentals around navigation, layer manipulation, and masking, move into one of the key components of a retouchers workflow – the clone stamp tool. Practice retouching imagery focusing on how to duplicate and eliminate elements, with an emphasis on forming good, non-destructive workflow. Learn how to control what areas of an image you sample from to clone and stamp with intention and precision.
The Spot Healing Brush
A foundational component of any retouching work is repair or cleanup of an image. In this section, differentiate the use of the spot healing brush from the clone stamp tool. Practice working with skin cleanup in a portrait image. Leverage the power of Photoshop's ability to interpolate pixel information to create natural, believable results. For more advanced results, practice with the healing brush tool, for better skin texture. Create a bold subject move using the content aware move tool.
The Eraser Tool
Transition to subtractive tools within Photoshop. Focus on the basics of using the eraser tool and how it affects your image data. Practice with more advanced eraser methods, using the background eraser for quick compositing results. For more measured and automated results, use the magic eraser to expedite your compositing workflow. Understand the destructive nature of using eraser tools and how to leverage the history palette to move backwards and forwards through your workflow timeline. Use the power of the history brush to restore elements of an image you have removed.
Blending Tools
Follow high end retoucher, Sef McCullough, as he creatively demonstrates how to use the blur, sharpen, and smudge blending tools. Expand your understanding of destructive versus non-destructive workflow for your retouching workflow. Learn best practices for using these tools when applying them to masks. Develop an approach to using the blend tools for basic compositing.
The Dodge & Burn Tool
Congratulations! You have completed Essential Photoshop Tools with Sef McCullough. In this final section, follow Sef as he defines and demonstrates the process of dodging and burning. Establish intentional retouching process, lightening and darkening the shadows, mid-tones, and highlights or your images to create dimensional and dynamic imagery. By completing this course, you should have a solid foundation for Photoshop's essential tools, with a mindset that establishes good workflow and day to day practice. We encourage you to create and share your work within our community. Thanks and happy retouching!
Watch the Introduction Video :
Direct download links 1.3 GB :
CGArchives Is The Best
Review this tutorial

subset: commoncrawl


text:
Top 15 Laptops Right Now
Everyone is faced with this dilemma of which laptop to get with the amount of technology being churned out daily. The need to be trendy as well as budget consciousness really makes the decision a very hard thought one. You would read reviews, watch YouTube videos, ask friends, check all the online stores and more to try to make the best decision. What we have listed here is in no particular order but we have tried to give you the top 15 laptops taking into consideration price, style and functionality.
Here goes;
Dell XPS 13
|Fifth-generation Intel Core i5 processor. QHD+ (3K) display. Minimal bezel around screen. Less than three pounds. Premium materials and construction.
|Shorter battery life than rivals. Limited port selection. One-year warranty.
|Dell's razor-thin, light, and powerful XPS 13 Touch packs a fast processor, but the 3,200-by-1,800 (QHD+) touch screen is the star of the show in this premium ultrabook.
Asus ZenBook UX305
|Nice price. Quality aluminium build.Sleek design. Solid performance.
|No keyboard back lighting and Ethernet cables
|It is a well-made midrange ultraportable with an aluminium body, a full HD touch screen, good performance and plenty features for the very good price
Toshiba Chromebook 2
|Sharp 1080p IPS display. Snappy Intel Core i3 processor.
|Disappointing battery life in testing. Plastic design feels a bit flashy.
|The Toshiba Chromebook 2 (CB35-C3350) has a high-quality IPS screen and more power than many other Chrome OS-based laptops, but it's also more expensive, and its battery life could be better
13-inch MacBook Air (early 2015)
|Elegant design. Updated Intel Core i5 CPU. More than 17 hours of battery life in testing. No bloatware.
|Lacks HDMI and Ethernet ports. Relatively low-resolution display. Limited storage capacity. Only upgradable at time of order.
|The latest upgrade of the 13-inch Apple MacBook Air brings a more powerful Core i5 processor and an astounding 17.5 hours of battery life. It remains our top choice for ultraportable laptops.
Surface Pro 4
|Sharp, vibrant touch display. Full-friction, adjustable kickstand. Improved Surface Pen and Type Cover from the previous iteration. Strong battery life in testing.
|Pricey. Type Cover sold separately. Still only one USB port.
|The Surface Pro 4 is the best version of Microsoft's tablet yet, with a stellar display, snappy performance, and more than 10 hours of battery life. With Windows 10, the Surface Pen, and optional Type Cover, it can replace your laptop.
Surface Book
|Versatile detachable-hybrid design. Light and comfortable to use in Tablet mode. Constructed of premium materials. Brilliant 3,000-by-2,000-pixel display. Electrically actuated mechanical latch. More than 15 hours of battery life in testing. No bloatware.
|Pricey. No ports on tablet body. Does not lie flat when closed.
|The innovative Microsoft Surface Book offers comfortable ergonomics, a big, beautiful screen, more than 15 hours of battery life, and the power to make short work of everyday and multimedia tasks. It's the first premium detachable-hybrid tablet to earn our 10/10 marks.
Asus Chromebook Flip
|Rockchip RK3288C processor provides impressive performance. Long battery life in testing. Aluminum construction and convertible design. Touch screen.
|Display resolution is lower than that of most other chromebooks.
|The Asus Chromebook Flip (C100PA-DB02) blends the best elements from other designs into a single Chrome-based laptop with a slick, convertible form factor, fast performance, all-day battery life, and an affordable price.
MacBook (2016)
|Gorgeous, thin build. Weighs less than 2 pounds. Retina Display. 11 hours of battery life. Excellent-sounding speakers. Available in four colors including Rose Gold.
|Limited connectivity with a single USB-C port, and no adapters are included. USB-C is not Thunderbolt-compatible. Shallow keyboard and Force Touch trackpad take some getting used to. Internal upgrades can only be made at initial purchase.
|The insanely sleek 12-inch MacBook is still the lightest Apple laptop, but competing Windows laptops have caught up in thinness, weight, and screen quality.
Lenovo Yoga 900
|Innovative multimode hinge. Powerful Intel Core i7 CPU. Almost 11 hours of battery life in our tests. Higher-than-1080p-resolution display. USB-C port. Function key row.
|Screen colors aren't as bright as that of rivals. Connecting to an external display requires a separate USB-C adapter. Clicky trackpad. Fan noise.
|The Lenovo Yoga 900 premium convertible-hybrid laptop is a wonder of engineering, with a complex multimode hinge that lets you use it in a wide variety of positions. Yet it measures just a half-inch thick.
HP Spectre x360
|Slim, stylish design. Smooth geared hinge. Fifth-generation Intel Core i5 processor. All-day battery life. Extra-wide touchpad. Minimal bloatware.
|Full HD resolution is relatively low.
|The HP Spectre x360 13t midrange convertible-hybrid laptop combines premium, all-metal construction, a refined portable design, and solid performance that matches that of more expensive systems.
Asus transformer
|Low price. Strong performance and good battery life in testing. 64-bit operating system. Attractive In-Plane Switching (IPS) display. USB Type-C ports. Dual-band Wi-Fi.
|Top-heavy design when docked. Finicky docking system. Front- and rear-facing cameras are mediocre. Short on storage.
|The Asus Transformer Book T100HA is an impressive detachable-hybrid tablet, boasting a wide variety of features, fast performance, a sharp display, and good battery life at a very affordable price.
MacBook Pro 13-inch with Retina display (early 2015)
|Brilliant higher-than-1080p-resolution Retina screen. Two Thunderbolt 2 ports. 16GB of system memory is standard. Comes with iLife and iWork software suites. More than 11 hours of battery life in testing.
|Competitors have 4K screens. Glossy display, with no matte option. 256GB storage is light. Ethernet requires adapter. No USB-C port.
|The latest Apple MacBook Pro 15-inch with Retina display gets a Force Touch trackpad and better battery capacity than its predecessor, but it faces stiff competition.
HP Spectre x2
|In-Plane Switching (IPS) screen with higher-than-1080p resolution. Two USB-C ports. 4G LTE radio. 9 hours of battery life in testing. Comes with backlit keyboard case that's rigid for easy lap typing.
|No HDMI or USB 3.0 ports. Woefully soft speakers.
|With its sturdy detachable keyboard, high-resolution screen, and built-in 4G LTE capability, the HP Spectre x2 slate tablet comes close to being a practical replacement for your laptop.
Dell Latitude 13 7000
|Keyboard dock has a good selection of ports, and a battery that provides 10 hours of life. Backlit keyboard. No bloatware. Three-year warranty.
|No I/O ports on tablet.
|The Dell Latitude 13 7000 Series 2-in-1 (7350) detachable-hybrid tablet is a great middle ground between a slim tablet and a clamshell laptop.
Dell Inspiron 13 7000
|Sharp detail from IPS screen. Speedy Core i7 processor and solid-state drive (SSD). Minimal bloatware.
|A little bulky as a tablet. USB 2.0 and 3.0 ports are the same color.
|The Dell Inspiron 13 7000 Series 2-in-1 Special Edition (7352) has premium features, like a fifth-generation Core i7 processor, sharp In-Plane Switching (IPS) screen, and an aluminum palm rest, which help the system stand out in an increasingly crowded field of convertible-hybrid laptops.
You can get these laptops anywhere in Nigeria from the SME Market Hub- https://www.smemarkethub.com/products/electronics-computers/laptops-tablets/?&page=1
Comments are closed.


text:
The Internal Revenue Service's national headquarters in Washington, D.C.—a hulking New Deal-era monstrosity that's ironically located on Constitution Avenue—has U.S. Supreme Court Justice Oliver Wendell Holmes' oft-repeated words carved on the exterior facade: "Taxes are the price we pay for a civilized society."
Yet there's nothing particularly civilized about the IRS—the nation's heavy-handed, incompetent and scandal-plagued tax-collection agency. The building's columns and detailing echo the French Renaissance style, but behind the façade the IRS' inspiration is more aligned with Robespierre given the terror its agents inflict on American citizens.
The IRS' current authority goes well beyond our founding document's simple language granting Congress the power to levy taxes on behalf of the common defense and the nation's general welfare. The agency already has 80,000 employees and an enforcement budget larger than the general-fund budgets of a dozen U.S. states.
In its zeal to wrangle more change out of American taxpayers' and businesses' pockets, the Biden administration wants to beef up that budget and its auditing staff. Senate Majority Leader Chuck Schumer (D–N.Y.) and Joe Manchin (D–W.Va.), the supposed moderate, recently hammered out a deal to pass the oddly named Inflation Reduction Act.
Expecting a $ 739-billion spending bill to reduce inflation is like expecting a tanker of gasoline to douse a fire, but that's the least of our problems. The measure proposes to provide an additional $ 80 billion to the IRS—boosting its budget six times and doubling the number of federal revenue officers.
As The Wall Street Journal noted, "The bill earmarks $ 45.6 billion for 'enforcement,' including 'litigation,' 'criminal investigations,' 'investigative technology, 'digital asset monitoring' and a new fleet of tax-collector cars." This cash infusion is so obscene the IRS will struggle to spend it all—but ultimately it means 80,000 new IRS officials will be breathing down our necks.
The president and his fellow Democrats claim this is simply about targeting multi-millionaires and billionaires and forcing them to pay their fair share, but, per the Journal, Congress itself reports "78 percent to 90 percent of the money raised from under-reported income would likely come from those making less than $ 200,000 a year."
The administration claims the bill will reduce the deficit by $ 102 billion over 10 years. Even if true (and don't bet on it), the federal budget tops $ 6 trillion. The federal deficit has fallen since 2020 as pandemic spending has subsided, but remains at $ 1 trillion. Federal debt is pushing $ 31 trillion. Government's insatiable spending is the problem. It won't be fixed by shaking down Americans for more cash.
Sorry, but "shaking down" is the correct term. This legislation isn't primarily about gathering more money, but about taking the reins off of an already inefficient and abusive agency. Let's set aside the IRS' scandals—allegations of its officials using audits to target political enemies, possible leaks of confidential information, and other nasty business—and focus on how the agency does its daily job.
I interviewed a prominent tax attorney who had spent years at the IRS and she confirmed what others have reported. When the IRS determines that someone owes money, it sends out threatening letters, but then the targeted person has no actual recourse or due process. The IRS hotline only is capable of handling a tiny percentage of calls.
One typically must spend hours on hold to speak to someone at the IRS, only to receive incomplete and conflicting answers. The agency doesn't have a modern online system that allows taxpayers to handle most of these matters efficiently. In the past, if the IRS issued a levy it would include the name of a revenue officer that a taxpayer could contact. Now the IRS uses bots—and it typically takes months to get an answer via mail.
Here's a typical scenario. The IRS determines that you owe a large sum of money. You and your accountant can't get through to an agent. The agency places a lien on your property, freezes your bank account, or garnishes your wages. The only way to resolve the issue is to hire an attorney and spend thousands of dollars to get your day in court.
A cynic might argue that the IRS purposefully targets moderate-income people given that billionaires and large businesses have legions of accountants and attorneys on retainer. "The IRS promises to focus on the rich," wrote Joe Bishop-Henchman in National Review, "but then targets the middle class, since those taxpayers are more likely to pay and not fight back."
Only a tiny portion of the new spending goes for improvements in the agency's customer-service system or for technology upgrades. That speaks volumes about the Biden administration's priorities. Perhaps the IRS ought to use some of its new funding to replace the Holmes quotation with this one from another iconic high-court justice, John Marshall: "The power to tax is the power to destroy."
This column was first published in The Orange County Register.
The post A More Powerful IRS Won't Target Only the Wealthy appeared first on Reason.com.
View Article Here Taxes | Reason Archives


text:
Hampton Roads Rising 25
GeoEnvironmental Resources was awarded the Hampton Roads "Rising 25" award by the Small Business Development Center, a division of the Hampton Roads Chamber of Commerce. This award is given to companies that are recognized by local businesses as setting the pace for excellence and quality of service. This award was special in that it came from our clients in recognition of our technical expertise and level of service that we strive to provide on a daily basis.
Business & Education Partner of the of Year
GeoEnvironmental Resources was awarded Outstanding Business Partner of the Year for the company's dedication to the Suffolk Public School System. Every year a business participating in the Partners-In-Education program is awarded the Planters Business & Education Partnership Award. Volunteers from GER run a weekly after school program, Science Club, for fourth and fifth graders at Booker T. Washington Elementary School. During the school year student performance was tracked. In every case student performance increased two letter grades. Due to the overwhelming success of the program, GER was presented with this award.
Ambassador Extraordinaire
Mr. H. Nelson Adcock, GER's President, was awarded the Ambassador Extraordinaire award by the City of Virginia Beach Department of Convention and Visitor Development for his outstanding and unselfish dedication to the City's economic enhancement.
Excellence in Development Design Award
GeoEnvironmental Resources received an award of merit from the Hampton Roads Association of Commercial Real Estate for best recreational/entertainment for the renovation of the Norva Theater in Norfolk, Virginia. The association presents this award annually for outstanding commercial projects. GER provided hazardous materials consulting services for the project team.
Outstanding Engineering Achievement
The Engineers Club of Hampton Roads awarded its annual Outstanding Engineering Achievement Award by Hampton Roads Engineers to TranSystems for the USS Wisconsin mooring at Nauticus. This program serves to recognize Hampton Roads engineers for outstanding technical accomplishments and highlights significant engineering activity by Hampton Roads engineers. GER provided geotechnical services for the project.
Chairman's Award
GeoEnvironmental Resources' president, Mr. H. Nelson Adcock, received the Chairman's Award from the Hampton Roads Chamber of Commerce for his outstanding services to the Hampton Roads business community. The award recognizes local business leaders' efforts for sustaining and improving economic activity in the region.


text:
By Benjamin Solomon, Staff Writer
Vevo's YouTube accounts consist of some of the most watched on YouTube. These accounts legally host music videos from artists like Taylor Swift, Adele, Rihanna, and others. Vevo itself is a joint venture between Universal Music Group, Sony Music Entertainment, and Warner Music Group.
On April 10, hackers calling themselves Prosox and Kuroi'sh gained access to some of these accounts and altered some videos. They changed titles, descriptions, and thumbnails in addition to deleting some videos. Affected videos included those belonging to Drake, Katy Perry, Shakira and more.
The hackers deleted the video for the song "Despacito" by Luis Fonsi and Daddy Yankee, the first video on YouTube to get more than five billion views and (as of now) the most views ever. According to the Verge, before it was deleted "The video's image was altered and replaced with a masked gang holding guns (from Netflix show Casa de Papel)."
Another notable change was that several videos had the titles changed to say things like "FreePalestine" and "hacked by prosox & koroi'sh."
Twitter accounts claiming to belong to the hackers took credit for the changes. One, @Prosoxhacker, tweeted that "for us it was just a game." Another, @ProsoxW3B, said "Its just for fun i just use script 'youtube-change-title-video' and i write 'hacked' don t judge me i love youtube <3."
YouTube stated that the security breach was not due to an issue with their platform, rather the result of the hackers somehow gaining the passwords to these accounts.
Wired.com suggested that the breach may have been a result of phishing. Phishing often comes in the form of an email that impersonates a legitimate email and encourages you to click a link – often bringing you to a fake login page to steal your password.
Phishing is hacking in the sense of social engineering and manipulation. All it would take is for Vevo's accounts to not use two-factor authentication (like login verification from either phone or email) and for one employee to fall for a phishing email.
YouTube released a statement that said, "After seeing unusual upload activity on a handful of Vevo channels, we worked quickly with our partner to disable access while they investigate the issue."
A release from Vevo said, "Vevo can confirm that a number of videos in its catalogue were subject to a security breach today, which has now been contained. We are working to reinstate all videos affected and our catalogue to be restored to full working order. We are continuing to investigate the source of the breach."
Vevo has since returned all of the videos to their unaltered state and claims to have fixed its security vulnerabilities, and YouTube has instated the deleted videos and view counts.


text:
Conversations are a walk in the park – communication is better outdoors, research finds
New research has found that conversations are better in natural environments such as parks and gardens than indoors.
Researchers from The University of Manchester and Cardiff University recorded conversations between children and their parents while they explored a city park and an indoor education centre, and found that the conversations in the park were more responsive and connected compared to those recorded indoors.
The team focused on families with three- and four-year-olds, because at these ages most children have a lot to say, but coordinating with a conversational partner is sometimes challenging.
Dr Thea Cameron-Faulkner, Senior Lecturer in Linguistics at The University of Manchester, and one of the study authors, said: "Our research demonstrates that natural environments can significantly enhance social interactions, in this case improving the quality of parent-child conversations."
Professor Merideth Gattis, from Cardiff University's School of Psychology, one of the study authors, added: "One of the most challenging aspects of conversations is listening and responding to what other people say. The results of our study suggest that one simple way for people to improve this process is to spend time outdoors in natural environments.
The findings are an important first step toward building a better understanding of how natural environments can influence communication and could be used to inform and improve a number of services including education, child welfare and urban design.
Future studies will explore the reliability of the findings, as well as probing which specific aspects of environments influence communication quality.
Our study introduces a novel experimental design, which allows us to draw stronger causal conclusions about the benefits of natural environments compared to previous correlational studies reporting positive associations between green space and child outcomes.
Sam Williams, Co-author of the Arup report Cities Alive: Designing for Urban Childhoods, who was not involved in the research, commented: "Positive and engaging parent-child communication is key to a child's healthy development with lifelong benefits. This study, which is the first of its kind, demonstrates the importance of access to local, natural environments to enhance this relationship. Providing opportunities for daily contact with nature is a simple but powerful way that cities can support both children and their caregivers, with significant implications for how we plan, design and manage our public spaces."
The study 'Responding to nature: Natural environments improve parent-child communication' is published in the Journal of Environmental Psychology.


text:
The recent changes were noted as a result of a rare cosmic alignment last year. Pluto passed in front of two faint stars whose light was dimmed by its atmosphere before being cut-off by its disc.
Data from these events indicate that Pluto's tenuous atmosphere has become swelled in the past 14 years since the last time such an occultation was observed.
What is happening on the planet will only be answered by the arrival of the Pluto-Kuiper Express mission, Pluto's first probe. It is due for launch in 2006, to reach Pluto about a decade later.
Thin atmosphere
Pluto was discovered in 1930 as the result of some celestial detective work. It has always been mysterious. Even the mighty Hubble Space Telescope can only make out the haziest details on its icy surface.
Its atmosphere was first detected in 1985 when it made a star passing behind the planet, as viewed from Earth, appear to waver slightly. The atmosphere is very thin by Earth standards - about a millionth of the thickness of our atmosphere.
Observations and calculations suggested Pluto's atmosphere was made of nitrogen, which is in a delicate balance with surface ice.
Orbiting the Sun every 248 years, tiny Pluto - smaller than our own Moon - is usually the most distant planet in our Solar System, except for a few years either side of its closest approach to the Sun (and then Neptune is slightly more distant).
Lucky break
That last happened in 1989, and since then Pluto has been moving away from the Sun, presumably getting colder.
The last occultation of a star by Pluto was in 1988, so astronomers looked forward to two occultations in July and August 2002, setting up camp in North and South America, and Hawaii.
The occultation of 21 August, of star P131.1, yielded better results, suggesting that Pluto's atmosphere had swelled since 1988, even though it seemed that its temperature had stayed roughly constant.
The astronomers report their observations in the Journal Nature.
Planet race
The researchers think that thermal lag is the explanation. Pluto will inevitably get colder as it moves away from the Sun, but there might be a delay to heat accumulated when closest to the Sun.
Because of the delicate balance between Pluto's atmosphere and its icy surface, researchers expect the atmosphere to completely contract sometime around 2015, with an uncertainty of a few years.
It was the need to reach planet and make measurements before the atmosphere collapsed that has made Pluto-Kuiper Express an urgent mission. It may, or may not, reach the planet in time.
"The observations are timely," says William Hubbard writing in Nature, "Pluto's orbit over the next few years offers an opportunity to learn more about this planet, at a time when technological developments make consideration of a mission to the planet feasible."


text:
Welcome to Mike King Heating & Cooling, Inc
At Mike King Heating & Cooling, Inc, we can handle any job. No matter what you need, Mike and his experienced, dedicated team have the tools and the knowledge to take care of it. We do both residential and commercial heating and cooling, and we work on and service all makes and models. From heat pumps and gas furnaces to air conditioners, water boilers, gas lines and more, we will get your HVAC system up and running as quickly as possible!
Mike King HVAC is a family owned, full-service commercial and residential HVAC company in Indiana. Established 1999.
For more information about our services, or to schedule an estimate, contact us today at (765) 396-6453. We look forward to helping you with any-sized HVAC project!


text:
December, 2020
"Mujtamiaeen" forum
"Mujtamiaeen" forum is a series of seminars of a small group of those who are interested in the Arabic language to improve their performance...
January, 2020
Introduction to Arabic Calligraphy Workshop
The Arabic script is associated with the Islamic decoration, where it is used to decorate mosques and palaces, and it is used in the...
September, 2015
Arabic Calligraphy Art Workshop
Enjoy learning the wonderful art of Arabic Calligraphy which is a primary form of art for Islamic Visual Expression and creativity. Throughout the vast...
December, 2012
The Fox in Arabic Literature [for kids]
In this event, we aim to connect the young children to their literary heritage by simplifying two tales from the most famous symbolic literature...
November, 2012
Art and Craft Exhibition
Teachers, students and friends from ASA language school were invited for the school's first art and craft exhibition. After a short but hectic time...