[issue25822] Add docstrings to fields of urllib.parse results

2015-12-30 Thread Swati Jaiswal
Changes by Swati Jaiswal : Added file: http://bugs.python.org/file41456/iss_25822_4.patch ___ Python tracker ___

Re: raise None

2015-12-30 Thread Terry Reedy
On 12/30/2015 7:09 PM, Steven D'Aprano wrote: I have a lot of functions that perform the same argument checking each time: def spam(a, b): if condition(a) or condition(b): raise TypeError if other_condition(a) or something_else(b): raise ValueError if whatever(a): raise

Re: raise None

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 12:26 PM, Steven D'Aprano wrote: > Traceback (most recent call last): > File "spam", line 19, in this > File "spam", line 29, in that > File "spam", line 39, in other > ThingyError: ... > > > I think this is a win for debuggability. (Is that a

Stupid Python tricks

2015-12-30 Thread Steven D'Aprano
Stolen^W Inspired from a post by Tim Peters back in 2001: https://mail.python.org/pipermail/python-dev/2001-January/011911.html Suppose you have a huge string, and you want to quote it. Here's the obvious way: mystring = "spam"*10 result = '"' + mystring + '"' But that potentially

Re: raise None

2015-12-30 Thread Steven D'Aprano
On Thu, 31 Dec 2015 12:44 pm, Ben Finney wrote: > Steven D'Aprano writes: > >> Traceback (most recent call last): >> File "spam", line 19, in this >> File "spam", line 29, in that >> File "spam", line 39, in other >> File "spam", line 5, in _validate >> ThingyError:

Re: raise None

2015-12-30 Thread Steven D'Aprano
On Thu, 31 Dec 2015 03:03 pm, Cameron Simpson wrote: [...] Steven D'Aprano (that's me) wrote this: >>Whereas if _validate does what it is supposed to do, and is working >>correctly, you will see: >> >>Traceback (most recent call last): >> File "spam", line 19, in this >> File "spam", line 29,

[issue21579] Python 3.4: tempfile.close attribute does not work

2015-12-30 Thread Eryk Sun
Eryk Sun added the comment: For anyone interested, this issue is solvable on Windows by working around how O_TEMPORARY is implemented. To do this the _winapi module would need a wrapper for SetFileInformationByHandle (available in Vista+), which would need to support at least

Re: Stupid Python tricks

2015-12-30 Thread Steven D'Aprano
On Thu, 31 Dec 2015 04:02 pm, Rick Johnson wrote: > On Wednesday, December 30, 2015 at 9:51:48 PM UTC-6, Steven D'Aprano > wrote: >> Fifteen years later, and Tim Peters' Stupid Python Trick is still the >> undisputed champion! > > And should we be happy about that revelation, or sad? Yes! --

[issue24505] shutil.which wrong result on Windows

2015-12-30 Thread Toby Tobkin
Toby Tobkin added the comment: Patch incorporating Eryk Sun's feedback for various Windows-specific behavior attached. -- Added file: http://bugs.python.org/file41459/issue-24505-proposed-patch-2.diff ___ Python tracker

[issue21579] Python 3.4: tempfile.close attribute does not work

2015-12-30 Thread Марк Коренберг
Changes by Марк Коренберг : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2015-12-30 Thread Won Chang
i have these task which i believe i have done well to some level Create a function get_algorithm_result to implement the algorithm below 1- Get a list of numbers L1, L2, L3LN as argument 2- Assume L1 is the largest, Largest = L1 3- Take next number Li from the list and do the following 4-

Re: using __getitem()__ correctly

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 08:35:57 -0700, Ian Kelly wrote: > On Dec 30, 2015 7:46 AM, "Charles T. Smith" > wrote: >> As is so often the case, in composing my answer to your question, I >> discovered a number of problems in my class (e.g. I was calling >> __getitem__()

Re: how to get names of attributes

2015-12-30 Thread Random832
On Wed, Dec 30, 2015, at 07:50, Chris Angelico wrote: > I believe that's true, yes. The meaning of "by default" there is that > "class X: pass" will make an old-style class. All built-in types are > now new-style classes. To be clear, AFAIK, built-in types were never old-style classes - prior to

[issue25980] not able to find module request in lib urllib - Python35-32

2015-12-30 Thread Brett Cannon
Brett Cannon added the comment: You need to use the line `import urllib.request` to make the import work as you didn't import the urllib.request module, only the urllib package. -- nosy: +brett.cannon resolution: -> not a bug status: open -> closed

[issue25961] Disallow the null character in type name

2015-12-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 29cc6b2f9d28 by Serhiy Storchaka in branch '2.7': Issue #25961: Disallowed null characters in the type name. https://hg.python.org/cpython/rev/29cc6b2f9d28 New changeset d2417971c934 by Serhiy Storchaka in branch '3.5': Issue #25961: Disallowed

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2015-12-30 Thread Joel Goldstick
On Wed, Dec 30, 2015 at 3:06 PM, Joel Goldstick wrote: > > > On Wed, Dec 30, 2015 at 1:21 PM, Won Chang wrote: > >> >> i have these task which i believe i have done well to some level >> >> Create a function get_algorithm_result to implement the

Re: using __getitem()__ correctly

2015-12-30 Thread Ian Kelly
On Wed, Dec 30, 2015 at 9:58 AM, Charles T. Smith wrote: > On Wed, 30 Dec 2015 08:35:57 -0700, Ian Kelly wrote: > >> On Dec 30, 2015 7:46 AM, "Charles T. Smith" >> wrote: >>> As is so often the case, in composing my answer to your

Re: EOFError: marshal data too short -- causes?

2015-12-30 Thread Glenn Linderman
On 12/29/2015 5:56 AM, D'Arcy J.M. Cain wrote: On Tue, 29 Dec 2015 00:01:00 -0800 Glenn Linderman wrote: OK, so I actually renamed it instead of zapping it. Them, actually, Really, just zap them. They are object code. Even if you zap a perfectly good .pyc file a

Re: subprocess check_output

2015-12-30 Thread Cameron Simpson
On 30Dec2015 21:14, Carlos Barera wrote: Trying to run a specific command (ibstat) installed in /usr/sbin on an Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh: /usr/sbin/ibstat: No such file or directory" I tried the following: - running the

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2015-12-30 Thread Joel Goldstick
On Wed, Dec 30, 2015 at 1:21 PM, Won Chang wrote: > > i have these task which i believe i have done well to some level > > Create a function get_algorithm_result to implement the algorithm below > > 1- Get a list of numbers L1, L2, L3LN as argument 2- Assume L1 is the

subprocess check_output

2015-12-30 Thread Carlos Barera
Hi, Trying to run a specific command (ibstat) installed in /usr/sbin on an Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh: /usr/sbin/ibstat: No such file or directory" I tried the following: - running the command providing full path - running with executable=bash -

[issue22995] Restrict default pickleability

2015-12-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 92172d7372dd by Serhiy Storchaka in branch '2.7': Issue #22995: Instances of extension types with a state that aren't https://hg.python.org/cpython/rev/92172d7372dd -- ___ Python tracker

[issue22995] Restrict default pickleability

2015-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That's all with this issue. Analyzing the signature of __new__ is not such easy and perhaps will be done in separate issue. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed

Re: PEAK-Rules package.

2015-12-30 Thread Joel Goldstick
On Wed, Dec 30, 2015 at 8:24 AM, Radhika Grover wrote: > Hi, > > I don't see any package available under > https://pypi.python.org/simple/PEAK-Rules/. Could you please let me know > if it has seen a change recently. > > I need PEAK-Rules>=0.5a1.dev-r2600 using easy_install

Re: EOFError: marshal data too short -- causes?

2015-12-30 Thread Glenn Linderman
On 12/29/2015 1:00 PM, Terry Reedy wrote: I updated to 2.7.11, 3.4.4, and 3.5.1 a couple of weeks ago, so the timestamps are all fresh. So I don't know what happened with 3.4.3 timestamps from last April and whether Windows itself touches the files. I just tried importing a few and Python

Re: using __getitem()__ correctly

2015-12-30 Thread Steven D'Aprano
On Thu, 31 Dec 2015 10:13 am, Ben Finney wrote: > You may be familiar with other languages where the distinction between > “attribute of an object” is not distinct from “item in a dictionary”. > Python is not one of those languages; the distinction is real and > important. I'm not sure what

Re: how to get names of attributes

2015-12-30 Thread Steven D'Aprano
On Wed, 30 Dec 2015 10:51 pm, Charles T. Smith wrote: > Hi, > > How can I get *all* the names of an object's attributes? In the most general case, you cannot. Classes can define a __getattr__ method (and a __getattribute__ method, for new-style classes only) which implement dynamic

raise None

2015-12-30 Thread Steven D'Aprano
I have a lot of functions that perform the same argument checking each time: def spam(a, b): if condition(a) or condition(b): raise TypeError if other_condition(a) or something_else(b): raise ValueError if whatever(a): raise SomethingError ... def eggs(a, b): if condition(a)

Re: raise None

2015-12-30 Thread Paul Rubin
Steven D'Aprano writes: > def _validate(a, b): > if condition(a) or condition(b): return TypeError > ... > Obviously this doesn't work now, since raise None is an error, but if it did > work, what do you think? Never occurred to me. But in some analogous situations

Re: using __getitem()__ correctly

2015-12-30 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 31 Dec 2015 10:13 am, Ben Finney wrote: > > > You may be familiar with other languages where the distinction > > between “attribute of an object” is not distinct from “item in a > > dictionary”. Python is not one of those languages; the

Validation in Python (was: raise None)

2015-12-30 Thread Ben Finney
Steven D'Aprano writes: > I have a lot of functions that perform the same argument checking each > time: Not an answer to the question you ask, but: Have you tried the data validation library “voluptuous”? Voluptuous, despite the name, is a Python data validation

Re: using __getitem()__ correctly

2015-12-30 Thread Ian Kelly
On Wed, Dec 30, 2015 at 3:54 PM, Charles T. Smith wrote: > On Wed, 30 Dec 2015 13:40:44 -0700, Ian Kelly wrote: > >> On Wed, Dec 30, 2015 at 9:58 AM, Charles T. Smith >>> The problem is that then triggers the __getitem__() method and I don't >>> know how to get to the

Re: raise None

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 11:09 AM, Steven D'Aprano wrote: > I have a lot of functions that perform the same argument checking each time: > > def spam(a, b): > if condition(a) or condition(b): raise TypeError > if other_condition(a) or something_else(b): raise

Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread otaksoftspamtrap
How do I get from here t = ('1024', '1280') to t = (1024, 1280) Thanks for all help! -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 9:46 AM, wrote: > How do I get from here > > t = ('1024', '1280') > > to > > t = (1024, 1280) > > > Thanks for all help! t = (int(t[0]), int(t[1])) If the situation is more general than that, post your actual code and we can help out more.

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread Ben Finney
otaksoftspamt...@gmail.com writes: > How do I get from here > > t = ('1024', '1280') > > to > > t = (1024, 1280) Both of those are assignment statements, so I'm not sure what you mean by “get from … to”. To translate one assignment statement to a different assignment statement, re-write the

Re: using __getitem()__ correctly

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 13:40:44 -0700, Ian Kelly wrote: > On Wed, Dec 30, 2015 at 9:58 AM, Charles T. Smith >> The problem is that then triggers the __getitem__() method and I don't >> know how to get to the attributes without triggering __getattr__(). >> >> It's the interplay of the two that's

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread Ian Kelly
On Wed, Dec 30, 2015 at 3:46 PM, wrote: > How do I get from here > > t = ('1024', '1280') > > to > > t = (1024, 1280) Deja vu: https://mail.python.org/pipermail/python-list/2015-December/701017.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread otaksoftspamtrap
Thanks much - both solutions work well for me On Wednesday, December 30, 2015 at 2:57:50 PM UTC-8, Ben Finney wrote: > kierkega...@gmail.com writes: > > > How do I get from here > > > > t = ('1024', '1280') > > > > to > > > > t = (1024, 1280) > > Both of those are assignment statements, so

Re: using __getitem()__ correctly

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 22:54:44 +, Charles T. Smith wrote: > But I concede I must be doing something fundamentally wrong because this > assert is triggering: > def __getattr__ (self, name): > print "attrdict:av:__getattr__: entered for ", name > assert name not in

Re: using __getitem()__ correctly

2015-12-30 Thread Ben Finney
"Charles T. Smith" writes: > I don't understand this distinction between an "attribute" and a "dict > item". When did you most recently work through the Python tutorial > You may want to work through it again, from start to

Re: using __getitem()__ correctly

2015-12-30 Thread Charles T. Smith
On Thu, 31 Dec 2015 10:13:53 +1100, Ben Finney wrote: > "Charles T. Smith" writes: > >> I don't understand this distinction between an "attribute" and a "dict >> item". > > When did you most recently work through the Python tutorial >

Re: how to get names of attributes

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 4:04 AM, Random832 wrote: > On Wed, Dec 30, 2015, at 07:50, Chris Angelico wrote: >> I believe that's true, yes. The meaning of "by default" there is that >> "class X: pass" will make an old-style class. All built-in types are >> now new-style

Re: subprocess check_output

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 8:02 AM, Cameron Simpson wrote: > On 30Dec2015 21:14, Carlos Barera wrote: >> >> Trying to run a specific command (ibstat) installed in /usr/sbin on an >> Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh:

Re: raise None

2015-12-30 Thread Steven D'Aprano
On Thu, 31 Dec 2015 11:38 am, Chris Angelico wrote: > On Thu, Dec 31, 2015 at 11:09 AM, Steven D'Aprano > wrote: >> I have a lot of functions that perform the same argument checking each >> time: >> >> def spam(a, b): >> if condition(a) or condition(b): raise TypeError

Re: raise None

2015-12-30 Thread Ben Finney
Steven D'Aprano writes: > Traceback (most recent call last): > File "spam", line 19, in this > File "spam", line 29, in that > File "spam", line 39, in other > File "spam", line 5, in _validate > ThingyError: ... > > and the reader has to understand the internal

Re: Stupid Python tricks

2015-12-30 Thread Rick Johnson
On Wednesday, December 30, 2015 at 9:51:48 PM UTC-6, Steven D'Aprano wrote: > Fifteen years later, and Tim Peters' Stupid Python Trick is still the > undisputed champion! And should we be happy about that revelation, or sad? -- https://mail.python.org/mailman/listinfo/python-list

Error 0x80070570

2015-12-30 Thread ivanor toledo
Good evening! I am trying to install Python , however is me presenting Error 0x80070570 saying that the folder or file is corrupted or unreadable. is attached the log file with the aforementioned error , already realized some procedures did not work .. procedures such as error correction,

Re: raise None

2015-12-30 Thread Cameron Simpson
On 31Dec2015 12:26, Steven D'Aprano wrote: On Thu, 31 Dec 2015 11:38 am, Chris Angelico wrote: [... functions calling common _validate function ...] But when the argument checking fails, the traceback shows the error occurring in _validate, not eggs or spam. (Naturally,

[issue25981] Intern namedtuple field names

2015-12-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't see how the proposed patch would affect the result. ISTM that the interning would have to happen after the template substitution and exec. See the attached alternate patch. That said, I'm not too concerned with the contents of _fields not being

[issue25981] Intern namedtuple field names

2015-12-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file41458/show_all_fieldnames_interned2.py ___ Python tracker ___

Re: raise None

2015-12-30 Thread Cameron Simpson
On 31Dec2015 16:12, Steven D'Aprano wrote: On Thu, 31 Dec 2015 03:03 pm, Cameron Simpson wrote: Steven D'Aprano (that's me) wrote this: Whereas if _validate does what it is supposed to do, and is working correctly, you will see: Traceback (most recent call last): File

[issue16731] xxlimited/xxmodule docstrings ambiguous

2015-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: I don't mind at all. Go ahead :) -- ___ Python tracker ___ ___

Re: Path problems when I am in bash

2015-12-30 Thread xeon Mailinglist
On Wednesday, December 30, 2015 at 2:30:40 AM UTC, Karim wrote: > On 30/12/2015 00:21, xeon Mailinglist wrote: > > I have my source code inside the directory `medusa`, and my unit tests > > inside `tests` dir. Both dirs are inside `medusa-2.0` dir. Here is my file > > structure [1]. > > > > When

how to get names of attributes

2015-12-30 Thread Charles T. Smith
Hi, How can I get *all* the names of an object's attributes? I have legacy code with mixed new style classes and old style classes and I need to write methods which deal with both. That's the immediate problem, but I'm always running into the need to understand how objects are linked, in

Re: [Twisted-Python] Twisted 15.4 was the last release to support Python 2.6; or: a HawkOwl Can't Words Situation

2015-12-30 Thread anatoly techtonik
Is it possible to fix the documentation? https://twistedmatrix.com/trac/browser/tags/releases/twisted-15.5.0/NEWS?format=raw On Mon, Dec 7, 2015 at 4:06 PM, Amber "Hawkie" Brown wrote: > Hi everyone! > > It's been brought to my attention that I misworded something in

[issue25980] not able to find module request in lib urllib - Python35-32

2015-12-30 Thread Kiran Kotari
New submission from Kiran Kotari: Python 3.5.1 documentation code giving following error: Error: Traceback (most recent call last): File ".\urllib1.py", line 5, in with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f: AttributeError: module 'urllib' has no attribute

[issue25980] not able to find module request in lib urllib - Python35-32

2015-12-30 Thread R. David Murray
R. David Murray added the comment: Can you provide a link to the documentation you find to be in error? -- nosy: +r.david.murray ___ Python tracker ___

Re: how to get names of attributes

2015-12-30 Thread Mark Lawrence
On 30/12/2015 11:51, Charles T. Smith wrote: Hi, Does anyone know *why* the __members__ method was deprecated, to be replaced by dir(), which doesn't tell the truth (if only it took an optional parameter to say: "be truthful") https://bugs.python.org/issue456420

Re: how to get names of attributes

2015-12-30 Thread Mark Lawrence
On 30/12/2015 13:31, Charles T. Smith wrote: I wonder what the difference is between vars() and items() Not much. From https://docs.python.org/3/library/functions.html#vars vars([object]) Return the __dict__ attribute for a module, class, instance, or any other object with a

Re: Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Marko Rauhamaa
Steven D'Aprano : > Nevertheless, it's well known (in the sense that "everybody knows") > that Python floats are equivalent to C 64-bit IEEE-754 doubles. How > safe is that assumption? You'd need to have it in writing, wouldn't you? The only spec I know of promises no such

ANN: pySerial 3.0

2015-12-30 Thread Chris Liechti
A new release of pySerial is available. There have been a lot of changes so that the major version was bumped up to 3.0. Changes include (since V2.7): - Python 2.7 and Python 3.2+ from the same sources (lib2to3 is no longer used) - new API, more properties, the set functions are deprecated.

Re: how to get names of attributes

2015-12-30 Thread Chris Angelico
On Wed, Dec 30, 2015 at 10:51 PM, Charles T. Smith wrote: > Does anyone know *why* the __members__ method was deprecated, to be > replaced by dir(), which doesn't tell the truth (if only it took an > optional parameter to say: "be truthful") Does vars() help here? It

Re: how to get names of attributes

2015-12-30 Thread Chris Angelico
On Wed, Dec 30, 2015 at 11:16 PM, Charles T. Smith wrote: > I'm glad I discovered __mro__(), but how can I do the same thing for old- > style classes? You should be able to track through __bases__ and use vars() at every level: >>> class X: pass ... >>> class Y(X):

Re: how to get names of attributes

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 11:51:19 +, Charles T. Smith wrote: > Hi, > > How can I get *all* the names of an object's attributes? I have legacy > code with mixed new style classes and old style classes and I need to > write methods which deal with both. That's the immediate problem, but > I'm

Re: how to get names of attributes

2015-12-30 Thread Chris Angelico
On Wed, Dec 30, 2015 at 11:40 PM, Charles T. Smith wrote: > Oh! > > Although the referenced doc says: > > "For compatibility reasons, classes are still old-style by default." > > is it true that dictionaries are by default always new-style objects? > > (PDB)c6 = {

Re: (Execution) Termination bit, Alternation bit.

2015-12-30 Thread Steven D'Aprano
On Wed, 30 Dec 2015 03:07 pm, Rustom Mody wrote: > By some coincidence was just reading: > from http://www.wordyard.com/2006/10/18/dijkstra-humble/ > > which has the following curious extract. > [Yeah its outlandish] > > -- > I consider the absolute

Re: using __getitem()__ correctly

2015-12-30 Thread Chris Angelico
On Wed, Dec 30, 2015 at 11:57 PM, Charles T. Smith wrote: > Hello, > > I thought __getitem__() was invoked when an object is postfixed with an > expression in brackets: > > - abc[n] > > and __getattr__() was invoked when an object is postfixed with an dot: > > -

Re: how to get names of attributes

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 11:51:19 +, Charles T. Smith wrote: > Hi, > > How can I get *all* the names of an object's attributes? I have legacy > code with mixed new style classes and old style classes and I need to > write methods which deal with both. That's the immediate problem, but > I'm

using __getitem()__ correctly

2015-12-30 Thread Charles T. Smith
Hello, I thought __getitem__() was invoked when an object is postfixed with an expression in brackets: - abc[n] and __getattr__() was invoked when an object is postfixed with an dot: - abc.member but my __getitem__ is being invoked at this time, where there's no subscript (going into a

Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Steven D'Aprano
We know that Python floats are equivalent to C doubles, which are 64-bit IEEE-754 floating point numbers. Well, actually, C doubles are not strictly defined. The only promise the C standard makes is that double is no smaller than float. (That's C float, not Python float.) And of course, not all

PEAK-Rules package.

2015-12-30 Thread Radhika Grover
Hi, I don't see any package available under https://pypi.python.org/simple/PEAK-Rules/. Could you please let me know if it has seen a change recently. I need PEAK-Rules>=0.5a1.dev-r2600 using easy_install default behavior. Any help is appreciated. Thanks in advance! - Radhika --

Re: how to get names of attributes

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 23:50:03 +1100, Chris Angelico wrote: > On Wed, Dec 30, 2015 at 11:40 PM, Charles T. Smith > wrote: >> Oh! >> >> Although the referenced doc says: >> >> "For compatibility reasons, classes are still old-style by default." >> >> is it true that

Re: how to get names of attributes

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 12:31 AM, Charles T. Smith wrote: > Okay, thank you. I'm trying to understand your program. > > Unfortunately, I haven't gotten the same output you had, using python 2.6 > or 2.7. Maybe I haven't been able to restore the indentation correctly

Re: Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Terry Reedy
On 12/30/2015 8:18 AM, Steven D'Aprano wrote: We know that Python floats are equivalent to C doubles, Yes which are 64-bit IEEE-754 floating point numbers. I believe that this was not true on all systems when Python was first released. Not all 64-bit floats divided them the same way. I

Re: using __getitem()__ correctly

2015-12-30 Thread Charles T. Smith
On Thu, 31 Dec 2015 00:11:24 +1100, Chris Angelico wrote: > On Wed, Dec 30, 2015 at 11:57 PM, Charles T. Smith > wrote: >> Hello, >> >> I thought __getitem__() was invoked when an object is postfixed with an >> expression in brackets: >> >> - abc[n] >> >> and

Re: how to get names of attributes

2015-12-30 Thread Charles T. Smith
On Wed, 30 Dec 2015 14:10:14 +, Mark Lawrence wrote: > On 30/12/2015 11:51, Charles T. Smith wrote: >> Hi, >> >> Does anyone know *why* the __members__ method was deprecated, to be >> replaced by dir(), which doesn't tell the truth (if only it took an >> optional parameter to say: "be

Re: using __getitem()__ correctly

2015-12-30 Thread Ian Kelly
On Dec 30, 2015 7:46 AM, "Charles T. Smith" wrote: > As is so often the case, in composing my answer to your question, I discovered > a number of problems in my class (e.g. I was calling __getitem__() myself!), > but > I'm puzzled now how to proceed. I thought the