[issue45483] pure Python class that has been registered as a `collections.abc.Sequence` can't be recgnized by the match statement without the `_abc` module

2021-10-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45483] pure Python class that has been registered as a `collections.abc.Sequence` can't be recgnized by the match statement without the `_abc` module

2021-10-15 Thread GalaxySnail
New submission from GalaxySnail : Pure Python class that has been registered as a `collections.abc.Sequence` can't be recgnized by the match statement without the `_abc` module. For example: ``` >>> from test.support.import_helper import import_fresh_module >>> collecti

[issue41838] Value error is showing in docset python (class)

2020-09-28 Thread Eric V. Smith
Eric V. Smith added the comment: If you can provide the information requested, please reopen this issue. In the meantime, I’m closing it. -- resolution: -> rejected stage: -> resolved status: pending -> closed ___ Python tracker

[issue41838] Value error is showing in docset python (class)

2020-09-24 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41838] Value error is showing in docset python (class)

2020-09-23 Thread Eric V. Smith
Eric V. Smith added the comment: It would be helpful if you can: - simplify the example - attach the simplified code to this issue - show how the code runs with no errors, and how you invoke it - show how you invoke the code when it does have errors Please do no attach images: they are not

[issue41838] Value error is showing in docset python (class)

2020-09-23 Thread Mohit Kumar
New submission from Mohit Kumar : https://github.com/python/bugs.python.org/issues/55 -- assignee: docs@python components: Documentation messages: 377362 nosy: docs@python, mkay6122 priority: normal severity: normal status: open title: Value error is showing in docset python (class

Re: i don't understand this python class

2020-06-29 Thread DL Neil via Python-list
On 30/06/20 5:14 AM, joseph pareti wrote: I have piece of code with constructs as follows: *class* *SentimentNetwork**:* *def* __init__*(*self*,* reviews*,* labels*,* hidden_nodes *=* 10*,* learning_rate *=* 0.1*):* np*.*random*.*seed*(*1*)*

Re: i don't understand this python class

2020-06-29 Thread Calvin Spealman
You are misreading the original example. `init_network` is defined as a method on the class, and called in its initializer. There is no property named "init_network". On Mon, Jun 29, 2020 at 1:18 PM joseph pareti wrote: > I have piece of code with constructs as follows: > > *class*

i don't understand this python class

2020-06-29 Thread joseph pareti
I have piece of code with constructs as follows: *class* *SentimentNetwork**:* *def* __init__*(*self*,* reviews*,* labels*,* hidden_nodes *=* 10*,* learning_rate *=* 0.1*):* np*.*random*.*seed*(*1*)* self*.*init_network*(**len**(*self*.*review_vocab*),*hidden_nodes*,*

Re: How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread MRAB
On 2020-04-01 13:42, Musbur wrote: Hi guys, I'm wondering how to create an instance of an extension class I wrote. There's a minimal self-contained C module at the bottom of this post which exports two things: 1) a class Series, and 2) a function make_series() which is supposed to create a

Re: How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread Rhodri James
On 01/04/2020 18:24, Musbur wrote: Am 01.04.2020 15:01 schrieb Rhodri James: I believe you do it in C as you would in Python: you call the Series class! pyseries = PyObject_CallObject((PyObject *)_type, NULL); Well, that dumps core just as everything else I tried. What does work, however,

Re: How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread Musbur
Am 01.04.2020 15:01 schrieb Rhodri James: I believe you do it in C as you would in Python: you call the Series class! pyseries = PyObject_CallObject((PyObject *)_type, NULL); Well, that dumps core just as everything else I tried. What does work, however, is calling PyType_Ready first:

Re: How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread Rhodri James
On 01/04/2020 13:42, Musbur wrote: So when created from C, neither the "new" nor the "init" functions are called on the object, only "finalize". No wonder I get segfaults in the real life application. So how is this done right? Here's the C module: I believe you do it in C as you would in

How to instantiate a custom Python class inside a C extension?

2020-04-01 Thread Musbur
Hi guys, I'm wondering how to create an instance of an extension class I wrote. There's a minimal self-contained C module at the bottom of this post which exports two things: 1) a class Series, and 2) a function make_series() which is supposed to create a Series object on the C side and

NEED ASSISTANCE WITH PYTHON CLASS

2020-03-28 Thread gentleman . for . ever . and . ever
Hi, I need help with coding assignments (python to be exact) in school. I am willing to pay for your attention by the hour. Please email me at aifa...@protonmail.com if you’re interested. Please only reach out if you’re not a beginner. Trying to avoid the blind being led by the blind. Thanks!

Re: How to call a Python Class?

2016-05-03 Thread Ben Finney
David Shi via Python-list <python-list@python.org> writes: > I found a Python class within an Open Source software. > I would like to use it in my own Python script. > I tried to import it, but I got following message. Your text is mangled in transit. Please post only plain text

Re: How to call a Python Class?

2016-05-03 Thread Chris Angelico
On Wed, May 4, 2016 at 8:56 AM, David Shi via Python-list <python-list@python.org> wrote: > I found a Python class within an Open Source software. > I would like to use it in my own Python script. > I tried to import it, but I got following message. > from intersection impor

How to call a Python Class?

2016-05-03 Thread David Shi via Python-list
I found a Python class within an Open Source software. I would like to use it in my own Python script. I tried to import it, but I got following message. from intersection import *Traceback (most recent call last):  File "<pyshell#4>", line 1, in     from intersection import *I

Re: How to create an instance of a python class from C++

2014-03-12 Thread Stefan Behnel
Barry Scott, 11.03.2014 22:37: On 5 Mar 2014, at 00:14, Bill wrote: I can't figure out how to create an instance of a python class from 'C++': Why not use pycxx from http://sourceforge.net/projects/cxx/? This lib does all the heavy lifting for you for both python2 and python3. Has docs

Re: How to create an instance of a python class from C++

2014-03-11 Thread Barry Scott
On 5 Mar 2014, at 00:14, Bill galaxyblu...@gmail.com wrote: Hello: I can't figure out how to create an instance of a python class from 'C++': Why not use pycxx from http://sourceforge.net/projects/cxx/? This lib does all the heavy lifting for you for both python2 and python3. Has docs

Re: How to create an instance of a python class from C++

2014-03-05 Thread Bill
So far, so good. The object that was passed in was the Derived class object. Since you presumably only want class objects to be passed in, you might want to check that here using PyType_Check. Yes. Will do. PyTypeObject *typ = class_decl-ob_type; In Python, you

Re: How to create an instance of a python class from C++

2014-03-05 Thread Grant Edwards
On 2014-03-05, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, Mar 4, 2014 at 5:14 PM, Bill galaxyblu...@gmail.com wrote: Hello: I can't figure out how to create an instance of a python class from 'C++': ( I am relatively new to Python so excuse some of the following. ) In a .py file I

Re: How to create an instance of a python class from C++

2014-03-05 Thread Alister
On Wed, 05 Mar 2014 16:08:00 +, Grant Edwards wrote: On 2014-03-05, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, Mar 4, 2014 at 5:14 PM, Bill galaxyblu...@gmail.com wrote: Hello: I can't figure out how to create an instance of a python class from 'C++': ( I am relatively new

Re: How to create an instance of a python class from C++

2014-03-05 Thread Grant Edwards
On 2014-03-05, Alister alister.w...@ntlworld.com wrote: Why are you creating an ABC? Because it was the first binary computer that did calculations with electronic switching elements (gates), and it would be really cool to have one! The ABC also pioneered the use of capciators as

Re: How to create an instance of a python class from C++

2014-03-05 Thread Gene Heskett
On Wednesday 05 March 2014 17:09:53 Grant Edwards did opine: On 2014-03-05, Alister alister.w...@ntlworld.com wrote: Why are you creating an ABC? Because it was the first binary computer that did calculations with electronic switching elements (gates), and it would be really cool to

How to create an instance of a python class from C++

2014-03-04 Thread Bill
Hello: I can't figure out how to create an instance of a python class from 'C++': ( I am relatively new to Python so excuse some of the following. ) In a .py file I create an ABC and then specialize it: from MyMod import * from abc import ABCMeta, abstractmethod # Declare

Re: How to create an instance of a python class from C++

2014-03-04 Thread Ian Kelly
On Tue, Mar 4, 2014 at 5:14 PM, Bill galaxyblu...@gmail.com wrote: Hello: I can't figure out how to create an instance of a python class from 'C++': ( I am relatively new to Python so excuse some of the following. ) In a .py file I create an ABC and then specialize it: Why are you

Python class and variable issue(newby question!)

2013-03-29 Thread Sam Berry
Hey, Im new to object orientated programming and have an issue with using classes. Im using the kivy module, a GUI creator , so posting the actual code may confuse. But an example of what im trying to achieve is below class test() s = 1 def test1() global s s = 2

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Chris Angelico
On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry sambez...@hotmail.co.uk wrote: class test() s = 1 def test1() global s s = 2 def test2() global s s = 3 def test3() global s s = 4 That's not a global, that's a class variable.

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Benjamin Kaplan
On Fri, Mar 29, 2013 at 2:12 PM, Sam Berry sambez...@hotmail.co.uk wrote: Hey, Im new to object orientated programming and have an issue with using classes. Im using the kivy module, a GUI creator , so posting the actual code may confuse. But an example of what im trying to achieve is below

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Sam Berry
Thanks for the responses! My issue was sorted with Benjamins post, just printing s worked. Cheers for the info though Chris, if i have any further issues il post them with some working code. Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Chris Angelico
On Sat, Mar 30, 2013 at 9:17 AM, Sam Berry sambez...@hotmail.co.uk wrote: Thanks for the responses! My issue was sorted with Benjamins post, just printing s worked. Cheers for the info though Chris, if i have any further issues il post them with some working code. Awesome! Always happy to

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Steven D'Aprano
On Sat, 30 Mar 2013 08:24:00 +1100, Chris Angelico wrote: On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry sambez...@hotmail.co.uk wrote: class test() s = 1 def test1() global s s = 2 That's not a global, that's a class variable. /me thwacks Chris with a halibut.

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Chris Angelico
On Sat, Mar 30, 2013 at 9:51 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 30 Mar 2013 08:24:00 +1100, Chris Angelico wrote: On Sat, Mar 30, 2013 at 8:12 AM, Sam Berry sambez...@hotmail.co.uk wrote: class test() s = 1 def test1() global s

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Dave Angel
On 03/29/2013 06:17 PM, Sam Berry wrote: Thanks for the responses! My issue was sorted with Benjamins post, just printing s worked. Cheers for the info though Chris, if i have any further issues il post them with some working code. In that case, you probably should add a line like: s =

Re: Python Class

2013-02-01 Thread Steven D'Aprano
Charles Hoskinson wrote: I'm developing an online course for beginning python programmers starting from basic syntax through object oriented design and GUI. I'd like to include some helpful community resources like Code Academy in the appendix and I was wondering if this community has some

Re: Python Class

2013-02-01 Thread Rodrick Brown
On Friday, February 1, 2013, Charles Hoskinson wrote: I'm developing an online course for beginning python programmers starting from basic syntax through object oriented design and GUI. I'd like to include some helpful community resources like Code Academy in the appendix and I was wondering

Fool Python class with imaginary members (serious guru stuff inside)

2012-09-20 Thread Jure Erznožnik
I'm trying to create a class that would lie to the user that a member is in some cases a simple variable and in other cases a class. The nature of the member would depend on call syntax like so: 1. x = obj.member #x becomes the simple value contained in member 2. x = obj.member.another_member #x

Re: Fool Python class with imaginary members (serious guru stuff inside)

2012-09-20 Thread Terry Reedy
On 9/20/2012 9:52 AM, Jure Erznožnik wrote: I'm trying to create a class that would lie to the user that a member is in some cases a simple variable and in other cases a class. The nature of the member would depend on call syntax like so: 1. x = obj.member #x becomes the simple value contained

Re: Fool Python class with imaginary members (serious guru stuff inside)

2012-09-20 Thread Steven D'Aprano
On Thu, 20 Sep 2012 06:52:07 -0700, Jure Erznožnik wrote: I'm trying to create a class that would lie to the user that a member is in some cases a simple variable and in other cases a class. The nature of the member would depend on call syntax like so: 1. x = obj.member #x becomes the simple

Re: A Python class

2012-09-06 Thread Terry Reedy
On 9/6/2012 11:08 AM, Yves S. Garret wrote: I'd like to know if there are any online Python classes offered online from reliable institutions that you would recommend. Google 'online programming course python' for taught courses. At least 2 of MIT's self-guided OpenCourseWare courses use

Re: A Python class

2012-09-06 Thread Chris Angelico
courses. At least 2 of MIT's self-guided OpenCourseWare courses use Python. Note this subtle distinction. A Python course will (theoretically, at least!) teach you how to write Python code. A Python class is a collection of methods and stuff. A trivial and petty distinction, perhaps, but when you

Instantiate a python class object in C

2012-03-14 Thread Dids
is good. What I can't figure out is how to create a second C function that returns a new instance to the demo class to python. There must a be tutorial somewhere, but I can't find anything. I do not want to define a new python class in C. Another example: This is working: demo_obj1 = demo

Re: Instantiate a python class object in C

2012-03-14 Thread Stefan Behnel
magic. It's working, all is good. What I can't figure out is how to create a second C function that returns a new instance to the demo class to python. There must a be tutorial somewhere, but I can't find anything. I do not want to define a new python class in C. Another example

Re: Instantiate a python class object in C

2012-03-14 Thread Dids
Ok, I have it :) PyImport_Import , PyModule_GetDict, PyDict_GetItemString and PyObject_CallObject Need to take a second look at cython when I have a spare cycle or 2. Thanks for the the tip :) A+ Dids, -- http://mail.python.org/mailman/listinfo/python-list

How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Hi people, I've created very nice post here: http://stackoverflow.com/questions/5274690/how-to-get-python-class-serializable-and-well-parsed-by-json-custom-encoder-deco Yes, there are solutions over the internet, but nothing works for my custom types. If you could answer, please read

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Common guys, help me, sweet heart to finish my job and go with my friend in the bar. Today we have a blues night :) Love it! Christina -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Currently trying to pick up my ava http://en.gravatar.com/christinasanders21 for StackOverflow, which site I found very good for my questions, didn't I? Yes, and there are problem when adding a picture. Web admins should be careful. Can anyone explain me my problem ? : Christina --

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Sophie Sperner
Ok, guys. I used my bro account. Now I'm here. By the way is anybody going to be in Paris Sunday night ? I invite you if you would help :))) Kiss, well yet 30 minutes at work and I'm free... Sophie -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Gennadiy Zlobin
I can not open your link. Are you sure you provided the correct link? - Gennadiy gennad.zlo...@gmail.com On Fri, Mar 11, 2011 at 10:36 PM, Arthur Mc Coy 1984docmc...@gmail.comwrote: Currently trying to pick up my ava http://en.gravatar.com/christinasanders21 for StackOverflow, which site I

May Introduction to Python class

2010-04-27 Thread Steve Holden
Holden Web is pleased to announce the next run of its popular three-day Introduction to Python class in Washington DC on May 11-13, 2010. Further details of all current event listings are available from http://holdenweb.eventbrite.com/ regards Steve -- Steve Holden +1 571 484 6266

May Introduction to Python class

2010-04-27 Thread Steve Holden
Holden Web is pleased to announce the next run of its popular three-day Introduction to Python class in Washington DC on May 11-13, 2010. Further details of all current event listings are available from http://holdenweb.eventbrite.com/ regards Steve -- Steve Holden +1 571 484 6266

JSR223 Access Python class instances through Java

2009-11-12 Thread Jared Klumpp
I am trying to access (from Java) a python class that extends a Java interface. The following program runs fine in the jython console (I can instantiate Tada, call t.getName() and everything prints correctly.) However, if I invoke test1() from Java using JSR223, the returned object is inaccessible

Re: Storing a C pointer in a Python class instance

2009-10-06 Thread lallous
storing in this CObject? Maybe we can help you choose a better way to handle it at the C level. I am wrapping a C++ pointer with the python object. That way I can tell with which C++ object a given python class instance is associated. The thing is when developing, I need to pickle but I don't need

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread lallous
Thanks everyone. Finally, I used Falcolas suggestion and took into consideration sturlamolden's comments. Regards, Elias lallous lall...@lgwm.org wrote in message news:h9sgcn$iv...@aioe.org... Hello From my C extension module I want to store a C pointer in a given PyObject. The only way

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread lallous
Hello After using the PyCObject, I cannot pickle the class anymore. Any simple solution to this problem? (or resorting to __reduce__ is the only solution?) Thanks, Elias Falcolas garri...@gmail.com wrote in message news:9d3790aa-f7d9-4bb5-a81f-5428b2d60...@v25g2000yqk.googlegroups.com...

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread Carl Banks
On Sep 30, 5:24 am, lallous lall...@lgwm.org wrote: Hello After using the PyCObject, I cannot pickle the class anymore. Any simple solution to this problem? (or resorting to __reduce__ is the only solution?) You can't pickle a CObject, you'd have to create a custom type (one that implements

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread Carl Banks
On Sep 29, 11:16 am, sturlamolden sturlamol...@yahoo.no wrote: On 29 Sep, 19:11, Carl Banks pavlovevide...@gmail.com wrote: CObjects can be passed a C function as a deallocator; this should work as reliably as a custom class deallocator. Except that __del__ prevents cyclic GC. You are

Re: Storing a C pointer in a Python class instance

2009-09-30 Thread sturlamolden
is as reliable as a custom type's tp_dealloc. You are right. I did not look at the PyCObject_* API close enough. I thought of wrapping the CObject with a Python class, and calling the destructor from __del__. That would be less reliable. S.M. -- http://mail.python.org/mailman/listinfo/python

Storing a C pointer in a Python class instance

2009-09-29 Thread lallous
Hello From my C extension module I want to store a C pointer in a given PyObject. The only way I figure how to do it is to use Py_BuildValues and store the poiner casted to Py_ssize_t, thus: Py_BuildValues(n, (Py_ssize_t)my_ptr) Can it be done differently? Regards, Elias --

Re: Storing a C pointer in a Python class instance

2009-09-29 Thread Falcolas
On Sep 29, 2:27 am, lallous lall...@lgwm.org wrote: Hello From my C extension module I want to store a C pointer in a given PyObject. The only way I figure how to do it is to use Py_BuildValues and store the poiner casted to Py_ssize_t, thus: Py_BuildValues(n, (Py_ssize_t)my_ptr) Can it

Re: Storing a C pointer in a Python class instance

2009-09-29 Thread sturlamolden
). If the pointer references a resource that needs to be closed, this is safer than using a __del__ method in a Python class. -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing a C pointer in a Python class instance

2009-09-29 Thread Carl Banks
On Sep 29, 9:42 am, sturlamolden sturlamol...@yahoo.no wrote: You can use PyCObject, or write your own extension type that wraps the pointer (very easy to to with Cython or Pyrex). The advantage of using an extension type is you have a guarantee from Python on the deallocator method being

Re: Storing a C pointer in a Python class instance

2009-09-29 Thread sturlamolden
On 29 Sep, 19:11, Carl Banks pavlovevide...@gmail.com wrote: CObjects can be passed a C function as a deallocator; this should work as reliably as a custom class deallocator. Carl Banks Except that __del__ prevents cyclic GC. -- http://mail.python.org/mailman/listinfo/python-list

Visualization of Python Class Hierarchy

2009-07-16 Thread lh
I would like to automatically generate this for my program. I am running python in an eclipse context (pydev). I am not familiar with the best current tools. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Intro to Python class, 7/21-23, Ft Worth TX

2009-07-02 Thread Rich Drehoff
We are looking for someone that can help with the subject class, Intro to Python class, 7/21-23, Ft Worth TX. Please let me know if you can help. Would need your resume and best possible daily rate. Best regards, Rich Drehoff TechnoTraining, Inc. 328 Office Square Lane, Ste. 202

Python class gotcha with scope?

2009-06-21 Thread billy
I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict, then it would. class foo: ... r = {} ... def setn(self, n): ... self.r[f] = n ... a = foo() a.setn(4) b = foo() b.r {'f': 4} thanks, billy --

Re: Python class gotcha with scope?

2009-06-21 Thread Vincent
On Jun 21, 2:32 pm, billy billy.cha...@gmail.com wrote: I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict, then it would. class foo: ...     r = {} ...     def setn(self, n): ...             self.r[f] = n ... a =

Re: Python class gotcha with scope?

2009-06-21 Thread Vincent
On Jun 21, 2:38 pm, Vincent pho...@gmail.com wrote: On Jun 21, 2:32 pm, billy billy.cha...@gmail.com wrote: I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict, then it would. class foo: ...     r = {} ...    

Re: Python class gotcha with scope?

2009-06-21 Thread Carl Banks
On Jun 20, 11:32 pm, billy billy.cha...@gmail.com wrote: I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict, then it would. class foo: ...     r = {} ...     def setn(self, n): ...             self.r[f] = n ... a =

Re: Python class gotcha with scope?

2009-06-21 Thread billy
great, thanks for the quick responses :) On Jun 21, 2:41 am, Carl Banks pavlovevide...@gmail.com wrote: On Jun 20, 11:32 pm, billy billy.cha...@gmail.com wrote: I don't quite understand why this happens. Why doesn't b have its own version of r? If r was just an int instead of a dict, then

Introduction to Python Class, in Chicago, May 11-13, 2009.

2009-01-07 Thread David Beazley
David Beazley, author of the Python Essential Reference is pleased to announce an Introduction to Python class on May 11-13, 2009 in Chicago, Illinois. This course, open to individual enrollment, is a comprehensive hands-on course for programmers, scientists, and engineers who want to master

Re: Final Python Class of 2008

2008-11-11 Thread Steve Holden
Steve Holden wrote: As the year draws to a close, Holden Web is pleased to remind readers that its final public Introduction to Python class of this year will be held from 9-11 December at our education center close to Washington, DC. There are several hotels conveniently located within

Re: Final Python Class of 2009

2008-11-11 Thread skip
Steve, have you been in Guido's time machine again? Steve No, honest (hides hands behind back). Well then what's that red stuff on your face that looks like strawberry jam? Could it be the special grease we store next to the keys to the time machine? Skip --

Re: Final Python Class of 2009

2008-11-11 Thread Steve Holden
Steven D'Aprano wrote: On Mon, 10 Nov 2008 22:14:16 -0500, Steve Holden wrote: Subject: Final Python Class of 2009 Steve, have you been in Guido's time machine again? :-) No, honest (hides hands behind back). regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119

Re: Final Python Class of 2009

2008-11-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: Steve, have you been in Guido's time machine again? Steve No, honest (hides hands behind back). Well then what's that red stuff on your face that looks like strawberry jam? Could it be the special grease we store next to the keys to the time machine?

Final Python Class of 2009

2008-11-10 Thread Steve Holden
As the year draws to a close, Holden Web is pleased to remind readers that its final public Introduction to Python class of this year will be held from 9-11 December at our education center close to Washington, DC. There are several hotels conveniently located within walking distance, and we

Re: Final Python Class of 2009

2008-11-10 Thread Steven D'Aprano
On Mon, 10 Nov 2008 22:14:16 -0500, Steve Holden wrote: Subject: Final Python Class of 2009 Steve, have you been in Guido's time machine again? -- Steven (not Steve Holden, another one) -- http://mail.python.org/mailman/listinfo/python-list

2009 Python class schedule

2008-11-06 Thread Mark Lutz
A page describing our 2009 Python class offerings has just been posted here: http://home.earthlink.net/~python-training/2009-public-classes.htm The first class in 2009 will be held January 27-30 in Colorado, and is now open for enrollments. These are public classes, open to individuals

Re: Simple Python class questions

2008-06-20 Thread John Dann
Many thanks for the further comments: On Thu, 19 Jun 2008 21:24:31 -0400, Terry Reedy [EMAIL PROTECTED] wrote: def __init__(self): Try Import serial # the pyserial library The import should be at module level. You only want to do it once, not for

Re: Simple Python class questions

2008-06-20 Thread cokofreedom
Yes I was wondering about that, but I wasn't clear about when 'body' code (ie not contained within a def block) in the module might run under Python. So it seemed to be safer to place the import statement inside the 'constructor' to get the earliest warning of non-visibility of pyserial. But

Re: Simple Python class questions

2008-06-20 Thread Duncan Booth
John Dann [EMAIL PROTECTED] wrote: Yes I was wondering about that, but I wasn't clear about when 'body' code (ie not contained within a def block) in the module might run under Python. So it seemed to be safer to place the import statement inside the 'constructor' to get the earliest warning

Re: Simple Python class questions

2008-06-20 Thread Lie
On Jun 19, 10:49 pm, Ulrich Eckhardt [EMAIL PROTECTED] wrote: Lie wrote: I think it's not that hard to see that it's just a pseudo code ...in comms.py I have: ... actually explicitly says that it is actual code from a file. *shrug* Uli I'm not sure how you think saying 'in comms.py I

Re: Simple Python class questions

2008-06-20 Thread David C. Ullrich
In article [EMAIL PROTECTED], Lie [EMAIL PROTECTED] wrote: On Jun 19, 7:21 pm, Ulrich Eckhardt [EMAIL PROTECTED] wrote: John Dann wrote: Let's say I define the class in a module called comms.py. The class isn't really going to inherit from any other class (except presumably in the

Simple Python class questions

2008-06-19 Thread John Dann
A Python newbie, but some basic understanding of how classes, objects etc work in eg VB.Net. However, I'm struggling a little to translate this knowledge into the Python context. I'm trying to teach myself this aspect of Python by working up a trial project, part of which calls for pulling in

Re: Simple Python class questions

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 13:54:03 John Dann, vous avez écrit : A Python newbie, but some basic understanding of how classes, objects etc work in eg VB.Net. However, I'm struggling a little to translate this knowledge into the Python context. Maybe I could provide some outline code as an

Re: Simple Python class questions

2008-06-19 Thread Lie
On Jun 19, 6:54 pm, John Dann [EMAIL PROTECTED] wrote: A Python newbie, but some basic understanding of how classes, objects etc work in eg VB.Net. However, I'm struggling a little to translate this knowledge into the Python context. I'm trying to teach myself this aspect of Python by working

Re: Simple Python class questions

2008-06-19 Thread Ulrich Eckhardt
John Dann wrote: Let's say I define the class in a module called comms.py. The class isn't really going to inherit from any other class (except presumably in the most primitive base-class sense, which is presumably automatic and implicit in using the class keyword). Let's call the class

Re: Simple Python class questions

2008-06-19 Thread John Dann
Many thanks for the speedy replies. On Thu, 19 Jun 2008 14:14:02 +0200, Cédric Lucantis [EMAIL PROTECTED] wrote: Le Thursday 19 June 2008 13:54:03 John Dann, vous avez écrit : Let's say I define the class in a module called comms.py. The class isn't really going to inherit from any other class

Re: Simple Python class questions

2008-06-19 Thread Cédric Lucantis
python class, used as a base for all classes as in many OO languages. -- Cédric Lucantis -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python class questions

2008-06-19 Thread Lie
On Jun 19, 7:21 pm, Ulrich Eckhardt [EMAIL PROTECTED] wrote: John Dann wrote: Let's say I define the class in a module called comms.py. The class isn't really going to inherit from any other class (except presumably in the most primitive base-class sense, which is presumably automatic and

Re: Simple Python class questions

2008-06-19 Thread Ulrich Eckhardt
Lie wrote: I think it's not that hard to see that it's just a pseudo code ...in comms.py I have: ... actually explicitly says that it is actual code from a file. *shrug* Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 --

Re: Simple Python class questions

2008-06-19 Thread Terry Reedy
John Dann wrote: Let's say I define the class in a module called comms.py. The class isn't really going to inherit from any other class (except presumably in the most primitive base-class sense, which is presumably automatic and implicit in using the class keyword). Let's call the class

Re: Python Class Best Practice

2007-12-12 Thread MarkE
On 4 Dec, 23:18, Rod Person [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating the base classes and libraries

Re: Python Class Best Practice

2007-12-07 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Dec 5, 12:18 am, Rod Person [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating

Re: Python Class Best Practice

2007-12-05 Thread cptnwillard
On Dec 5, 12:18 am, Rod Person [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating the base classes and

Python Class Best Practice

2007-12-04 Thread Rod Person
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating the base classes and libraries I wondering which why is consider best when creating

Re: Python Class Best Practice

2007-12-04 Thread Gary Herron
Rod Person wrote: I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating the base classes and libraries I wondering which why is consider best when creating python classes: 1: class

Re: Python Class Best Practice

2007-12-04 Thread Rod Person
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, 04 Dec 2007 15:51:18 -0800 Gary Herron [EMAIL PROTECTED] wrote: Rod Person wrote: 1: class Foo(object): member1='' member2=0 def __init__(self,member1='',member2=0): self.member1 = member1 self.member2 =

Re: Python Class Best Practice

2007-12-04 Thread Pavan Mishra
On Dec 5, 4:18 am, Rod Person [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've been doing python programming for about 2 years as a hobby and now I'm finally able to use it at work in an enterprise environment. Since I will be creating the base classes and

  1   2   3   >